mtc_colorset.cpp
Go to the documentation of this file.
1 /** @file mtc_colorset.cpp
2 
3 Implements 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 #include "mtc_colorset.h"
28 
29 
30 
31 namespace faudes {
32 
33 
34 // std faudes type (cannot do New() with macro)
35 FAUDES_TYPE_IMPLEMENTATION_COPY(ColorSet,ColorSet,NameSet)
36 FAUDES_TYPE_IMPLEMENTATION_CAST(ColorSet,ColorSet,NameSet)
37 FAUDES_TYPE_IMPLEMENTATION_ASSIGN(ColorSet,ColorSet,NameSet)
38 FAUDES_TYPE_IMPLEMENTATION_EQUAL(ColorSet,ColorSet,NameSet)
39 
40 
41 // msColorSymbolTable (static)
42 SymbolTable ColorSet::msSymbolTable;
43 
44 // DoAssign()
45 void ColorSet::DoAssign(const ColorSet& rSourceSet) {
46  // call base
47  NameSet::DoAssign(rSourceSet);
48 }
49 
50 // Colorset::New()
51 ColorSet* ColorSet::New(void) const {
52  ColorSet* res = new ColorSet();
54  return res;
55 }
56 
57 
58 // StaticSymbolTablep()
60  return &msSymbolTable;
61 }
62 
63 // ColorSymbolTablep()
65  mpSymbolTable = pSymTab;
66 }
67 
68 // operators
69 ColorSet ColorSet::operator * (const ColorSet& rOtherSet) const {
70  FD_DC("ColorSet(" << this << ")::operator * (" << &rOtherSet << ")");
71  ColorSet res;
72  res.Assign( NameSet::operator * (rOtherSet) );
73  return res;
74 }
75 
76 // operator +
77 ColorSet ColorSet::operator + (const ColorSet& rOtherSet) const {
78  FD_DC("ColorSet(" << this << ")::operator + (" << &rOtherSet << ")");
79  ColorSet res;
80  res.Assign( NameSet::operator + (rOtherSet) );
81  return res;
82 }
83 
84 // operator -
85 ColorSet ColorSet::operator - (const ColorSet& rOtherSet) const {
86  FD_DC("ColorSet(" << this << ")::operator - (" << &rOtherSet << ")");
87  ColorSet res;
88  res.Assign( NameSet::operator - (rOtherSet) );
89  return res;
90 }
91 
92 // operator <=
93 bool ColorSet::operator <= (const ColorSet& rOtherSet) const {
94  return NameSet::operator <= (rOtherSet);
95 }
96 
97 // operator >=
98 bool ColorSet::operator >= (const ColorSet& rOtherSet) const {
99  return NameSet::operator >= (rOtherSet);
100 }
101 
102 } // namespace faudes
#define FD_DC(message)
Debug: optional report on container operations.
#define FAUDES_TYPE_IMPLEMENTATION_EQUAL(ftype, ctype, cbase)
Definition: cfl_types.h:904
#define FAUDES_TYPE_IMPLEMENTATION_COPY(ftype, ctype, cbase)
Definition: cfl_types.h:891
#define FAUDES_TYPE_IMPLEMENTATION_CAST(ftype, ctype, cbase)
Definition: cfl_types.h:893
#define FAUDES_TYPE_IMPLEMENTATION_ASSIGN(ftype, ctype, cbase)
Definition: cfl_types.h:896
Container for colors: this is a NameSet with its own static symboltable.
Definition: mtc_colorset.h:41
bool operator<=(const ColorSet &rOtherSet) const
Test for subset.
bool operator>=(const ColorSet &rOtherSet) const
Test for superset.
ColorSet operator*(const ColorSet &rOtherSet) const
Set intersection operator.
static SymbolTable * StaticSymbolTablep(void)
Get pointer to static ColorSymbolTable.
ColorSet operator-(const ColorSet &rOtherSet) const
Set difference operator.
void ColorSymbolTablep(SymbolTable *pSymTab)
Reset pointer mpSymbolTable.
virtual void DoAssign(const ColorSet &rSourceSet)
Assign from other color set.
ColorSet(void)
Constructor for ColorSet with static ColorSymbolTable.
Definition: mtc_colorset.h:50
static SymbolTable msSymbolTable
Static global symbol table for color names.
Definition: mtc_colorset.h:130
ColorSet operator+(const ColorSet &rOtherSet) const
Set union operator.
bool operator<=(const NameSet &rOtherSet) const
Test for subset
bool operator>=(const NameSet &rOtherSet) const
Test for superset.
SymbolTable * mpSymbolTable
Pointer to local SymbolTable.
Definition: cfl_nameset.h:428
void DoAssign(const NameSet &rSourceSet)
Assign from other name set.
Definition: cfl_nameset.cpp:83
A SymbolTable associates sybolic names with indices.
virtual Type & Assign(const Type &rSrc)
Assign configuration data from other object.
Definition: cfl_types.cpp:77
virtual Type * New(void) const
Construct on heap.
Definition: cfl_types.cpp:54
Implements color sets for multitasking automata.
libFAUDES resides within the namespace faudes.

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen