FEDEM Solver  R8.0
Source code of the dynamics solver
Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
FFrItemGroup Class Reference

Class representng an item group in a result file hierarchy. More...

#include <FFrItemGroup.H>

Inheritance diagram for FFrItemGroup:
Inheritance graph
[legend]
Collaboration diagram for FFrItemGroup:
Collaboration graph
[legend]

Classes

struct  Less
 Functor for comparison of two item group definitions. More...
 

Public Member Functions

 FFrItemGroup (bool inlined=false)
 Default constructor. More...
 
 FFrItemGroup (const FFrItemGroup &obj)
 Copy constructor. More...
 
virtual ~FFrItemGroup ()
 Empty destructor. More...
 
FFrItemGroup & operator= (const FFrItemGroup &)=delete
 Deleted Assignment operator. More...
 
int fillObject (const std::vector< std::string > &tokens, FFrCreatorData &cd)
 Parses the item group definition from a list of strings. More...
 
virtual int traverse (FFrResultContainer *resultContainer, FFrEntryBase *owner, FFrEntryBase *&objToBeModified, int binPos)
 Traverses to build owner hierarchy and calculate binary sizes. More...
 
virtual void setGlobal ()
 Defines this as a global scope entry. More...
 
virtual bool equal (const FFrEntryBase *obj) const
 Returns true if *this and *obj are considered equal. More...
 
virtual bool comp (const FFrEntryBase *obj) const
 Returns true if *this equals another specified entry. More...
 
virtual bool less (const FFrEntryBase *obj) const
 Returns true if *this is ordered before *obj. More...
 
virtual int getUserID () const
 Returns the user ID for this entry. More...
 
virtual bool hasUserID () const
 Returns whether this entry has a user ID or not. More...
 
virtual const std::string & getType () const
 Returns either the given name or the ID of the item group. More...
 
virtual const std::string & getDescription () const
 Returns the type name of the item group. More...
 
virtual bool hasDescription () const
 Returns true since all item groups have a type name. More...
 
virtual bool isIG () const
 Returns true since this entry is an Item Group. More...
 
- Public Member Functions inherited from FFrFieldEntryBase
virtual ~FFrFieldEntryBase ()
 The destructor deletes the heap-allocated data fields. More...
 
void sortDataFieldsByUserID ()
 Sorts the data fields based on their user ID. More...
 
bool resolve (const std::string &references, FFrCreatorData &cd, bool inlined=true)
 Resolves a string of references into datafield entries. More...
 
virtual const FFrEntries * getDataFields () const
 Returns a pointer to the data fields of this entry. More...
 
virtual bool hasDataFields () const
 Returns whether this entry has data fields or not. More...
 
virtual bool isEmpty () const
 Returns true if this entry and all below it are empty. More...
 
virtual bool isVariableFloat () const
 Returns true if the first variable referred is a float. More...
 
virtual void removeContainers (const std::set< FFrResultContainer * > &cont)
 Removes data associated with given containers for this entry. More...
 
virtual bool merge (FFrEntryBase *objToMergeFrom)
 Merges another entry into *this. More...
 
virtual void printPosition (std::ostream &os) const
 Prints out the positioning data of this field. More...
 
- Public Member Functions inherited from FFrEntryBase
virtual ~FFrEntryBase ()
 Empty destructor. More...
 
FFaResultDescription getEntryDescription () const
 Returns the full path of this result entry. More...
 
virtual int getBaseID () const
 Returns the base ID of the object if this entry is an Object Group. More...
 
virtual bool hasBaseID () const
 Returns whether this entry has a base ID or not. More...
 
template<class T >
int readPositionedTimestepData (const T *values, int nvals) const
 Reads variable reference data from the hierarhcy under this entry. More...
 
FFrEntryBase * getOwner () const
 Returns the owner of this entry in the hierarchy. More...
 
void setOwner (FFrEntryBase *owner)
 Defines the owner of this entry in the hierarchy. More...
 
bool isGlobal () const
 Check if this entry is in global scope or not. More...
 
virtual bool isOG () const
 Returns whether this entry is an Object Group or not. More...
 
virtual bool isSOG () const
 Returns whether this entry is a Super Object Group or not. More...
 
virtual bool isVarRef () const
 Returns whether this entry is a Variable Reference or not. More...
 
template<class T >
bool readVar (T &value)
 Reads a variable from the results container for current time step. More...
 

Static Public Member Functions

static FFrStatus create (FILE *varStream, FFrCreatorData &cd, bool dataBlocks)
 Static method for parsing an item group definition from file. More...
 

Private Attributes

std::set< std::string >::const_iterator myNameIt
 Iterator pointing to the item group name. More...
 
union {
   int   myId
 The ID of this item group. More...
 
   FFrItemGroup *   next
 Used in memory management. More...
 
}; 
 Shared data memory segment for myId and next. More...
 
bool isInlined
 If true, the item group has no name and no Id. More...
 

Additional Inherited Members

- Public Attributes inherited from FFrFieldEntryBase
FFrEntries dataFields
 List of data fields referred by this entry. More...
 
- Protected Member Functions inherited from FFrFieldEntryBase
virtual int readPosData (const double *vals, int nvals, int pos) const
 Reads double data from the hierarhcy under this entry. More...
 
virtual int readPosData (const float *vals, int nvals, int pos) const
 Reads float data from the hierarhcy under this entry. More...
 
virtual int readPosData (const int *vals, int nvals, int pos) const
 Reads integer data from the hierarhcy under this entry. More...
 
- Protected Member Functions inherited from FFrEntryBase
 FFrEntryBase ()
 Default constructor. More...
 
 FFrEntryBase (const FFrEntryBase &obj)
 Copy constructor. More...
 
FFrEntryBase & operator= (const FFrEntryBase &)=delete
 Disable default assignment operator. More...
 

Detailed Description

Class representng an item group in a result file hierarchy.

Constructor & Destructor Documentation

◆ FFrItemGroup() [1/2]

FFrItemGroup::FFrItemGroup ( bool  inlined = false)
explicit

Default constructor.

◆ FFrItemGroup() [2/2]

FFrItemGroup::FFrItemGroup ( const FFrItemGroup &  obj)

Copy constructor.

◆ ~FFrItemGroup()

FFrItemGroup::~FFrItemGroup ( )
virtual

Empty destructor.

Member Function Documentation

◆ comp()

bool FFrItemGroup::comp ( const FFrEntryBase *  ) const
virtual

Returns true if *this equals another specified entry.

Reimplemented from FFrEntryBase.

◆ create()

FFrStatus FFrItemGroup::create ( FILE *  varStream,
FFrCreatorData &  cd,
bool  dataBlocks 
)
static

Static method for parsing an item group definition from file.

◆ equal()

bool FFrItemGroup::equal ( const FFrEntryBase *  obj) const
virtual

Returns true if *this and *obj are considered equal.

Reimplemented from FFrFieldEntryBase.

◆ fillObject()

int FFrItemGroup::fillObject ( const std::vector< std::string > &  tokens,
FFrCreatorData &  cd 
)

Parses the item group definition from a list of strings.

Returns -1 on error, and 0 if no ID could be read. The format is assumed [id;name/num;references]. If id is absent, that would mean an inlined item group which can occur both in the VARIABLES and in the DATABLOCKS section. The method also resolves the references.

◆ getDescription()

virtual const std::string& FFrItemGroup::getDescription ( ) const
inlinevirtual

Returns the type name of the item group.

Implements FFrEntryBase.

◆ getType()

const std::string & FFrItemGroup::getType ( ) const
virtual

Returns either the given name or the ID of the item group.

Implements FFrEntryBase.

◆ getUserID()

virtual int FFrItemGroup::getUserID ( ) const
inlinevirtual

Returns the user ID for this entry.

Object group and item group entries have a user ID. For other types (e.g., variable references) zero is returned.

Reimplemented from FFrEntryBase.

◆ hasDescription()

virtual bool FFrItemGroup::hasDescription ( ) const
inlinevirtual

Returns true since all item groups have a type name.

Reimplemented from FFrEntryBase.

◆ hasUserID()

virtual bool FFrItemGroup::hasUserID ( ) const
inlinevirtual

Returns whether this entry has a user ID or not.

Reimplemented from FFrEntryBase.

◆ isIG()

virtual bool FFrItemGroup::isIG ( ) const
inlinevirtual

Returns true since this entry is an Item Group.

Reimplemented from FFrEntryBase.

◆ less()

bool FFrItemGroup::less ( const FFrEntryBase *  obj) const
virtual

Returns true if *this is ordered before *obj.

Reimplemented from FFrFieldEntryBase.

◆ operator=()

FFrItemGroup& FFrItemGroup::operator= ( const FFrItemGroup &  )
delete

Deleted Assignment operator.

◆ setGlobal()

void FFrItemGroup::setGlobal ( )
virtual

Defines this as a global scope entry.

By default, all entries are considered to be in container scope.

Reimplemented from FFrEntryBase.

◆ traverse()

int FFrItemGroup::traverse ( FFrResultContainer *  ,
FFrEntryBase *  ,
FFrEntryBase *&  ,
int  binPos 
)
virtual

Traverses to build owner hierarchy and calculate binary sizes.

Reimplemented from FFrEntryBase.

Member Data Documentation

◆ 

union { ... }

Shared data memory segment for myId and next.

◆ isInlined

bool FFrItemGroup::isInlined
private

If true, the item group has no name and no Id.

◆ myId

int FFrItemGroup::myId

The ID of this item group.

◆ myNameIt

std::set<std::string>::const_iterator FFrItemGroup::myNameIt
private

Iterator pointing to the item group name.

This is only used when myId equals -1.

◆ next

FFrItemGroup* FFrItemGroup::next

Used in memory management.


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