|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
46 void ClientFactory::add (
const std::string& aProtocol ,
const std::string& aDescription,
bool aUserDefined )
48 boost::unordered_map<std::string , ClientInfo >::const_iterator lIt =
mClientMap.find ( aProtocol ) ;
52 log (
Warning() ,
"Protocol \"" , aProtocol ,
"\" already exists in map of creators. Continuing for now, but be warned." );
67 add<T>(aProtocol, aDescription,
true);
Templated concrete implementation with a CreatorInterface interface.
static ClientFactory & getInstance()
Static method to retrieve the single instance of the class.
boost::shared_ptr< ClientInterface > create(const std::string &aId, const URI &aUri)
Concrete function which creates a new IPbus client based on the protocol identifier specified.
boost::unordered_map< std::string, ClientInfo > mClientMap
Hash map associating a creator for a particular protocol with a file name.
boost::shared_ptr< CreatorInterface > creator
void log(FatalLevel &aFatal, const T0 &aArg0)
Function to add a log entry at Fatal level.
void add(const std::string &aProtocol, const std::string &aDescription, bool aUserDefined)
Method to create an associate between a protocol identifier and a Creator of a particular type.
void registerClient(const std::string &aProtocol, const std::string &aDescription="")
Method to create an associate between a protocol identifier and a Creator of a particular type.
Struct to store a URI when parsed by boost spirit.
static bool init(const std::string &aUri, const std::string &aDescription)