Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __COREREPOSITORY_HPP__
00035 #define __COREREPOSITORY_HPP__
00036
00037
00038 #include <openfluid/dllexport.hpp>
00039 #include <openfluid/core/Unit.hpp>
00040
00041
00042 namespace openfluid { namespace core {
00043
00044 class Unit;
00045 class UnitsCollection;
00046
00047
00048 class DLLEXPORT CoreRepository
00049 {
00050 private:
00051
00052 UnitsListByClassMap_t m_PcsOrderedUnitsByClass;
00053
00054 UnitsPtrList_t m_PcsOrderedUnitsGlobal;
00055
00056 static bool removeUnitFromList(UnitsPtrList_t* UnitsList,
00057 const UnitID_t& UnitID);
00058
00059 public:
00060
00061 CoreRepository();
00062
00063 bool addUnit(const Unit aUnit);
00064
00065 bool deleteUnit(Unit* aUnit);
00066
00067 bool removeFromToConnection(Unit* FromUnit,
00068 Unit* ToUnit);
00069
00070 bool removeChildParentConnection(Unit* ChildUnit,
00071 Unit* ParentUnit);
00072
00073 bool sortUnitsByProcessOrder();
00074
00075 Unit* getUnit(UnitClass_t UnitClass, UnitID_t UnitID);
00076
00077 UnitsCollection* getUnits(UnitClass_t UnitClass);
00078
00079 const UnitsCollection* getUnits(UnitClass_t UnitClass) const;
00080
00081 inline const UnitsListByClassMap_t* getUnitsByClass() const { return &m_PcsOrderedUnitsByClass; };
00082
00083 inline const UnitsPtrList_t* getUnitsGlobally() const { return &m_PcsOrderedUnitsGlobal; };
00084
00085 inline UnitsPtrList_t* getUnitsGlobally() { return &m_PcsOrderedUnitsGlobal; };
00086
00087 bool isUnitsClassExist(UnitClass_t UnitClass) const;
00088
00089 void streamContents(std::ostream& OStream);
00090
00091 void clearAllVariables();
00092
00093 void clearAllAttributes();
00094
00095 void clearAllEvents();
00096
00097 void clearAllData();
00098
00099 void clearUnits();
00100
00101 };
00102
00103
00104 } }
00105
00106
00107 #endif
00108