#include <fluidx/AdvancedDomainDescriptor.hpp>
Public Types | |
typedef std::map< std::string, std::map< int, AdvancedUnitDescriptor > > | UnitsByIdByClass_t |
Public Member Functions | |
AdvancedDomainDescriptor (openfluid::fluidx::DomainDescriptor &DomainDesc) | |
~AdvancedDomainDescriptor () | |
bool | isUnitExist (const std::string &ClassName, int ID) const |
const std::map< std::string, std::map< int, AdvancedUnitDescriptor > > & | getUnitsByIdByClass () const |
const AdvancedUnitDescriptor & | getUnit (const std::string &ClassName, int ID) const |
const openfluid::fluidx::UnitDescriptor & | getUnitDescriptor (const std::string &ClassName, int ID) const |
std::set< int > | getIDsOfClass (const std::string &ClassName) const |
bool | isClassNameExists (const std::string &ClassName) const |
std::set< std::string > | getClassNames () const |
unsigned int | getUnitsCount () const |
void | addUnit (openfluid::fluidx::UnitDescriptor *UnitDesc) |
void | deleteUnit (const std::string &ClassName, int ID) |
std::string & | getAttribute (const std::string &ClassName, int ID, const std::string &AttrName) |
std::set< std::string > | getAttributesNames (const std::string &ClassName) const |
void | addAttribute (const std::string &ClassName, const std::string &AttrName, const std::string &DefaultValue) |
void | deleteAttribute (const std::string &ClassName, const std::string &AttrName) |
void | renameAttribute (const std::string &ClassName, const std::string &OldAttrName, const std::string &NewAttrName) |
void | addEvent (const openfluid::core::UnitClass_t &UnitsClass, const openfluid::core::UnitID_t &UnitID, const openfluid::core::Event &Event) |
void | deleteEvent (const openfluid::core::UnitClass_t &UnitsClass, const openfluid::core::UnitID_t &UnitID, const openfluid::fluidx::EventID_t &EventID) |
void | modifyEvent (const openfluid::fluidx::EventID_t &EventID, const openfluid::core::Event &Event) |
openfluid::fluidx::EventDescriptor * | getEventDescriptor (const openfluid::fluidx::EventID_t &ID) |
const std::list < openfluid::core::UnitClassID_t > & | getUnitsToOf (const openfluid::core::UnitClassID_t Unit) const |
const std::list < openfluid::core::UnitClassID_t > & | getUnitsParentsOf (const openfluid::core::UnitClassID_t Unit) const |
std::list < openfluid::core::UnitClassID_t > | getUnitsFromOf (const openfluid::core::UnitClassID_t Unit) const |
std::list < openfluid::core::UnitClassID_t > | getUnitsChildrenOf (const openfluid::core::UnitClassID_t Unit) const |
void | addFromToRelation (const openfluid::core::UnitClassID_t FromUnit, const openfluid::core::UnitClassID_t ToUnit) |
Add ToUnit to the list of "Tos" of FromUnit. More... | |
void | removeFromToRelation (const openfluid::core::UnitClassID_t FromUnit, const openfluid::core::UnitClassID_t ToUnit) |
Remove ToUnit from the list of "Tos" of FromUnit. More... | |
void | addParentChildRelation (const openfluid::core::UnitClassID_t ParentUnit, const openfluid::core::UnitClassID_t ChildUnit) |
Add ChildUnit to the list of "Children" of ParentUnit. More... | |
void | removeParentChildRelation (const openfluid::core::UnitClassID_t ParentUnit, const openfluid::core::UnitClassID_t ChildUnit) |
Remove ChildUnit from the list of "Children" of ParentUnit. More... | |
void | clearRelations (const openfluid::core::UnitClassID_t Unit) |
Clear the list of "Tos" and "Parents" of Unit, and remove Unit from the list of "Tos" and "Parents" of all other Units of the Domain. More... | |
void | clearDomain () |
typedef std::map<std::string, std::map<int, AdvancedUnitDescriptor> > openfluid::fluidx::AdvancedDomainDescriptor::UnitsByIdByClass_t |
openfluid::fluidx::AdvancedDomainDescriptor::AdvancedDomainDescriptor | ( | openfluid::fluidx::DomainDescriptor & | DomainDesc | ) |
openfluid::fluidx::AdvancedDomainDescriptor::~AdvancedDomainDescriptor | ( | ) |
void openfluid::fluidx::AdvancedDomainDescriptor::addAttribute | ( | const std::string & | ClassName, |
const std::string & | AttrName, | ||
const std::string & | DefaultValue | ||
) |
openfluid::base::OFException | if ClassName doesn't exist or if AttrName already exists for class ClassName |
ClassName | |
AttrName | |
DefaultValue |
void openfluid::fluidx::AdvancedDomainDescriptor::addEvent | ( | const openfluid::core::UnitClass_t & | UnitsClass, |
const openfluid::core::UnitID_t & | UnitID, | ||
const openfluid::core::Event & | Event | ||
) |
Adds an event
[in] | UnitsClass | The units class of the event |
[in] | UnitID | The unit ID of the event |
[in] | Event | The event definition |
void openfluid::fluidx::AdvancedDomainDescriptor::addFromToRelation | ( | const openfluid::core::UnitClassID_t | FromUnit, |
const openfluid::core::UnitClassID_t | ToUnit | ||
) |
Add ToUnit to the list of "Tos" of FromUnit.
Does nothing if the relation already exists
openfluid::base::OFException | if FromUnit or ToUnit doesn't exist |
void openfluid::fluidx::AdvancedDomainDescriptor::addParentChildRelation | ( | const openfluid::core::UnitClassID_t | ParentUnit, |
const openfluid::core::UnitClassID_t | ChildUnit | ||
) |
Add ChildUnit to the list of "Children" of ParentUnit.
Does nothing if the relation already exists
openfluid::base::OFException | if ParentUnit or ChildUnit doesn't exist |
void openfluid::fluidx::AdvancedDomainDescriptor::addUnit | ( | openfluid::fluidx::UnitDescriptor * | UnitDesc | ) |
Add this UnitDesc ID to the descriptor for all attributes of this UnitDesc class, with a default value of "-"
openfluid::base::OFException | if Unit already exists or if Unit has a relation with a non-existent Unit |
UnitDesc |
void openfluid::fluidx::AdvancedDomainDescriptor::clearDomain | ( | ) |
void openfluid::fluidx::AdvancedDomainDescriptor::clearRelations | ( | const openfluid::core::UnitClassID_t | Unit | ) |
Clear the list of "Tos" and "Parents" of Unit, and remove Unit from the list of "Tos" and "Parents" of all other Units of the Domain.
openfluid::base::OFException | if Unit doesn't exist |
void openfluid::fluidx::AdvancedDomainDescriptor::deleteAttribute | ( | const std::string & | ClassName, |
const std::string & | AttrName | ||
) |
openfluid::base::OFException | if ClassName doesn't exist or if AttrName doesn't exist for class ClassName |
ClassName | |
AttrName |
void openfluid::fluidx::AdvancedDomainDescriptor::deleteEvent | ( | const openfluid::core::UnitClass_t & | UnitsClass, |
const openfluid::core::UnitID_t & | UnitID, | ||
const openfluid::fluidx::EventID_t & | EventID | ||
) |
Deletes an event
[in] | UnitsClass | The units class of the event |
[in] | UnitID | The unit ID of the event |
[in] | EventID | The ID of the event to delete |
void openfluid::fluidx::AdvancedDomainDescriptor::deleteUnit | ( | const std::string & | ClassName, |
int | ID | ||
) |
Does nothing if Unit doesn't exist
ClassName | |
ID |
std::string& openfluid::fluidx::AdvancedDomainDescriptor::getAttribute | ( | const std::string & | ClassName, |
int | ID, | ||
const std::string & | AttrName | ||
) |
openfluid::base::OFException | if Unit or DataName doesn't exist |
ClassName | |
ID | |
AttrName |
std::set<std::string> openfluid::fluidx::AdvancedDomainDescriptor::getAttributesNames | ( | const std::string & | ClassName | ) | const |
ClassName |
std::set<std::string> openfluid::fluidx::AdvancedDomainDescriptor::getClassNames | ( | ) | const |
openfluid::fluidx::EventDescriptor* openfluid::fluidx::AdvancedDomainDescriptor::getEventDescriptor | ( | const openfluid::fluidx::EventID_t & | ID | ) |
Returns a pointer to the event descriptor corresponding to the event ID
[in] | ID | The ID of the event to delete |
std::set<int> openfluid::fluidx::AdvancedDomainDescriptor::getIDsOfClass | ( | const std::string & | ClassName | ) | const |
ClassName |
const AdvancedUnitDescriptor& openfluid::fluidx::AdvancedDomainDescriptor::getUnit | ( | const std::string & | ClassName, |
int | ID | ||
) | const |
openfluid::base::OFException | if Unit doesn't exist |
ClassName | |
ID |
const openfluid::fluidx::UnitDescriptor& openfluid::fluidx::AdvancedDomainDescriptor::getUnitDescriptor | ( | const std::string & | ClassName, |
int | ID | ||
) | const |
openfluid::base::OFException | if Unit doesn't exist |
ClassName | |
ID |
const std::map<std::string, std::map<int, AdvancedUnitDescriptor> >& openfluid::fluidx::AdvancedDomainDescriptor::getUnitsByIdByClass | ( | ) | const |
std::list<openfluid::core::UnitClassID_t> openfluid::fluidx::AdvancedDomainDescriptor::getUnitsChildrenOf | ( | const openfluid::core::UnitClassID_t | Unit | ) | const |
unsigned int openfluid::fluidx::AdvancedDomainDescriptor::getUnitsCount | ( | ) | const |
std::list<openfluid::core::UnitClassID_t> openfluid::fluidx::AdvancedDomainDescriptor::getUnitsFromOf | ( | const openfluid::core::UnitClassID_t | Unit | ) | const |
const std::list<openfluid::core::UnitClassID_t>& openfluid::fluidx::AdvancedDomainDescriptor::getUnitsParentsOf | ( | const openfluid::core::UnitClassID_t | Unit | ) | const |
const std::list<openfluid::core::UnitClassID_t>& openfluid::fluidx::AdvancedDomainDescriptor::getUnitsToOf | ( | const openfluid::core::UnitClassID_t | Unit | ) | const |
bool openfluid::fluidx::AdvancedDomainDescriptor::isClassNameExists | ( | const std::string & | ClassName | ) | const |
bool openfluid::fluidx::AdvancedDomainDescriptor::isUnitExist | ( | const std::string & | ClassName, |
int | ID | ||
) | const |
void openfluid::fluidx::AdvancedDomainDescriptor::modifyEvent | ( | const openfluid::fluidx::EventID_t & | EventID, |
const openfluid::core::Event & | Event | ||
) |
Modify an event
[in] | EventID | The ID of the event to modify |
[in] | Event | The new content of the event |
void openfluid::fluidx::AdvancedDomainDescriptor::removeFromToRelation | ( | const openfluid::core::UnitClassID_t | FromUnit, |
const openfluid::core::UnitClassID_t | ToUnit | ||
) |
Remove ToUnit from the list of "Tos" of FromUnit.
openfluid::base::OFException | if FromUnit or ToUnit doesn't exist or if the relation doesn't exists |
void openfluid::fluidx::AdvancedDomainDescriptor::removeParentChildRelation | ( | const openfluid::core::UnitClassID_t | ParentUnit, |
const openfluid::core::UnitClassID_t | ChildUnit | ||
) |
Remove ChildUnit from the list of "Children" of ParentUnit.
openfluid::base::OFException | if ParentUnit or ChildUnit doesn't exist or if the relation doesn't exists |
void openfluid::fluidx::AdvancedDomainDescriptor::renameAttribute | ( | const std::string & | ClassName, |
const std::string & | OldAttrName, | ||
const std::string & | NewAttrName | ||
) |
Does nothing if NewDataName is the same as OldDataName
openfluid::base::OFException | if ClassName doesn't exist or if OldDataName doesn't exist for the class ClassName |
ClassName | |
OldAttrName | |
NewAttrName |