Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Eris::TypeInfo Class Reference

The representation of an Atlas type (i.e a class or operation definition). More...

#include <TypeInfo.h>

List of all members.

Public Member Functions

bool isA (TypeInfoPtr ti)
 Test whether this type inherits (directly or indirectly) from the specific class.
bool safeIsA (TypeInfoPtr ti)
 This version of isA will not throw, but may return false-negatives if this type is unbound.
bool isBound ()
 Check the bound flag for this node; if false then recursivley check parents until an authorative is found.
bool operator== (const TypeInfo &x) const
 efficent comparisom of types (uses type ids if possible)
bool operator< (const TypeInfo &x) const
 efficent ordering of type (uses type ids if possible)
const std::string & getName () const
 the unique type name (matches the Atlas type)
const TypeInfoSet & getChildren () const
int getTypeId () const
 the integer type ID (may not be valid, but will be starting with Atlas 0.5x)
SigC::Signal0< void > & getBoundSignal ()
 obtain a reference to a signal that will be emitted when the type is bound.
StringSet getParentsAsSet ()
 Return the names of each direct parent class, as a set.

Protected Member Functions

 TypeInfo (const std::string &id, TypeService *)
 forward constructor, when data is not available
 TypeInfo (const Atlas::Objects::Root &atype, TypeService *)
 full constructor, if an INFO has been received
void addParent (TypeInfoPtr tp)
void addChild (TypeInfoPtr tp)
void addAncestor (TypeInfoPtr tp)
 Recursive add to this node and every descendant the specified ancestor.
void processTypeData (const Atlas::Objects::Root &atype)
 process the INFO data
void validateBind ()
void setupDepends ()
 Compute the dependancies of this type.

Protected Attributes

TypeInfoSet _parents
 The TypeInfo nodes for types we inherit from directly.
TypeInfoSet _children
 TypeInfo nodes that inherit from us directly.
TypeInfoSet _ancestors
 Every TypeInfo node we inherit from at all (must contain the root node, obviously).
bool _bound
 cache the 'bound-ness' of the node, see the isBound() implementation
const std::string _name
 the Atlas unique typename
int _typeid
 Atlas 0.5.x type ID (or -1).
SigC::Signal0< void > Bound
 Emitted when the type is bound, i.e there is an unbroken graph of TypeInfo instances through every ancestor to the root object.
TypeService * _engine

Friends

class TypeService


Detailed Description

The representation of an Atlas type (i.e a class or operation definition).

This class supports efficent inheritance queries, and traversal of the type hierarchy. Atlas types have a unique ID, and types can be retrieved using this value. Where an Atlas::Objects instance, or an Atlas::Message::Element representing an Atlas object is being examine, it is much more efficent to use the 'getSafe' methods rather than extracting PARENTS[0] and calling findSafe. This is because the getSafe methods may take advantage of integer type codes stored in the object, which avoids a map lookup to locate the type.

Note that the core Atlas::Objects heirarchy (as defined in the protocols/atlas/spec section of CVS) is loaded from the 'atlas.xml' file at startup, and that other types are queried from the server. In general, Eris will automatically delay processing operations and entities until the necessary type data has become available, without intervention by the client. However, certain routines may throw the 'OperationBlocked' exception, which must be forward to the Connection instance for handling.


Member Function Documentation

Signal & Eris::TypeInfo::getBoundSignal  ) 
 

obtain a reference to a signal that will be emitted when the type is bound.

If the type is already bound, InvalidOperation will be thrown

bool Eris::TypeInfo::isA TypeInfoPtr  ti  ) 
 

Test whether this type inherits (directly or indirectly) from the specific class.

If this type is not bound, this will throw OperationBlocked with an appropriate wait.

void Eris::TypeInfo::setupDepends  )  [protected]
 

Compute the dependancies of this type.

Basically we add ourselves to the dependant set of every currenly unbound parent. We will have validateBind() called that many times, and on the final call (whichever parent is bound last), we ouirselves will become bound.


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 07:43:30 2004 for Eris by  doxygen 1.3.9.1