mtc_attributes.cpp
Go to the documentation of this file.
1/** @file mtc_attributes.cpp
2
3Color attributes for states
4
5*/
6
7/* FAU Discrete Event Systems Library (libfaudes)
8
9 Copyright (C) 2008 Matthias Singer
10 Exclusive copyright is granted to Klaus Schmidt
11
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Lesser General Public
14 License as published by the Free Software Foundation; either
15 version 2.1 of the License, or (at your option) any later version.
16
17 This library is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 Lesser General Public License for more details.
21
22 You should have received a copy of the GNU Lesser General Public
23 License along with this library; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
25
26
27#include "mtc_attributes.h"
28
29namespace faudes {
30
31// faudes type
32FAUDES_TYPE_IMPLEMENTATION(Void,AttributeColoredState,AttributeFlags)
33
34// assignment
35void AttributeColoredState::DoCopy(const AttributeColoredState& rSrcAttr) {
36 // call base (incl virtual clear)
37 AttributeFlags::DoCopy(rSrcAttr);
38 // no additional members
39 ColorSymTab(rSrcAttr.mpColorSymbolTable);
40 mColors=rSrcAttr.mColors;
41}
42
43// assignment
45 // call base (incl virtual clear)
46 AttributeFlags::DoCopy(rSrcAttr);
47 // no additional members
49 mColors.Move(rSrcAttr.mColors);
50}
51
53 // call base
54 if(!AttributeFlags::DoEqual(rOther)) return false;
55 // my data
56 if(mColors!=rOther.mColors) return false;
57 // pass
58 return true;
59}
60
61
62
63//Write(rTw);
64void AttributeColoredState::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
65 if(IsDefault()) return;
66 mColors.Write(rTw,"Colors");
67}
68//Write(rTw);
69void AttributeColoredState::DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const {
70 if(IsDefault()) return;
71 mColors.XWrite(rTw,"Colors");
72}
73
74// DoRead(rTr)
75void AttributeColoredState::DoRead(TokenReader& rTr,const std::string& rLabel, const Type* pContext) {
76 FD_DC("AttributeColoredState(" << this << ")::Read(tr)");
77 mColors.Clear();
78 Token token;
79 rTr.Peek(token);
80 if(!token.IsBegin("Colors")) return;
81 mColors.Read(rTr,"Colors");
82}
83
84// Begin()
85NameSet::Iterator AttributeColoredState::ColorsBegin() const {
86 return mColors.Begin();
87}
88
89// End()
90NameSet::Iterator AttributeColoredState::ColorsEnd() const{
91 return mColors.End();
92}
93
94// ColorSymTab(pSymTab)
98
99// ColorSymTabp()
103
104} // namespace faudes
#define FD_DC(message)
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
Definition cfl_types.h:1017
NameSet::Iterator ColorsEnd() const
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
void ColorSymTab(SymbolTable *pSymTab)
virtual void DoXWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
SymbolTable * ColorSymTabp(void) const
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
NameSet::Iterator ColorsBegin() const
virtual bool DoEqual(const AttributeColoredState &rOther) const
virtual void DoMove(AttributeColoredState &rSrcAttr)
bool DoEqual(const AttributeFlags &rOther) const
void DoCopy(const AttributeFlags &rSrcAttr)
void ColorSymbolTablep(SymbolTable *pSymTab)
SymbolTable * SymbolTablep(void) const
bool Peek(Token &token)
bool IsBegin(void) const
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
virtual void XWrite(const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
void Write(const Type *pContext=0) const
virtual Type & Move(Type &rSrc)
Definition cfl_types.cpp:89
virtual void Clear(void)
Iterator End(void) const
Iterator Begin(void) const

libFAUDES 2.34e --- 2026.03.16 --- c++ api documentaion by doxygen