00001 #ifndef ASPECTREP_H
00002 #define ASPECTREP_H
00003
00004 #include "Any.h"
00005 #include "PartRep.h"
00006
00007 #include "map"
00008 #include "vector"
00009 #include "FCO.h"
00010
00011 class PartRep;
00012 class RoleRep;
00013 class AspectRep;
00014 class ModelRep;
00015
00016 class PartCompare
00017 {
00018 public:
00019 bool operator()( const PartRep& peer1, const PartRep& peer2) const;
00020 };
00021
00022 class AspectCompare
00023 {
00024 public:
00025 bool operator()( const AspectRep* peer1, const AspectRep* peer2) const;
00026 };
00027
00028 class AspNamePriorityComp
00029 {
00030 public:
00031 typedef std::pair< std::string, int> Type;
00032 bool operator() ( const Type& p1, const Type& p2) const;
00033 };
00034
00035 class AspectRep : public Any
00036 {
00037 public:
00038 typedef std::vector< PartRep > PartRepSeries;
00039 typedef PartRepSeries::iterator PartRepSeries_Iterator;
00040 typedef PartRepSeries::const_iterator PartRepSeries_ConstIterator;
00041 typedef ModelRep* Key;
00042 typedef std::map< Key, PartRepSeries> ModelPartsMap;
00043 typedef ModelPartsMap::iterator ModelPartsMap_Iterator;
00044 public:
00045 AspectRep( BON::FCO& ptr, BON::FCO& resp_ptr);
00046 ~AspectRep();
00047 std::string doDump();
00048 Any::KIND_TYPE getMyKind() const;
00049 std::string getName() const;
00050 std::string getDispName() const;
00051 bool getReadOnly() const;
00052
00053 std::string getMyPrefix() const;
00054 BON::RegistryNode getMyRegistry() const;
00055 static std::string getMyPrefix( BON::FCO& fco, BON::Folder& f);
00056 static BON::RegistryNode getMyRegistry( BON::FCO& fco, BON::Folder& f);
00057
00058 void addPart2Map( ModelRep * mptr, const PartRep & part);
00059
00060 void addFCO( FCO* fco);
00061 void addRRole( RoleRep & role);
00062 bool findFinalFCO( const FCO * fco) const;
00063 bool findFinalRole( const RoleRep&) const;
00064
00065 void extendAspectWithDescendants();
00066 void sortPartMap();
00067
00068 const PartRepSeries& getPartSeries( ModelRep* mod_ptr);
00069 bool lessThan( const AspectRep& rep) const;
00070 void getXY( unsigned int * x, unsigned int *y) const;
00071
00072 void setPriority( int pr);
00073 int getPriority() const;
00074
00075 bool isDummy() const;
00076
00077 static const std::string m_aspectRegistryRoot;
00078 static const std::string m_aspectMetaRefsRoot;
00079 static const std::string m_aspectNamesRoot;
00080 protected:
00081
00082
00083
00084 int m_priority;
00085
00090 std::vector<FCO*> m_fcoInitialList;
00091 std::vector<RoleRep> m_roleInitialList;
00092 std::vector<FCO*> m_fcoFinalList;
00093 std::vector<RoleRep> m_roleFinalList;
00094
00095 ModelPartsMap m_partsMap;
00096
00101 BON::FCO m_respPointer;
00102
00103 private:
00104 AspectRep(const AspectRep&);
00105 const AspectRep& operator=(const AspectRep&);
00106 };
00107 #endif //ASPECTREP_H