conexus logo

Conexus::Factory Class Reference

#include <factory.h>

List of all members.

Public Types

typedef ConexusPointer< Factorypointer
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 Namesnames ()
const IndexNameMapindex_name_map ()
const NameIndexMapname_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 ()
Registryregistry ()
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


Detailed Description

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>

Member Typedef Documentation

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


Constructor & Destructor Documentation

Conexus::Factory::Factory (  ) 

Referenced by create().

Conexus::Factory::~Factory (  ) 


Member Function Documentation

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.

Returns:
The index assigned to this creator or 0 if the add failed.

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.

Returns:
The index assigned to this creator or 0 if the add failed.

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() 
)

Object::pointer Conexus::Factory::create ( unsigned long  index,
const std::string &  instance_name = std::string() 
)

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() 
)

Endpoint::pointer Conexus::Factory::create_endpoint ( unsigned long  index,
const std::string &  instance_name = std::string() 
)

References Conexus::Registry::add(), m_index_creator, and registry().

Referenced by create().

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  ) 

References m_name_index.

Referenced by remove().

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  ) 

References m_index_name.

Referenced by remove().

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 (  ) 

bool Conexus::Factory::remove ( EndpointServerCreator  cr  ) 

References index().

bool Conexus::Factory::remove ( EndpointCreator  cr  ) 

References index().

bool Conexus::Factory::remove ( const std::string &  name  ) 

bool Conexus::Factory::remove ( unsigned long  index  ) 

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.


Member Data Documentation

Referenced by add(), create_endpoint(), index(), and remove().

Referenced by add(), index_name_map(), name(), and remove().

Referenced by add(), create_server(), index(), and remove().

Referenced by add(), create_endpoint(), name(), and remove().

Referenced by add(), index(), name_index_map(), and remove().

Referenced by add(), create_server(), name(), and remove().

Referenced by add(), names(), and remove().

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().


The documentation for this class was generated from the following files:

Generated on Wed Jul 8 15:51:20 2009 for conexus by doxygen 1.5.8