tp_attributes.h
Go to the documentation of this file.
1/** @file tp_attributes.h Attributes for timed automata */
2
3
4/* Timeplugin for FAU Discrete Event Systems Library (libfaudes)
5
6Copyright (C) 2006 Berno Schlein
7Copyright (C) 2007,2014 Thomas Moor
8Exclusive copyright is granted to Klaus Schmidt
9
10*/
11
12
13#ifndef FAUDES_TP_ATTRIBUTES_H
14#define FAUDES_TP_ATTRIBUTES_H
15
16#include "corefaudes.h"
17#include "tp_timeconstraint.h"
18
19namespace faudes {
20
21
22/**
23 * Transition Attribute with guard and resets.
24 *
25 * @ingroup TimedPlugin
26 */
27
29
31
32 public:
33
34 /** Constructor */
35 AttributeTimedTrans(void) : AttributeFlags() { mGuard.Name("Guard"); mResets.Name("Resets"); };
36
37 /** Copy Constructor */
39 DoCopy(rSrcAttr);
40 }
41
42 /**
43 * Test for default value (ie empty constraint and default flags)
44 *
45 * @return
46 * True for default value
47 */
48 virtual bool IsDefault(void) const {return mGuard.Empty() && mResets.Empty() && AttributeFlags::IsDefault(); };
49
50 /** Guard */
52
53 /** Resets */
55
56 protected:
57
58 /**
59 * Copyment method.
60 *
61 * @param rSrcAttr
62 * Source to assign from
63 */
64 void DoCopy(const AttributeTimedTrans& rSrcAttr);
65
66 /**
67 * Copyment method.
68 *
69 * @param rSrcAttr
70 * Source to assign from
71 */
72 void DoMove(AttributeTimedTrans& rSrcAttr);
73
74 /**
75 * Test eaulity.
76 *
77 * @param rOther
78 * Other attribute to compare with.
79 */
80 bool DoEqual(const AttributeTimedTrans& rOther) const;
81
82 /**
83 * Reads the attribute from TokenReader, see AttributeVoid for public wrappers.
84 *
85 * If the current token indicates a timing section, the method reads the guard and reset
86 * timing data from that section. Else it does nothing. Exceptions may only be thrown
87 * on invalid data within the timing section. The context argument is ignored, the
88 * label argument can be used to override the default section name Timing.
89 *
90 * @param rTr
91 * TokenReader to read from
92 * @param rLabel
93 * Section to read
94 * @param pContext
95 * Read context to provide contextual information
96 *
97 * @exception Exception
98 * - IO error (id 1)
99 */
100 virtual void DoRead(TokenReader& rTr,const std::string& rLabel="", const Type* pContext=0);
101
102 /**
103 * Writes the attribute to TokenWriter, see AttributeVoid for public wrappers.
104 *
105 * Writes a Timing section to include data on the guard and resets. The label argument
106 * can be used to set a section label different the the default Timing.
107 * Th context argument is ignored.
108 *
109 * @param rTw
110 * TokenWriter to write to
111 * @param rLabel
112 * Section to write
113 * @param pContext
114 * Write context to provide contextual information
115 *
116 * @exception Exception
117 * - IO error (id 2)
118 */
119 virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
120
121
122
123}; // class AttributeTimedTrans
124
125
126/**
127 *
128 * State attribute with invariant.
129 *
130 * @ingroup TimedPlugin
131 *
132 */
133
135
137
138 public:
139
140 /** Constructor */
142 mInvariant.Name("Invariant");
143 };
144
145 /** Copy Constructor */
147 DoCopy(rSrcAttr);
148 };
149
150 /**
151 * Test for default value (ie empty invariant and default flags)
152 *
153 * @return
154 * True for default value
155 */
156 virtual bool IsDefault(void) const {return mInvariant.Empty() && AttributeFlags::IsDefault(); };
157
158 /** Invariant */
160
161 protected:
162
163
164 /**
165 * Copyment method.
166 *
167 * @param rSrcAttr
168 * Source to assign from
169 */
170 void DoCopy(const AttributeTimedState& rSrcAttr);
171
172
173 /**
174 * Copyment method.
175 *
176 * @param rSrcAttr
177 * Source to assign from
178 */
179 void DoMove(AttributeTimedState& rSrcAttr);
180
181
182 /**
183 * Test eaulity.
184 *
185 * @param rOther
186 * Other attribute to compare with.
187 */
188 bool DoEqual(const AttributeTimedState& rOther) const;
189
190 /**
191 * Reads the attribute from TokenReader, see AttributeVoid for public wrappers.
192 *
193 * If the current token indicates a invariant section, the method reads the invariant
194 * from that section. Else, it does nothing. Exceptions may only be thrown
195 * on invalid data within the timing section. The context argument is ignored, the
196 * label argument can be used to override the default section name Invariant.
197 *
198 * @param rTr
199 * TokenReader to read from
200 * @param rLabel
201 * Section to read
202 * @param pContext
203 * Read context to provide contextual information
204 *
205 * @exception Exception
206 * - IO error (id 1)
207 */
208 virtual void DoRead(TokenReader& rTr, const std::string& rLabel="", const Type* pContext=0);
209
210 /**
211 * Writes the attribute to TokenWriter, see AttributeVoid for public wrappers.
212 *
213 * Writes am Invariant section to include data on the invariant. The label argument
214 * can be used to set a section label different the the default Invariant.
215 * Th context argument is ignored.
216 *
217 * @param rTw
218 * TokenWriter to write to
219 * @param rLabel
220 * Section to write
221 * @param pContext
222 * Write context to provide contextual information
223 *
224 * @exception Exception
225 * - IO error (id 2)
226 */
227 virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
228
229
230}; // class AttributeTimedState
231
232
233/**
234 *
235 * Globat attribute with clockset.
236 *
237 * @ingroup TimedPlugin
238 *
239 */
240
242
244
245 public:
246
247 /** Constructor */
249 mpClockSymbolTable=mClocks.SymbolTablep(); };
250
251 /** Copy Construct */
253 DoCopy(rSrcAttr);
254 }
255
256 /**
257 * Test for default value (ie empty clockset)
258 *
259 * @return
260 * True for default value
261 */
262 virtual bool IsDefault(void) const {return mClocks.Empty(); };
263
264 /** Clocks */
266
267 /** Pointer to clock symboltable */
269
270 protected:
271
272 /**
273 * Copyment method.
274 *
275 * @param rSrcAttr
276 * Source to assign from
277 */
278 void DoCopy(const AttributeTimedGlobal& rSrcAttr);
279
280 /**
281 * Copyment method.
282 *
283 * @param rSrcAttr
284 * Source to assign from
285 */
286 void DoMove(AttributeTimedGlobal& rSrcAttr);
287
288 /**
289 * Test eaulity.
290 *
291 * @param rOther
292 * Other attribute to compare with.
293 */
294 bool DoEqual(const AttributeTimedGlobal& rOther) const;
295
296 /**
297 * Reads the attribute from TokenReader, see AttributeVoid for public wrappers.
298 *
299 * If the current token indicates a Clocks section, the method reads the global
300 * timing data from that section. Else, it does nothing. Exceptions may only be thrown
301 * on invalid data within the timing section. The context argument is ignored, the
302 * label argument can be used to override the default section name Clocks.
303 *
304 * @param rTr
305 * TokenReader to read from
306 * @param rLabel
307 * Section to read
308 * @param pContext
309 * Read context to provide contextual information
310 *
311 * @exception Exception
312 * - IO error (id 1)
313 */
314 virtual void DoRead(TokenReader& rTr,const std::string& rLabel="", const Type* pContext=0);
315
316 /**
317 * Writes the attribute to TokenWriter, see AttributeVoid for public wrappers.
318 *
319 * Writes a Clocks section to include global timing data. The label argument
320 * can be used to set a section label different the the default Clocks.
321 * Th context argument is ignored.
322 *
323 * @param rTw
324 * TokenWriter to write to
325 * @param rLabel
326 * Section to write
327 * @param pContext
328 * Write context to provide contextual information
329 *
330 * @exception Exception
331 * - IO error (id 2)
332 */
333 virtual void DoWrite(TokenWriter& rTw, const std::string& rLabel="", const Type* pContext=0) const;
334
335
336
337
338}; // class AttributeTimedGlobal
339
340
341} // namespace faudes
342
343#endif
#define FAUDES_API
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition cfl_types.h:918
AttributeTimedGlobal(const AttributeTimedGlobal &rSrcAttr)
virtual bool IsDefault(void) const
AttributeTimedState(const AttributeTimedState &rSrcAttr)
virtual bool IsDefault(void) const
AttributeTimedTrans(const AttributeTimedTrans &rSrcAttr)
virtual bool IsDefault(void) const
virtual void Name(const std::string &rName)

libFAUDES 2.34d --- 2026.03.11 --- c++ api documentaion by doxygen