Public Types | Public Member Functions | List of all members
openfluid::fluidx::AdvancedDomainDescriptor Class Reference

#include <fluidx/AdvancedDomainDescriptor.hpp>

Public Types

typedef std::map< std::string, std::map< int, AdvancedUnitDescriptor > > UnitsByIdByClass_t
 

Public Member Functions

 AdvancedDomainDescriptor (openfluid::fluidx::SpatialDomainDescriptor &DomainDesc)
 
 ~AdvancedDomainDescriptor ()
 
bool isSpatialUnitExist (const std::string &ClassName, int ID) const
 
const std::map< std::string, std::map< int, AdvancedUnitDescriptor > > & spatialUnitsByIdByClass () const
 
const AdvancedUnitDescriptorspatialUnit (const std::string &ClassName, int ID) const
 
const openfluid::fluidx::SpatialUnitDescriptorspatialUnitDescriptor (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::SpatialUnitDescriptor *UnitDesc)
 
void deleteUnit (const std::string &ClassName, int ID)
 
std::string & attribute (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::UnitsClass_t &UnitsClass, const openfluid::core::UnitID_t &UnitID, const openfluid::core::Event &Event)
 
void deleteEvent (const openfluid::core::UnitsClass_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::EventDescriptoreventDescriptor (const openfluid::fluidx::EventID_t &ID)
 
const std::list< openfluid::core::UnitClassID_t > & toSpatialUnits (const openfluid::core::UnitClassID_t Unit) const
 
const std::list< openfluid::core::UnitClassID_t > & parentSpatialUnits (const openfluid::core::UnitClassID_t Unit) const
 
std::list< openfluid::core::UnitClassID_tgetFromSpatialUnits (const openfluid::core::UnitClassID_t Unit) const
 
std::list< openfluid::core::UnitClassID_tgetChildSpatialUnits (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 ()
 

Member Typedef Documentation

Constructor & Destructor Documentation

openfluid::fluidx::AdvancedDomainDescriptor::AdvancedDomainDescriptor ( openfluid::fluidx::SpatialDomainDescriptor DomainDesc)
openfluid::fluidx::AdvancedDomainDescriptor::~AdvancedDomainDescriptor ( )

Member Function Documentation

void openfluid::fluidx::AdvancedDomainDescriptor::addAttribute ( const std::string &  ClassName,
const std::string &  AttrName,
const std::string &  DefaultValue 
)
Exceptions
openfluid::base::FrameworkExceptionif ClassName doesn't exist or if AttrName already exists for class ClassName
Parameters
ClassName
AttrName
DefaultValue
void openfluid::fluidx::AdvancedDomainDescriptor::addEvent ( const openfluid::core::UnitsClass_t UnitsClass,
const openfluid::core::UnitID_t UnitID,
const openfluid::core::Event Event 
)

Adds an event

Parameters
[in]UnitsClassThe units class of the event
[in]UnitIDThe unit ID of the event
[in]EventThe 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

Exceptions
openfluid::base::FrameworkExceptionif 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

Exceptions
openfluid::base::FrameworkExceptionif ParentUnit or ChildUnit doesn't exist
void openfluid::fluidx::AdvancedDomainDescriptor::addUnit ( openfluid::fluidx::SpatialUnitDescriptor UnitDesc)

Add this UnitDesc ID to the descriptor for all attributes of this UnitDesc class, with a default value of "-"

Warning
Invalidate UnitDesc
Exceptions
openfluid::base::FrameworkExceptionif Unit already exists or if Unit has a relation with a non-existent Unit
Parameters
UnitDesc
std::string& openfluid::fluidx::AdvancedDomainDescriptor::attribute ( const std::string &  ClassName,
int  ID,
const std::string &  AttrName 
)
Exceptions
openfluid::base::FrameworkExceptionif Unit or DataName doesn't exist
Parameters
ClassName
ID
AttrName
Returns
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.

Exceptions
openfluid::base::FrameworkExceptionif Unit doesn't exist
void openfluid::fluidx::AdvancedDomainDescriptor::deleteAttribute ( const std::string &  ClassName,
const std::string &  AttrName 
)
Exceptions
openfluid::base::FrameworkExceptionif ClassName doesn't exist or if AttrName doesn't exist for class ClassName
Parameters
ClassName
AttrName
void openfluid::fluidx::AdvancedDomainDescriptor::deleteEvent ( const openfluid::core::UnitsClass_t UnitsClass,
const openfluid::core::UnitID_t UnitID,
const openfluid::fluidx::EventID_t EventID 
)

Deletes an event

Parameters
[in]UnitsClassThe units class of the event
[in]UnitIDThe unit ID of the event
[in]EventIDThe ID of the event to delete
void openfluid::fluidx::AdvancedDomainDescriptor::deleteUnit ( const std::string &  ClassName,
int  ID 
)

Does nothing if Unit doesn't exist

Parameters
ClassName
ID
openfluid::fluidx::EventDescriptor* openfluid::fluidx::AdvancedDomainDescriptor::eventDescriptor ( const openfluid::fluidx::EventID_t ID)

Returns a pointer to the event descriptor corresponding to the event ID

Parameters
[in]IDThe ID of the event to delete
std::set<std::string> openfluid::fluidx::AdvancedDomainDescriptor::getAttributesNames ( const std::string &  ClassName) const
Parameters
ClassName
Returns
An empty set if ClassName doesn't exist or has no attribute. Never throws.
std::list<openfluid::core::UnitClassID_t> openfluid::fluidx::AdvancedDomainDescriptor::getChildSpatialUnits ( const openfluid::core::UnitClassID_t  Unit) const
std::set<std::string> openfluid::fluidx::AdvancedDomainDescriptor::getClassNames ( ) const
Returns
May return an empty set. Never throws.
std::list<openfluid::core::UnitClassID_t> openfluid::fluidx::AdvancedDomainDescriptor::getFromSpatialUnits ( const openfluid::core::UnitClassID_t  Unit) const
std::set<int> openfluid::fluidx::AdvancedDomainDescriptor::getIDsOfClass ( const std::string &  ClassName) const
Parameters
ClassName
Returns
An empty set if ClassName doesn't exist. Never throws.
unsigned int openfluid::fluidx::AdvancedDomainDescriptor::getUnitsCount ( ) const
bool openfluid::fluidx::AdvancedDomainDescriptor::isClassNameExists ( const std::string &  ClassName) const
bool openfluid::fluidx::AdvancedDomainDescriptor::isSpatialUnitExist ( 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

Parameters
[in]EventIDThe ID of the event to modify
[in]EventThe new content of the event
const std::list<openfluid::core::UnitClassID_t>& openfluid::fluidx::AdvancedDomainDescriptor::parentSpatialUnits ( const openfluid::core::UnitClassID_t  Unit) const
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.

Exceptions
openfluid::base::FrameworkExceptionif 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.

Exceptions
openfluid::base::FrameworkExceptionif 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

Exceptions
openfluid::base::FrameworkExceptionif ClassName doesn't exist or if OldDataName doesn't exist for the class ClassName
Parameters
ClassName
OldAttrName
NewAttrName
const AdvancedUnitDescriptor& openfluid::fluidx::AdvancedDomainDescriptor::spatialUnit ( const std::string &  ClassName,
int  ID 
) const
Exceptions
openfluid::base::FrameworkExceptionif Unit doesn't exist
Parameters
ClassName
ID
Returns
const openfluid::fluidx::SpatialUnitDescriptor& openfluid::fluidx::AdvancedDomainDescriptor::spatialUnitDescriptor ( const std::string &  ClassName,
int  ID 
) const
Exceptions
openfluid::base::FrameworkExceptionif Unit doesn't exist
Parameters
ClassName
ID
Returns
const std::map<std::string, std::map<int, AdvancedUnitDescriptor> >& openfluid::fluidx::AdvancedDomainDescriptor::spatialUnitsByIdByClass ( ) const
Returns
May return an empty map. Never throws.
const std::list<openfluid::core::UnitClassID_t>& openfluid::fluidx::AdvancedDomainDescriptor::toSpatialUnits ( const openfluid::core::UnitClassID_t  Unit) const

The documentation for this class was generated from the following file: