|
μHAL (v2.7.9)
Part of the IPbus software repository
|
Go to the documentation of this file.
40 #ifndef _uhal_ClientFactory_hpp_
41 #define _uhal_ClientFactory_hpp_
46 #include <boost/noncopyable.hpp>
47 #include <boost/shared_ptr.hpp>
48 #include <boost/unordered_map.hpp>
60 UHAL_DEFINE_EXCEPTION_CLASS ( ProtocolDoesNotExist ,
"Exception class to handle the case where the protocol requested does not exists in the creator map." )
117 void registerClient (
const std::string& aProtocol ,
const std::string& aDescription =
"" );
125 static bool init(
const std::string& aUri,
const std::string& aDescription);
136 void add (
const std::string& aProtocol ,
const std::string& aDescription,
bool aUserDefined );
203 #define UHAL_REGISTER_EXTERNAL_CLIENT(clientclass, clienturi, clientdescription) \
204 template<> bool uhal::ClientFactory::RegistrationHelper<clientclass>::sInitialised = \
205 uhal::ClientFactory::RegistrationHelper<clientclass>::init(clienturi, clientdescription);
static boost::shared_ptr< ClientFactory > mInstance
The single instance of the class.
Templated concrete implementation with a CreatorInterface interface.
#define UHAL_DEFINE_EXCEPTION_CLASS(ClassName, ClassDescription)
CreatorInterface()
Default constructor.
A class to construct an IPbus client based on the protocol identifier specified NOTE!...
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
Creator()
Default constructor.
virtual ~CreatorInterface()
Destructor.
virtual boost::shared_ptr< ClientInterface > create(const std::string &aId, const URI &aUri)=0
Interface to a function which create a new IPbus client based on the protocol identifier specified.
for(size_t i=0;i< lDepths.size();i++)
An abstract base class for defining the interface to the creators.
static bool sInitialised
Dummy variable required as initialisation target.
Struct to store a URI when parsed by boost spirit.
virtual ~Creator()
Destructor.