#ifndef PRIMARY_VIRTUALSECONDARY_H_
#define PRIMARY_VIRTUALSECONDARY_H_

#include <string>

#include "libaktualizr/types.h"
#include "managedsecondary.h"

namespace Primary {

class VirtualSecondaryConfig : public ManagedSecondaryConfig {
 public:
  VirtualSecondaryConfig() : ManagedSecondaryConfig(Type) {}
  VirtualSecondaryConfig(const Json::Value& json_config);

  static std::vector<VirtualSecondaryConfig> create_from_file(const boost::filesystem::path& file_full_path);
  void dump(const boost::filesystem::path& file_full_path) const;

 public:
  static const char* const Type;
};

class VirtualSecondary : public ManagedSecondary {
 public:
  explicit VirtualSecondary(Primary::VirtualSecondaryConfig sconfig_in);
  ~VirtualSecondary() override = default;

  std::string Type() const override { return VirtualSecondaryConfig::Type; }
  data::InstallationResult putMetadata(const Uptane::Target& target) override;
  data::InstallationResult putRoot(const std::string& root, bool director) override;
  data::InstallationResult sendFirmware(const Uptane::Target& target) override;
  data::InstallationResult install(const Uptane::Target& target) override;

  bool ping() const override { return true; }
};

}  // namespace Primary

#endif  // PRIMARY_VIRTUALSECONDARY_H_

#ifndef PRIMARY_VIRTUALSECONDARY_H_
#define PRIMARY_VIRTUALSECONDARY_H_

#include <string>

#include "libaktualizr/types.h"
#include "managedsecondary.h"

namespace Primary {

class VirtualSecondaryConfig : public ManagedSecondaryConfig {
 public:
  VirtualSecondaryConfig() : ManagedSecondaryConfig(Type) {}
  explicit VirtualSecondaryConfig(const Json::Value& json_config);

  static std::vector<VirtualSecondaryConfig> create_from_file(const boost::filesystem::path& file_full_path);
  void dump(const boost::filesystem::path& file_full_path) const;

 public:
  static const char* const Type;
};

class VirtualSecondary : public ManagedSecondary {
 public:
  explicit VirtualSecondary(Primary::VirtualSecondaryConfig sconfig_in);
  ~VirtualSecondary() override = default;

  std::string Type() const override { return VirtualSecondaryConfig::Type; }
  data::InstallationResult putMetadata(const Uptane::Target& target) override;
  data::InstallationResult putRoot(const std::string& root, bool director) override;
  data::InstallationResult sendFirmware(const Uptane::Target& target) override;
  data::InstallationResult install(const Uptane::Target& target) override;

  bool ping() const override { return true; }
};

}  // namespace Primary

#endif  // PRIMARY_VIRTUALSECONDARY_H_

Add 'explicit' keyword to single argument ctor
Add 'explicit' keyword to single argument ctor

Avoid a potential implicit Json::Value -> VirtualSecondaryConfig conversion.

Signed-off-by: Phil Wise <e888d2bd6f13f82caa51a37c03d034c76f661ba3@phil-wise.com>
