|
Eris
1.3.19
|
A service class querying and caching types. More...
#include <TypeService.h>
Public Member Functions | |
| TypeService (Connection *con) | |
| void | init () |
| TypeInfoPtr | getTypeByName (const std::string &tynm) |
| find the TypeInfo for the named type; this may involve a search, or a map lookup. More... | |
| TypeInfoPtr | getTypeForAtlas (const Atlas::Objects::Root &obj) |
| retrive the TypeInfo for an object; this should be faster (hopefully constant time) since it can take advantage of integer typeids | |
| TypeInfoPtr | findTypeByName (const std::string &tynm) |
| Lookup the requested type, by name, and return NULL if it's unknown. More... | |
| void | listUnbound () |
| void | handleOperation (const Atlas::Objects::Operation::RootOperation &) |
Public Attributes | |
| sigc::signal< void, TypeInfoPtr > | BoundType |
| emitted when a new type is available and bound to it's parents | |
| sigc::signal< void, TypeInfoPtr > | BadType |
| emitted when a type is confirmed as being undefined | |
Protected Types | |
|
typedef std::map< std::string, TypeInfoPtr > | TypeInfoMap |
Protected Member Functions | |
| void | sendRequest (const std::string &id) |
| request the information about a type from the server. More... | |
| void | recvTypeInfo (const Atlas::Objects::Root &atype) |
| void | recvError (const Atlas::Objects::Operation::Get &get) |
| TypeInfoPtr | defineBuiltin (const std::string &name, TypeInfoPtr parent) |
Protected Attributes | |
| TypeInfoMap | m_types |
| The easy bit : a simple map from 'string-id' (e.g 'look' or 'farmer') to the corresponding TypeInfo instance. More... | |
| Connection * | m_con |
| bool | m_inited |
A service class querying and caching types.
| TypeInfoPtr Eris::TypeService::findTypeByName | ( | const std::string & | tynm | ) |
Lookup the requested type, by name, and return NULL if it's unknown.
References m_types.
Referenced by Eris::TypeInfo::processTypeData().
| TypeInfoPtr Eris::TypeService::getTypeByName | ( | const std::string & | tynm | ) |
find the TypeInfo for the named type; this may involve a search, or a map lookup.
The returned TypeInfo node may not be bound, and the caller should verify this before using the type.
References m_types, and sendRequest().
Referenced by getTypeForAtlas(), Eris::Entity::getUseOperations(), Eris::TypeInfo::processTypeData(), and Eris::TypeInfo::resolveChildren().
|
protected |
request the information about a type from the server.
| id | The ID of the type to lookup |
References Eris::Connection::send().
Referenced by getTypeByName().
|
protected |
The easy bit : a simple map from 'string-id' (e.g 'look' or 'farmer') to the corresponding TypeInfo instance.
This could be a hash_map in the future, if efficeny consdierations indicate it would be worthwhile
Referenced by findTypeByName(), and getTypeByName().
1.8.6