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
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #ifndef __COREREPOSITORY_HPP__
00050 #define __COREREPOSITORY_HPP__
00051
00052
00053 #include <openfluid/dllexport.hpp>
00054 #include <openfluid/core/Unit.hpp>
00055
00056
00057 namespace openfluid { namespace core {
00058
00059 class Unit;
00060 class UnitsCollection;
00061
00062
00063 class DLLEXPORT CoreRepository
00064 {
00065 private:
00066
00067 UnitsListByClassMap_t m_PcsOrderedUnitsByClass;
00068
00069 UnitsPtrList_t m_PcsOrderedUnitsGlobal;
00070
00071 static bool removeUnitFromList(UnitsPtrList_t* UnitsList,
00072 const UnitID_t& UnitID);
00073
00074 public:
00075
00076 CoreRepository();
00077
00078 bool addUnit(const Unit aUnit);
00079
00080 bool deleteUnit(Unit* aUnit);
00081
00082 bool removeFromToConnection(Unit* FromUnit,
00083 Unit* ToUnit);
00084
00085 bool removeChildParentConnection(Unit* ChildUnit,
00086 Unit* ParentUnit);
00087
00088 bool sortUnitsByProcessOrder();
00089
00090 Unit* getUnit(UnitClass_t UnitClass, UnitID_t UnitID);
00091
00092 UnitsCollection* getUnits(UnitClass_t UnitClass);
00093
00094 const UnitsCollection* getUnits(UnitClass_t UnitClass) const;
00095
00096 inline const UnitsListByClassMap_t* getUnitsByClass() const { return &m_PcsOrderedUnitsByClass; };
00097
00098 inline const UnitsPtrList_t* getUnitsGlobally() const { return &m_PcsOrderedUnitsGlobal; };
00099
00100 inline UnitsPtrList_t* getUnitsGlobally() { return &m_PcsOrderedUnitsGlobal; };
00101
00102 bool isUnitsClassExist(UnitClass_t UnitClass) const;
00103
00104 void streamContents(std::ostream& OStream);
00105
00106 void clearAllVariables();
00107
00108 void clearAllInputdata();
00109
00110 void clearAllEvents();
00111
00112 void clearAllData();
00113
00114 void clearEvents(const InstantiationInfo::Type& InstType);
00115
00116 void clearUnits(const InstantiationInfo::Type& InstType);
00117
00118 };
00119
00120
00121 } }
00122
00123
00124 #endif
00125