FEDEM Solver  R8.0
Source code of the dynamics solver
FFrObjectGroup.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
8 #ifndef FFR_OBJECT_GROUP_H
9 #define FFR_OBJECT_GROUP_H
10 
12 #include "FFrLib/FFrEnums.H"
13 #include <cstdio>
14 
15 class FFrCreatorData;
16 
17 
19 {
20 public:
22  virtual ~FFrObjectGroup();
23 
24  static FFrStatus create(FILE* varStream, FFrCreatorData& cd, bool dataBlocks);
25 
26  int fillObject(const std::vector<std::string>& tokens, FFrCreatorData& cd);
27 
28  virtual int traverse(FFrResultContainer* resultContainer,
29  FFrEntryBase* owner,
30  FFrEntryBase*& objToBeModified,
31  int binPos);
32 
33  virtual const std::string& getDescription() const { return description; }
34  virtual bool hasDescription() const { return !description.empty(); }
35 
36  virtual const std::string& getType() const { return *typeIt; }
37 
38  // Returns baseID for objects that have a baseID. Returns 0 for other types.
39  virtual int getBaseID() const { return baseId; }
40  virtual bool hasBaseID() const { return baseId != 0; }
41 
42  // Returns userID for objects that have a userID (OG and some IGs).
43  // Returns 0 for other types
44  virtual int getUserID() const { return id; }
45  virtual bool hasUserID() const { return id != 0; }
46 
47  virtual bool isOG() const { return true; }
48 
49 private:
50  int baseId;
51  int id;
52 
53  std::set<std::string>::const_iterator typeIt;
54  std::string description;
55 
56 #if FFR_DEBUG > 2
57  static long int count;
58 #endif
59 };
60 
61 #endif
FFrStatus
Definition: FFrEnums.H:12
Definition: FFrEntryBase.H:28
Definition: FFrFieldEntryBase.H:17
Definition: FFrObjectGroup.H:19
std::set< std::string >::const_iterator typeIt
Definition: FFrObjectGroup.H:53
int fillObject(const std::vector< std::string > &tokens, FFrCreatorData &cd)
Definition: FFrObjectGroup.C:68
FFrObjectGroup()
Definition: FFrObjectGroup.C:17
virtual int getUserID() const
Returns userID for objects that have a userID (OG and some IGs).
Definition: FFrObjectGroup.H:44
int baseId
Definition: FFrObjectGroup.H:50
virtual bool hasUserID() const
Definition: FFrObjectGroup.H:45
std::string description
Definition: FFrObjectGroup.H:54
virtual int getBaseID() const
Returns baseID for objects that have a baseID. Returns 0 for other types.
Definition: FFrObjectGroup.H:39
virtual ~FFrObjectGroup()
Definition: FFrObjectGroup.C:31
virtual int traverse(FFrResultContainer *resultContainer, FFrEntryBase *owner, FFrEntryBase *&objToBeModified, int binPos)
Traverses to build owner hierarchy and calculate binary sizes.
Definition: FFrObjectGroup.C:95
static FFrStatus create(FILE *varStream, FFrCreatorData &cd, bool dataBlocks)
Definition: FFrObjectGroup.C:40
virtual const std::string & getDescription() const
Definition: FFrObjectGroup.H:33
int id
Definition: FFrObjectGroup.H:51
virtual const std::string & getType() const
Definition: FFrObjectGroup.H:36
virtual bool hasDescription() const
Definition: FFrObjectGroup.H:34
virtual bool hasBaseID() const
Definition: FFrObjectGroup.H:40
virtual bool isOG() const
Definition: FFrObjectGroup.H:47
Class holding the data of a Fedem results file.
Definition: FFrResultContainer.H:71
Incapsulation of temporary data used during results file parsing.
Definition: FFrResultContainer.H:36