libFAUDES
Sections
Index
|
mtc_attributes.cppGo to the documentation of this file.00001 /** @file mtc_attributes.cpp 00002 00003 Implements the color representation for single states in multitasking 00004 automata as state attributes 00005 00006 */ 00007 00008 /* FAU Discrete Event Systems Library (libfaudes) 00009 00010 Copyright (C) 2008 Matthias Singer 00011 Exclusive copyright is granted to Klaus Schmidt 00012 00013 This library is free software; you can redistribute it and/or 00014 modify it under the terms of the GNU Lesser General Public 00015 License as published by the Free Software Foundation; either 00016 version 2.1 of the License, or (at your option) any later version. 00017 00018 This library is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 Lesser General Public License for more details. 00022 00023 You should have received a copy of the GNU Lesser General Public 00024 License along with this library; if not, write to the Free Software 00025 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00026 00027 00028 #include "mtc_attributes.h" 00029 00030 namespace faudes { 00031 00032 // faudes type 00033 FAUDES_TYPE_IMPLEMENTATION(Void,AttributeColoredState,AttributeFlags) 00034 00035 // assignment 00036 void AttributeColoredState::DoAssign(const AttributeColoredState& rSrcAttr) { 00037 // call base (incl virtual clear) 00038 AttributeFlags::DoAssign(rSrcAttr); 00039 // no additional members 00040 ColorSymTab(rSrcAttr.mpColorSymbolTable); 00041 mColors=rSrcAttr.mColors; 00042 } 00043 00044 bool AttributeColoredState::DoEqual(const AttributeColoredState& rOther) const { 00045 // call base 00046 if(!AttributeFlags::DoEqual(rOther)) return false; 00047 // my data 00048 if(mColors!=rOther.mColors) return false; 00049 // pass 00050 return true; 00051 } 00052 00053 00054 00055 //Write(rTw); 00056 void AttributeColoredState::DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const { 00057 if(IsDefault()) return; 00058 mColors.Write(rTw); 00059 } 00060 00061 // DoRead(rTr) 00062 void AttributeColoredState::DoRead(TokenReader& rTr,const std::string& rLabel, const Type* pContext) { 00063 FD_DC("AttributeColoredState(" << this << ")::Read(tr)"); 00064 mColors.Clear(); 00065 Token token; 00066 rTr.Peek(token); 00067 if(token.Type()!=Token::Begin) return; 00068 if(token.StringValue()!="Colors") return; 00069 mColors.Read(rTr,"Colors"); 00070 } 00071 00072 // Begin() 00073 NameSet::Iterator AttributeColoredState::ColorsBegin() const { 00074 return mColors.Begin(); 00075 } 00076 00077 // End() 00078 NameSet::Iterator AttributeColoredState::ColorsEnd() const{ 00079 return mColors.End(); 00080 } 00081 00082 // ColorSymTab(pSymTab) 00083 void AttributeColoredState::ColorSymTab(SymbolTable *pSymTab) { 00084 mColors.ColorSymbolTablep(pSymTab); 00085 } 00086 00087 // ColorSymTabp() 00088 SymbolTable *AttributeColoredState::ColorSymTabp(void) const { 00089 return mColors.SymbolTablep(); 00090 } 00091 00092 } // namespace faudes |
libFAUDES 2.20d --- 2011.04.26 --- c++ source docu by doxygen