DUECA/DUSIME
|
Global registry for information about Dueca Communication Object (DCO) types. More...
#include <DataClassRegistry.hxx>
Public Types | |
typedef DataClassRegistry_entry_type | entry_type |
type of a single entry in the map – external | |
Public Member Functions | |
const CommObjectDataTable * | getTable (const std::string &classname) |
Access the table with communication objects. | |
DataClassRegistry_entry_type | getEntry (const std::string &classname) |
Return a quick-access entry index given a classname. | |
map_type::mapped_type | getEntryShared (const std::string &classname) |
Return a quick-access entry index given a classname. | |
const CommObjectMemberAccessBasePtr & | getMemberAccessor (DataClassRegistry_entry_type ix, const std::string &membername) |
Get an accessor to data member with name membername. | |
bool | isRegistered (const std::string &classname) |
Check whether a class is registered. | |
const CommObjectMemberAccessBasePtr & | getMemberAccessor (DataClassRegistry_entry_type ix, unsigned idx) |
get an accessor to data member index idx. | |
const char * | getMemberName (DataClassRegistry_entry_type ix, unsigned idx) const |
Retrieve the name of a member, given a dataclass entry. | |
const unsigned | getMemberIndex (DataClassRegistry_entry_type ix, const std::string &name) |
Retrieve the offset number of a member, given the dataclass entry and member name. | |
size_t | getNumMembers (DataClassRegistry_entry_type ix) const |
Return the number of members in a class. | |
uint32_t | getMagic (DataClassRegistry_entry_type ix) const |
Get the magic number. | |
const char * | getEntryClassname (DataClassRegistry_entry_type ix) const |
Get the classname of a specific entry type. | |
const std::string & | getParent (const std::string &classname) |
Get the parent class for the data type given in the classname. | |
bool | isCompatible (const std::string &tryclass, const std::string &classname) |
See whether a class is a parent of (compatible with reading) another class. | |
const DataSetConverter * | getConverter (const std::string &classname) const |
Get a pointer to the dataset converter for this data type. | |
std::weak_ptr< DCOMetaFunctor > | getMetaFunctor (const std::string &classname, const std::string &fname) const |
Get a metafunctor, searched by name. | |
Static Public Member Functions | |
static DataClassRegistry & | single () |
Singleton access. | |
Friends | |
class | DataClassRegistrar |
Only the DataClassRegistrar can supply new DCO types. | |
Global registry for information about Dueca Communication Object (DCO) types.
Note that most of the interfaces of this class are being used internally by DUECA. For some external projects it may be useful to inspect DCO classes.
DataClassRegistry_entry_type dueca::DataClassRegistry::getEntry | ( | const std::string & | classname | ) |
Return a quick-access entry index given a classname.
This returns a plain C++ pointer.
classname | name of the data class |
map_type::mapped_type dueca::DataClassRegistry::getEntryShared | ( | const std::string & | classname | ) |
Return a quick-access entry index given a classname.
Contrary to the above call, this returns a shared pointer.
classname | name of the data class |
const CommObjectMemberAccessBasePtr & dueca::DataClassRegistry::getMemberAccessor | ( | DataClassRegistry_entry_type | ix, |
const std::string & | membername ) |
Get an accessor to data member with name membername.
If the member name is not available in the present class, parent classes are tested.
ix | index previously returned by getEntry call |
membername | name of the data member |
const CommObjectMemberAccessBasePtr & dueca::DataClassRegistry::getMemberAccessor | ( | DataClassRegistry_entry_type | ix, |
unsigned | idx ) |
get an accessor to data member index idx.
Note that data members indices count from the parents
ix | index returned by the getEntry call |
idx | number of the data member |
const char * dueca::DataClassRegistry::getMemberName | ( | DataClassRegistry_entry_type | ix, |
unsigned | idx ) const |
Retrieve the name of a member, given a dataclass entry.
ix | index returned by the getEntry call |
idx | number of the data member |
const unsigned dueca::DataClassRegistry::getMemberIndex | ( | DataClassRegistry_entry_type | ix, |
const std::string & | name ) |
Retrieve the offset number of a member, given the dataclass entry and member name.
ix | index of the class, returned by getEntry call |
name | name of the data member |
size_t dueca::DataClassRegistry::getNumMembers | ( | DataClassRegistry_entry_type | ix | ) | const |
Return the number of members in a class.
ix | index of the class, returned by getEntry call |
uint32_t dueca::DataClassRegistry::getMagic | ( | DataClassRegistry_entry_type | ix | ) | const |
Get the magic number.
The magic number is hashed for each data class. It is used as a check on consistency, when communicating with other DUECA processes.
ix | index of the class, returned by getEntry call |
const char * dueca::DataClassRegistry::getEntryClassname | ( | DataClassRegistry_entry_type | ix | ) | const |
Get the classname of a specific entry type.
ix | index of the class, returned by getEntry call |
Get the parent class for the data type given in the classname.
classname | child class name |
bool dueca::DataClassRegistry::isCompatible | ( | const std::string & | tryclass, |
const std::string & | classname ) |
See whether a class is a parent of (compatible with reading) another class.
tryclass | Class you want to access/read with |
classname | Class given. |
const DataSetConverter * dueca::DataClassRegistry::getConverter | ( | const std::string & | classname | ) | const |
Get a pointer to the dataset converter for this data type.
classname | data type class name |
std::weak_ptr< DCOMetaFunctor > dueca::DataClassRegistry::getMetaFunctor | ( | const std::string & | classname, |
const std::string & | fname ) const |
Get a metafunctor, searched by name.
Functors are used to implement specific services on dataclasses. They typically need to contain state information (like, "to which file do I write"), and are thus client-specific. This returns the metafunctor, which is only type-specific, and can be asked to return functors. The returned functors can be used in combination with a channel read or write token.
classname | data class name |
fname | functor name |