mtc_attributes.h
Go to the documentation of this file.
1 /** @file mtc_attributes.h
2 
3 Color 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 
33 namespace 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  virtual ~AttributeColoredState(void) {};
53 
54  /**
55  * Test for default value
56  *
57  * @return
58  * True for defaultvalue
59  */
60  bool IsDefault(void) const {return (mColors.Empty() && (mFlags==mDefFlags)); };
61 
62  /**
63  * Iterator for first entry in mColors
64  */
65  NameSet::Iterator ColorsBegin() const;
66 
67  /**
68  * Iterator for last entry in mColors
69  */
70  NameSet::Iterator ColorsEnd() const;
71 
72  /**
73  * Read access to color set
74  *
75  * @return
76  * Reference to attribute data
77  */
78  const ColorSet& Colors(void) const { return mColors;};
79 
80 
81  /**
82  * Writable access to color set
83  *
84  * @return
85  * Reference to attribute data
86  */
87  ColorSet& Colors(void) { return mColors;};
88 
89  /**
90  * Set the color set
91  *
92  * @param rColors
93  * New color set
94  */
95  void Colors(const ColorSet& rColors) { mColors=rColors;};
96 
97  /**
98  * Set pointer to color symbol table
99  *
100  * @param pSymTab
101  * New color symbol table
102  */
103  void ColorSymTab(SymbolTable *pSymTab);
104 
105  /**
106  * Get pointer to color symbol table
107  *
108  * @return
109  * Pointer to current color symbol table
110  */
111  SymbolTable *ColorSymTabp(void) const;
112 
113 protected:
114 
115  /** Colorset */
117 
118  /** Pointer to colorsymboltable */
120 
121  /**
122  * Assignment method.
123  *
124  * @param rSrcAttr
125  * Source to assign from
126  */
127  virtual void DoAssign(const AttributeColoredState& rSrcAttr);
128 
129 
130  /**
131  * Test equality of configuration data.
132  *
133  * @param rOther
134  * Other attribute to compare with.
135  * @return
136  * True on match.
137  */
138  virtual bool DoEqual(const AttributeColoredState& rOther) const;
139 
140  /**
141  * Write attributes to tokenwriter
142  *
143  * @param rTw
144  * Tokenreader to write to
145  * @param rLabel
146  * Section to write
147  * @param pContext
148  * Write context to provide contextual information
149  *
150  * @exception Exception
151  * I/O errors
152  */
153  virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
154 
155  /**
156  * Write attributes to tokenwriter
157  *
158  * @param rTw
159  * Tokenreader to write to
160  * @param rLabel
161  * Section to write
162  * @param pContext
163  * Write context to provide contextual information
164  *
165  * @exception Exception
166  * I/O errors
167  */
168  virtual void DoXWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
169 
170  /**
171  * Read attributes from tokenreader
172  *
173  * @param rTr
174  * Tokenreader to read from
175  * @param rLabel
176  * Section to read
177  * @param pContext
178  * Read context to provide contextual information
179  *
180  * @exception Exception
181  * Thrown on file format errors (ids 50, 51)
182  */
183  virtual void DoRead(TokenReader& rTr,const std::string& rLabel="", const Type* pContext=0);
184 
185 
186 
187 }; // class AttributeColoredState
188 
189 } // namespace faudes
190 
191 #endif
#define FAUDES_API
Interface export/import symbols: windows.
Definition: cfl_platform.h:80
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
faudes type declaration macro
Definition: cfl_types.h:867
State attributes for multitasking automata.
ColorSet & Colors(void)
Writable access to color set.
const ColorSet & Colors(void) const
Read access to color set.
SymbolTable * mpColorSymbolTable
Pointer to colorsymboltable.
void Colors(const ColorSet &rColors)
Set the color set.
AttributeColoredState(void)
Default constructor.
bool IsDefault(void) const
Test for default value.
virtual ~AttributeColoredState(void)
Boolean flags Attribute.
Container for colors: this is a NameSet with its own static symboltable.
Definition: mtc_colorset.h:41
A SymbolTable associates sybolic names with indices.
A TokenReader reads sequential tokens from a file or string.
A TokenWriter writes sequential tokens to a file, a string or stdout.
Base class of all libFAUDES objects that participate in the run-time interface.
Definition: cfl_types.h:239
Includes all libFAUDES headers, no plugins.
Implements color sets for multitasking automata.
libFAUDES resides within the namespace faudes.

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen