1#ifndef ERIS_TYPE_INFO_H
2#define ERIS_TYPE_INFO_H
5#include <Atlas/Message/Element.h>
6#include <Atlas/Objects/Root.h>
8#include <sigc++/trackable.h>
9#include <sigc++/signal.h>
44 bool isA(
const std::string& typeName)
const;
76 const std::string&
getName()
const;
108 const Atlas::Message::Element*
getProperty(
const std::string& propertyName)
const;
114 sigc::signal<void, const std::string&, const Atlas::Message::Element&>
PropertyChanges;
121 void setProperty(
const std::string& propertyName,
const Atlas::Message::Element& element);
127 const Atlas::Message::ListType&
getEntities()
const;
163 void onPropertyChanges(
const std::string& propertyName,
const Atlas::Message::Element& element);
177 void extractDefaultProperties(
const Atlas::Objects::Root& atype);
182 std::set<TypeInfo*> m_children;
185 std::set<TypeInfo*> m_ancestors;
188 const std::string m_name;
189 std::string m_objType;
191 std::set<std::string> m_unresolvedChildren;
198 Atlas::Message::MapType m_properties;
203 Atlas::Message::ListType m_entities;
248 return m_typeService;
251inline const TypeService& TypeInfo::getTypeService()
const
253 return m_typeService;
The representation of an Atlas type (i.e a class or operation definition). This class supports effice...
bool operator<(const TypeInfo &x) const
efficent ordering of type (uses type ids if possible)
bool isA(TypeInfo *ti) const
Test whether this type inherits (directly or indirectly) from the specific class. If this type is not...
const std::string & getName() const
the unique type name (matches the Atlas type)
const Atlas::Message::MapType & getProperties() const
Gets the default properties for this entity type. Note that the map returned does not include inherit...
bool operator==(const TypeInfo &x) const
efficent comparisom of types (uses type ids if possible)
void processTypeData(const Atlas::Objects::Root &atype)
process the INFO data
void refresh()
Request update to the type info from the server.
const Atlas::Message::Element * getProperty(const std::string &propertyName) const
Gets the value of the named property. This method will search through both this instance and all of i...
void setProperty(const std::string &propertyName, const Atlas::Message::Element &element)
Sets a property.
sigc::signal< void, const std::string &, const Atlas::Message::Element & > PropertyChanges
Emitted before an property changes. The first parameter is the name of the property,...
const TypeInfo * getParent() const
Gets the currently resolved parent TypeInfo instances.
sigc::signal< void > Bound
Emitted when the type is bound, i.e there is an unbroken graph of TypeInfo instances through every an...
TypeInfo(std::string id, TypeService &)
forward constructor, when data is not available
bool isBound() const
Check the bound flag for this node; if false then recursivley check parents until an authorative is f...
const std::set< TypeInfo * > & getChildren() const
Gets the currently resolved child TypeInfo instances.
bool hasUnresolvedChildren() const
Test if there are child types of the type, which have not yet been retrieved from the server.
void onPropertyChanges(const std::string &propertyName, const Atlas::Message::Element &element)
Called before the PropertyChanges signal is emitted. This call is made before an property is changed....
TypeInfo(const Atlas::Objects::Root &atype, TypeService &)
full constructor, if an INFO has been received
void resolveChildren()
Retrive all child types from the server. This will log an error and do nothing if no unresolved child...
const Atlas::Message::ListType & getEntities() const
Gets a list of entities, if the type is an Archetype.
const std::string & getObjType() const
the object type of this Type or Archetype