1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

lib/plugin: make type an argument of constructor

This commit is contained in:
daniel-k 2018-01-10 15:42:33 +01:00
parent 3cf50db98d
commit 09534e83a6
4 changed files with 6 additions and 7 deletions

View file

@ -106,8 +106,7 @@ class PCIeCardFactory : public Plugin {
public:
PCIeCardFactory() :
Plugin("FPGA Card plugin")
{ pluginType = Plugin::Type::FpgaCard; }
Plugin(Plugin::Type::FpgaCard, "FPGA Card plugin") {}
static CardList
make(json_t *json, struct pci* pci, ::vfio_container* vc);

View file

@ -145,8 +145,8 @@ using IpCoreList = std::list<std::unique_ptr<IpCore>>;
class IpCoreFactory : public Plugin {
public:
IpCoreFactory(std::string concreteName) :
Plugin(std::string("IpCore - ") + concreteName)
{ pluginType = Plugin::Type::FpgaIp; }
Plugin(Plugin::Type::FpgaIp, std::string("IpCore - ") + concreteName)
{}
/// Returns a running and checked FPGA IP
static IpCoreList

View file

@ -42,7 +42,7 @@ public:
FpgaCard,
};
Plugin(std::string name);
Plugin(Type type, const std::string& name);
virtual ~Plugin();
// copying a plugin doesn't make sense, so explicitly deny it

View file

@ -45,8 +45,8 @@ Plugin::pluginListBuffer;
int Plugin::pluginListNiftyCounter;
Plugin::Plugin(std::string name) :
pluginType(Plugin::Type::Unknown),
Plugin::Plugin(Type type, const std::string& name) :
pluginType(type),
name(name),
description(""),
path(""),