#include <factory.h>
Public Types | |
typedef ConexusPointer< Factory > | pointer |
typedef std::set< std::string > | Names |
typedef std::map< unsigned long, std::string > | IndexNameMap |
typedef std::map< std::string, unsigned long > | NameIndexMap |
typedef Endpoint::pointer(* | EndpointCreator )() |
typedef EndpointServer::pointer(* | EndpointServerCreator )() |
Public Member Functions | |
Factory () | |
~Factory () | |
const Names & | names () |
const IndexNameMap & | index_name_map () |
const NameIndexMap & | name_index_map () |
unsigned long | index (const std::string &name) |
unsigned long | index (EndpointCreator cr) |
unsigned long | index (EndpointServerCreator cr) |
std::string | name (unsigned long index) |
std::string | name (EndpointCreator cr) |
std::string | name (EndpointServerCreator cr) |
unsigned long | add (const std::string &name, EndpointCreator cr, unsigned long index=0) |
Adds the endpoint creator by name to the factory. | |
unsigned long | add (const std::string &name, EndpointServerCreator cr, unsigned long index=0) |
Adds the endpoint server creator by name to the factory. | |
bool | remove (unsigned long index) |
bool | remove (const std::string &name) |
bool | remove (EndpointCreator cr) |
bool | remove (EndpointServerCreator cr) |
Endpoint::pointer | create_endpoint (unsigned long index, const std::string &instance_name=std::string()) |
Endpoint::pointer | create_endpoint (const std::string &class_name, const std::string &instance_name=std::string()) |
EndpointServer::pointer | create_server (unsigned long index, const std::string &instance_name=std::string()) |
EndpointServer::pointer | create_server (const std::string &class_name, const std::string &instance_name=std::string()) |
Object::pointer | create (unsigned long index, const std::string &instance_name=std::string()) |
Object::pointer | create (const std::string &class_name, const std::string &instance_name=std::string()) |
sigc::signal< void, const std::string & > | signal_added () |
sigc::signal< void, const std::string & > | signal_removed () |
Registry & | registry () |
void | set_registry (Registry::pointer registry) |
Static Public Member Functions | |
static pointer | create () |
Protected Types | |
typedef std::map< unsigned long, EndpointCreator > | IndexCreatorMap |
typedef std::map< std::string, EndpointCreator > | NameCreatorMap |
typedef std::map< unsigned long, EndpointServerCreator > | IndexServerCreatorMap |
typedef std::map< std::string, EndpointServerCreator > | NameServerCreatorMap |
Protected Attributes | |
Names | m_names |
IndexCreatorMap | m_index_creator |
NameCreatorMap | m_name_creator |
IndexServerCreatorMap | m_index_servercreator |
NameServerCreatorMap | m_name_servercreator |
IndexNameMap | m_index_name |
NameIndexMap | m_name_index |
Registry::pointer | m_registry |
sigc::signal< void, const std::string & > | m_signal_added |
sigc::signal< void, const std::string & > | m_signal_removed |
typedef Endpoint::pointer(* Conexus::Factory::EndpointCreator)() |
typedef std::map<unsigned long,EndpointCreator> Conexus::Factory::IndexCreatorMap [protected] |
typedef std::map<unsigned long,std::string> Conexus::Factory::IndexNameMap |
typedef std::map<unsigned long,EndpointServerCreator> Conexus::Factory::IndexServerCreatorMap [protected] |
typedef std::map<std::string,EndpointCreator> Conexus::Factory::NameCreatorMap [protected] |
typedef std::map<std::string,unsigned long> Conexus::Factory::NameIndexMap |
typedef std::set<std::string> Conexus::Factory::Names |
typedef std::map<std::string,EndpointServerCreator> Conexus::Factory::NameServerCreatorMap [protected] |
typedef ConexusPointer<Factory> Conexus::Factory::pointer |
Conexus::Factory::Factory | ( | ) |
Referenced by create().
Conexus::Factory::~Factory | ( | ) |
unsigned long Conexus::Factory::add | ( | const std::string & | name, | |
EndpointServerCreator | cr, | |||
unsigned long | index = 0 | |||
) |
Adds the endpoint server creator by name to the factory.
If index is 0, an unused index will be assigned.
References m_index_name, m_index_servercreator, m_name_index, m_name_servercreator, m_names, and m_signal_added.
unsigned long Conexus::Factory::add | ( | const std::string & | name, | |
EndpointCreator | cr, | |||
unsigned long | index = 0 | |||
) |
Adds the endpoint creator by name to the factory.
If index is 0, an unused index will be assigned.
References m_index_creator, m_index_name, m_name_creator, m_name_index, m_names, and m_signal_added.
Referenced by Conexus::init().
Object::pointer Conexus::Factory::create | ( | const std::string & | class_name, | |
const std::string & | instance_name = std::string() | |||
) |
References create_endpoint(), and create_server().
Object::pointer Conexus::Factory::create | ( | unsigned long | index, | |
const std::string & | instance_name = std::string() | |||
) |
References create_endpoint(), and create_server().
Factory::pointer Conexus::Factory::create | ( | ) | [static] |
References Factory().
Endpoint::pointer Conexus::Factory::create_endpoint | ( | const std::string & | class_name, | |
const std::string & | instance_name = std::string() | |||
) |
References Conexus::Registry::add(), m_name_creator, and registry().
Endpoint::pointer Conexus::Factory::create_endpoint | ( | unsigned long | index, | |
const std::string & | instance_name = std::string() | |||
) |
EndpointServer::pointer Conexus::Factory::create_server | ( | const std::string & | class_name, | |
const std::string & | instance_name = std::string() | |||
) |
References m_name_servercreator.
EndpointServer::pointer Conexus::Factory::create_server | ( | unsigned long | index, | |
const std::string & | instance_name = std::string() | |||
) |
unsigned long Conexus::Factory::index | ( | EndpointServerCreator | cr | ) |
References m_index_servercreator.
unsigned long Conexus::Factory::index | ( | EndpointCreator | cr | ) |
References m_index_creator.
unsigned long Conexus::Factory::index | ( | const std::string & | name | ) |
const Factory::IndexNameMap & Conexus::Factory::index_name_map | ( | ) |
References m_index_name.
std::string Conexus::Factory::name | ( | EndpointServerCreator | cr | ) |
References m_name_servercreator.
std::string Conexus::Factory::name | ( | EndpointCreator | cr | ) |
References m_name_creator.
std::string Conexus::Factory::name | ( | unsigned long | index | ) |
const Factory::NameIndexMap & Conexus::Factory::name_index_map | ( | ) |
References m_name_index.
const Factory::Names & Conexus::Factory::names | ( | ) |
References m_names.
Registry & Conexus::Factory::registry | ( | ) |
References Conexus::default_registry(), and m_registry.
Referenced by create_endpoint(), and create_server().
bool Conexus::Factory::remove | ( | EndpointServerCreator | cr | ) |
References index().
bool Conexus::Factory::remove | ( | EndpointCreator | cr | ) |
References index().
bool Conexus::Factory::remove | ( | const std::string & | name | ) |
References index(), m_index_creator, m_index_name, m_index_servercreator, m_name_creator, m_name_index, m_name_servercreator, m_names, and m_signal_removed.
bool Conexus::Factory::remove | ( | unsigned long | index | ) |
References m_index_creator, m_index_name, m_index_servercreator, m_name_creator, m_name_index, m_name_servercreator, m_names, m_signal_removed, and name().
void Conexus::Factory::set_registry | ( | Registry::pointer | registry | ) |
References m_registry.
sigc::signal< void, const std::string & > Conexus::Factory::signal_added | ( | ) |
References m_signal_added.
sigc::signal< void, const std::string & > Conexus::Factory::signal_removed | ( | ) |
References m_signal_removed.
IndexCreatorMap Conexus::Factory::m_index_creator [protected] |
Referenced by add(), create_endpoint(), index(), and remove().
IndexNameMap Conexus::Factory::m_index_name [protected] |
Referenced by add(), index_name_map(), name(), and remove().
Referenced by add(), create_server(), index(), and remove().
NameCreatorMap Conexus::Factory::m_name_creator [protected] |
Referenced by add(), create_endpoint(), name(), and remove().
NameIndexMap Conexus::Factory::m_name_index [protected] |
Referenced by add(), index(), name_index_map(), and remove().
Referenced by add(), create_server(), name(), and remove().
Names Conexus::Factory::m_names [protected] |
Registry::pointer Conexus::Factory::m_registry [protected] |
Referenced by registry(), and set_registry().
sigc::signal<void,const std::string&> Conexus::Factory::m_signal_added [protected] |
Referenced by add(), and signal_added().
sigc::signal<void,const std::string&> Conexus::Factory::m_signal_removed [protected] |
Referenced by remove(), and signal_removed().