mtc_colorset.h
Go to the documentation of this file.
1/** @file mtc_colorset.h
2
3Implements color sets for multitasking automata
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 FAUDES_MTCCOLORSET_H
28#define FAUDES_MTCCOLORSET_H
29
30#include "corefaudes.h"
31
32
33namespace faudes {
34
35/**
36 * Container for colors: this is a NameSet with its own static symboltable
37 *
38 * @ingroup MultitaskingPlugin
39 */
40
41class FAUDES_API ColorSet : public NameSet {
42
44
45 public:
46
47 /**
48 * Constructor for ColorSet with static ColorSymbolTable.
49 */
50 ColorSet(void) : NameSet() {
51 mpSymbolTable= &msSymbolTable; NameSet::Name("Colors");
52 FD_DC("ColorSet("<<this<<")::ColorSet() with colorsymtab "<< SymbolTablep());
53 };
54
55 /**
56 * Constructor for ColorSet with specified symbol table.
57 */
58 ColorSet(SymbolTable *pSymTab) : NameSet() {
59 mpSymbolTable= pSymTab; NameSet::Name("Colors");
60 FD_DC("ColorSet("<<this<<")::ColorSet() with colorsymtab "<< SymbolTablep());
61 };
62
63 /**
64 * Copy-onstructor for ColorSet
65 */
66 ColorSet(const ColorSet& rSourceSet) : NameSet() {
67 DoAssign(rSourceSet);
68 FD_DC("ColorSet("<<this<<")::ColorSet(rSourceSetr) with colorsymtab "<< SymbolTablep());
69 };
70
71 /**
72 * Constructor for ColorSet with static ColorSymbolTable.
73 * This version reads a file with given label to find the colors
74 * inside the file.
75 *
76 * @param rFilename
77 * Filename
78 * @param rLabel
79 * Token label for the colors in the file; default value "Colors"
80 */
81 ColorSet(const std::string& rFilename, const std::string& rLabel = "Colors") : NameSet()
82 { mpSymbolTable= &msSymbolTable; NameSet::Read(rFilename,rLabel);};
83
84 /* Destructor, virtual */
85 virtual ~ColorSet(void) {};
86
87 /**
88 * Get pointer to static ColorSymbolTable
89 *
90 * @return
91 * Pointer to static ColorSymbolTable
92 */
93 static SymbolTable* StaticSymbolTablep(void);
94
95 /**
96 * Reset pointer mpSymbolTable
97 *
98 * @param pSymTab
99 * Pointer to new symbol table
100 */
101 void ColorSymbolTablep(SymbolTable *pSymTab);
102
103 /**
104 * Set intersection operator
105 *
106 * @return
107 * Intersection ColorSet
108 */
109 ColorSet operator * (const ColorSet& rOtherSet) const;
110
111 /**
112 * Set union operator
113 *
114 * @return
115 * Union Set
116 */
117 ColorSet operator + (const ColorSet& rOtherSet) const;
118
119 /**
120 * Set difference operator
121 *
122 * @return
123 * Difference ColorSet
124 */
125 ColorSet operator - (const ColorSet& rOtherSet) const;
126
127 /** Test for subset
128 */
129 bool operator <= (const ColorSet& rOtherSet) const;
130
131 /** Test for superset
132 */
133 bool operator >= (const ColorSet& rOtherSet) const;
134
135 protected:
136
137 /** Static global symbol table for color names */
139
140 /**
141 * Assign from other color set.
142 *
143 * @param rSourceSet
144 * Destination to copy from
145 */
146 virtual void DoAssign(const ColorSet& rSourceSet);
147
148}; // end class ColorSet
149
150} // namespace faudes
151
152#endif
#define FD_DC(message)
#define FAUDES_API
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition cfl_types.h:879
virtual ~ColorSet(void)
ColorSet(const std::string &rFilename, const std::string &rLabel="Colors")
ColorSet(SymbolTable *pSymTab)
ColorSet(const ColorSet &rSourceSet)
static SymbolTable msSymbolTable

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