$search
Registry of constructors to a stream, to add new stream types dynamically. More...
#include <dashel.h>
Public Types | |
| typedef Stream *(* | CreatorFunc )(const std::string &target, const Hub &hub) |
| A function which creates an instance of a stream. | |
Public Member Functions | |
| Stream * | create (const std::string &proto, const std::string &target, const Hub &hub) const |
| Create a stream of a given type, return 0 if type does not exist. | |
| std::string | list () const |
| Return list of stream types. | |
| void | reg (const std::string &proto, const CreatorFunc func) |
| Register a new stream type. | |
| StreamTypeRegistry () | |
| Register known stream types, implemented in different platform-specific files. | |
Protected Types | |
| typedef std::map< std::string, CreatorFunc > | CreatorMap |
| a map of stream type names to constructors and arguments | |
Protected Attributes | |
| CreatorMap | creators |
| streams that can be created | |
Registry of constructors to a stream, to add new stream types dynamically.
Definition at line 521 of file dashel.h.
| typedef Stream*(* Dashel::StreamTypeRegistry::CreatorFunc)(const std::string &target, const Hub &hub) |
typedef std::map<std::string, CreatorFunc> Dashel::StreamTypeRegistry::CreatorMap [protected] |
| Dashel::StreamTypeRegistry::StreamTypeRegistry | ( | ) |
Register known stream types, implemented in different platform-specific files.
Definition at line 1341 of file dashel-posix.cpp.
| Stream * Dashel::StreamTypeRegistry::create | ( | const std::string & | proto, | |
| const std::string & | target, | |||
| const Hub & | hub | |||
| ) | const |
Create a stream of a given type, return 0 if type does not exist.
Definition at line 304 of file dashel-common.cpp.
| std::string Dashel::StreamTypeRegistry::list | ( | ) | const |
Return list of stream types.
Definition at line 314 of file dashel-common.cpp.
| void Dashel::StreamTypeRegistry::reg | ( | const std::string & | proto, | |
| const CreatorFunc | func | |||
| ) |
Register a new stream type.
Definition at line 299 of file dashel-common.cpp.
CreatorMap Dashel::StreamTypeRegistry::creators [protected] |