1 #ifndef ERIS_TYPE_INFO_H
2 #define ERIS_TYPE_INFO_H
4 #include <Eris/Types.h>
5 #include <Eris/TypeService.h>
7 #include <sigc++/trackable.h>
15 typedef std::map<std::string, Element> MapType;
37 class TypeInfo :
virtual public sigc::trackable
70 const std::string&
getName()
const;
98 const Atlas::Message::Element*
getAttribute(
const std::string& attributeName)
const;
112 void setAttribute(
const std::string& attributeName,
const Atlas::Message::Element& element);
142 void onAttributeChanges(
const std::string& attributeName,
const Atlas::Message::Element& element);
156 void extractDefaultAttributes(
const Atlas::Objects::Root& atype);
159 TypeInfoSet m_parents;
161 TypeInfoSet m_children;
164 TypeInfoSet m_ancestors;
167 const std::string m_name;
170 StringSet m_unresolvedChildren;
176 unsigned int m_moveCount;
183 Atlas::Message::MapType m_attributes;
sigc::signal< void, TypeInfoPtr > BoundType
emitted when a new type is available and bound to it's parents
Definition: TypeService.h:45
bool isA(TypeInfoPtr ti)
Test whether this type inherits (directly or indirectly) from the specific class.
Definition: TypeInfo.cpp:45
bool isBound() const
Check the bound flag for this node; if false then recursivley check parents until an authorative is f...
Definition: TypeInfo.h:191
void resolveChildren()
Retrive all child types from the server.
Definition: TypeInfo.cpp:60
const TypeInfoSet & getChildren() const
Gets the currently resolved child TypeInfo instances.
Definition: TypeInfo.h:201
const std::string & getName() const
the unique type name (matches the Atlas type)
Definition: TypeInfo.h:196
A service class querying and caching types.
Definition: TypeService.h:24
TypeInfoPtr findTypeByName(const std::string &tynm)
Lookup the requested type, by name, and return NULL if it's unknown.
Definition: TypeService.cpp:54
bool operator==(const TypeInfo &x) const
efficent comparisom of types (uses type ids if possible)
Definition: TypeInfo.cpp:112
const TypeInfoSet & getParents() const
Gets the currently resolved parent TypeInfo instances.
Definition: TypeInfo.h:206
Definition: LogStream.h:55
TypeInfoPtr getTypeByName(const std::string &tynm)
find the TypeInfo for the named type; this may involve a search, or a map lookup.
Definition: TypeService.cpp:62
bool hasUnresolvedChildren() const
Test if there are child types of the type, which have not yet been retrieved from the server.
Definition: TypeInfo.cpp:55
void processTypeData(const Atlas::Objects::Root &atype)
process the INFO data
Definition: TypeInfo.cpp:77
void setAttribute(const std::string &attributeName, const Atlas::Message::Element &element)
Sets an attribute.
Definition: TypeInfo.cpp:236
The representation of an Atlas type (i.e a class or operation definition).
Definition: TypeInfo.h:37
const Atlas::Message::MapType & getAttributes() const
Gets the default attributes for this entity type.
Definition: TypeInfo.h:186
Definition: TypeBoundRedispatch.h:13
bool operator<(const TypeInfo &x) const
efficent ordering of type (uses type ids if possible)
Definition: TypeInfo.cpp:120
const Atlas::Message::Element * getAttribute(const std::string &attributeName) const
Gets the value of the named attribute.
Definition: TypeInfo.cpp:216
TypeInfo(const std::string &id, TypeService *)
forward constructor, when data is not available
Definition: TypeInfo.cpp:23
sigc::signal< void, const std::string &, const Atlas::Message::Element & > AttributeChanges
Emitted before an attribute changes.
Definition: TypeInfo.h:104
Definition: LogStream.h:45
sigc::signal< void > Bound
Emitted when the type is bound, i.e there is an unbroken graph of TypeInfo instances through every an...
Definition: TypeInfo.h:133
void onAttributeChanges(const std::string &attributeName, const Atlas::Message::Element &element)
Called before the AttributeChanges signal is emitted.
Definition: TypeInfo.cpp:248