pev_pgenerator.cpp
Go to the documentation of this file.
1 /** @file pev_pgenerator.cpp Classes pGenerator */
2 
3 
4 /* FAU Discrete Event Systems Library (libfaudes)
5 
6  Copyright (C) 2025 Yiheng Tang, Thomas Moor
7  Exclusive copyright is granted to Klaus Schmidt
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 
24 
25 #include "pev_pgenerator.h"
26 
27 namespace faudes {
28 
29 /*
30 ********************************
31 AttributePGenGl implementation
32 ********************************
33 */
34 
35 FAUDES_TYPE_IMPLEMENTATION(Void,AttributePGenGl,AttributeVoid)
36 
37 /*
38 ********************************
39 Autoregister
40 ********************************
41 */
42 
44 
48 
49 
50 /*
51 ********************************
52 Implementation global attribute
53 ********************************
54 */
55 
56 // construct
58  mFairCons.Name("FairnessConstraints");
59 }
60 
61 // token io
62 void AttributePGenGl::DoRead(TokenReader& rTr, const std::string& rLabel, const Type* pContext) {
63  std::string label=rLabel;
64  if(label.empty()) label="FairnessConstraints";
65  Token tok;
66  rTr.Peek(tok);
67  if(!tok.IsBegin(label)) return;
68  mFairCons.Read(rTr,label,pContext);
69 }
70 
71 // token io
72 void AttributePGenGl::DoWrite(TokenWriter& rTw,const std::string& rLabel, const Type* pContext) const {
73  std::string label=rLabel;
74  if(label.empty()) label="FairnessConstraints";
75  mFairCons.Write(rTw,label,pContext);
76 }
77 
78 // token io
79 void AttributePGenGl::DoXWrite(TokenWriter& rTw,const std::string& rLabel, const Type* pContext) const {
80  std::string label=rLabel;
81  if(label.empty()) label="FairnessConstraints";
82  mFairCons.XWrite(rTw,label,pContext);
83 }
84 
85 
86 
87 
88 }// namespace
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
Definition: cfl_types.h:958
The AttributePGenGl class Class wrapping various global attributes of a FPGen.
virtual void DoXWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=nullptr) const
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=nullptr)
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=nullptr) const
FairnessConstraints mFairCons
mFairConst fairness constraints
bool Peek(Token &token)
bool IsBegin(void) const
Definition: cfl_token.cpp:259
virtual void Name(const std::string &rName)
Definition: cfl_types.cpp:123
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
Definition: cfl_types.cpp:267
virtual void XWrite(const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
Definition: cfl_types.cpp:206
void Write(const Type *pContext=0) const
Definition: cfl_types.cpp:145
AutoRegisterType< FairnessConstraints > gRtiRegisterFairCons("FairnessConstraints")
AutoRegisterElementTag< FairnessConstraints > gRtiRegisterFairConsETag("FairnessConstraints","EventSet")
AutoRegisterElementType< FairnessConstraints > gRtiRegisterFairConsEType("FairnessConstraints","EventSet")
AttrType AttributeVoid
AutoRegisterType< pGenerator > gRtiRegisterPGenerator("pGenerator")

libFAUDES 2.33l --- 2025.09.16 --- c++ api documentaion by doxygen