TypeInfo.h

00001 #ifndef ERIS_TYPE_INFO_H
00002 #define ERIS_TYPE_INFO_H
00003 
00004 #include <Eris/Types.h>
00005 #include <Eris/TypeService.h>
00006 
00007 #include <sigc++/trackable.h>
00008 
00009 #include <set>
00010 
00011 namespace Eris {        
00012 
00028 class TypeInfo : virtual public sigc::trackable
00029 {
00030 public: 
00033     bool isA(TypeInfoPtr ti);
00034 
00037     bool isBound() const
00038     { return m_bound; }
00039 
00044     bool hasUnresolvedChildren() const;
00045     
00050     void resolveChildren();
00051     
00052 // operators
00054     bool operator==(const TypeInfo &x) const;
00055 
00057     bool operator<(const TypeInfo &x) const;
00058 
00059 // accessors
00061     const std::string& getName() const
00062     {
00063         return m_name;
00064     }
00065     
00066     const TypeInfoSet & getChildren() const
00067     {
00068         return m_children;
00069     }
00070 
00071     const TypeInfoSet & getParents() const 
00072     {
00073          return m_parents;
00074     }
00075 
00076 protected:
00077     friend class TypeService;
00078     friend class TypeBoundRedispatch;
00079     
00081     TypeInfo(const std::string &id, TypeService*);
00082 
00084     TypeInfo(const Atlas::Objects::Root &atype, TypeService*);
00085 
00086     void validateBind();
00087 
00089     void processTypeData(const Atlas::Objects::Root& atype);
00090 
00093     SigC::Signal1<void, TypeInfo*> Bound;
00094     
00095 private:
00096     void addParent(TypeInfoPtr tp);
00097     void addChild(TypeInfoPtr tp);
00098 
00100     void addAncestor(TypeInfoPtr tp);
00101         
00103     TypeInfoSet m_parents;
00105     TypeInfoSet m_children;
00106 
00108     TypeInfoSet m_ancestors;
00109 
00110     bool m_bound;               
00111     const std::string m_name;   
00112     int m_atlasClassNo;         
00113     
00114     StringSet m_unresolvedChildren;
00115     
00120     unsigned int m_moveCount;
00121     
00122     TypeService* m_typeService;
00123 };
00124 
00125 } // of Eris namespace
00126 
00127 #endif

Generated on Mon Jan 29 21:53:03 2007 for Eris by  doxygen 1.5.1