mtc_attributes.h
Go to the documentation of this file.
1/** @file mtc_attributes.h
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#ifndef MTC_ATTRIBUTES_H
28#define MTC_ATTRIBUTES_H
29
30#include "corefaudes.h"
31#include "mtc_colorset.h"
32
33namespace faudes {
34
35/**
36 *
37 * State attributes for multitasking automata
38 *
39 * @ingroup MultitaskingPlugin
40 */
42
44
45
46 public:
47
48 /** Default constructor */
50 mpColorSymbolTable=mColors.SymbolTablep();
51 };
52
53 /** Copy constructor */
55 mpColorSymbolTable=mColors.SymbolTablep();
56 mColors=rSrc.mColors;
57 };
58
59 virtual ~AttributeColoredState(void) {};
60
61 /**
62 * Test for default value
63 *
64 * @return
65 * True for defaultvalue
66 */
67 bool IsDefault(void) const {return (mColors.Empty() && (mFlags==mDefFlags)); };
68
69 /**
70 * Iterator for first entry in mColors
71 */
72 NameSet::Iterator ColorsBegin() const;
73
74 /**
75 * Iterator for last entry in mColors
76 */
77 NameSet::Iterator ColorsEnd() const;
78
79 /**
80 * Read access to color set
81 *
82 * @return
83 * Reference to attribute data
84 */
85 const ColorSet& Colors(void) const { return mColors;};
86
87
88 /**
89 * Writable access to color set
90 *
91 * @return
92 * Reference to attribute data
93 */
94 ColorSet& Colors(void) { return mColors;};
95
96 /**
97 * Set the color set
98 *
99 * @param rColors
100 * New color set
101 */
102 void Colors(const ColorSet& rColors) { mColors=rColors;};
103
104 /**
105 * Set pointer to color symbol table
106 *
107 * @param pSymTab
108 * New color symbol table
109 */
110 void ColorSymTab(SymbolTable *pSymTab);
111
112 /**
113 * Get pointer to color symbol table
114 *
115 * @return
116 * Pointer to current color symbol table
117 */
118 SymbolTable *ColorSymTabp(void) const;
119
120protected:
121
122 /** Colorset */
124
125 /** Pointer to colorsymboltable */
127
128 /**
129 * Copyment method.
130 *
131 * @param rSrcAttr
132 * Source to assign from
133 */
134 virtual void DoCopy(const AttributeColoredState& rSrcAttr);
135
136
137 /**
138 * Copyment method.
139 *
140 * @param rSrcAttr
141 * Source to assign from
142 */
143 virtual void DoMove(AttributeColoredState& rSrcAttr);
144
145
146 /**
147 * Test equality of configuration data.
148 *
149 * @param rOther
150 * Other attribute to compare with.
151 * @return
152 * True on match.
153 */
154 virtual bool DoEqual(const AttributeColoredState& rOther) const;
155
156 /**
157 * Write attributes to tokenwriter
158 *
159 * @param rTw
160 * Tokenreader to write to
161 * @param rLabel
162 * Section to write
163 * @param pContext
164 * Write context to provide contextual information
165 *
166 * @exception Exception
167 * I/O errors
168 */
169 virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
170
171 /**
172 * Write attributes to tokenwriter
173 *
174 * @param rTw
175 * Tokenreader to write to
176 * @param rLabel
177 * Section to write
178 * @param pContext
179 * Write context to provide contextual information
180 *
181 * @exception Exception
182 * I/O errors
183 */
184 virtual void DoXWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
185
186 /**
187 * Read attributes from tokenreader
188 *
189 * @param rTr
190 * Tokenreader to read from
191 * @param rLabel
192 * Section to read
193 * @param pContext
194 * Read context to provide contextual information
195 *
196 * @exception Exception
197 * Thrown on file format errors (ids 50, 51)
198 */
199 virtual void DoRead(TokenReader& rTr,const std::string& rLabel="", const Type* pContext=0);
200
201
202
203}; // class AttributeColoredState
204
205} // namespace faudes
206
207#endif
#define FAUDES_API
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition cfl_types.h:918
AttributeColoredState(const AttributeColoredState &rSrc)
void Colors(const ColorSet &rColors)
const ColorSet & Colors(void) const

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