00001 /* 00002 Copyright 2007, 2008, 2009, 2010, 2011 Instituto de Sistemas e Robotica, Instituto Superior Tecnico 00003 00004 This file is part of MeRMaID. 00005 00006 MeRMaID is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 MeRMaID is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with MeRMaID. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 00021 00022 /** 00023 * @Filename Boolean.hpp 00024 * @Description Boolean class definition. 00025 * @Status Implementing 00026 * @Version $Id: Boolean.hpp 1 2011-03-04 18:13:18Z jreis $ 00027 * @Maintainer Marco Barbosa + Nelson Ramos 00028 */ 00029 00030 // #ifndef __DATASTRUCTURE_BOOLEAN_H_ 00031 #ifdef __DATASTRUCTURE_BOOLEAN_H_ // NOT USING BOOLEAN 00032 #define __DATASTRUCTURE_BOOLEAN_H_ 00033 00034 #include "DataValue.hpp" 00035 00036 namespace mermaid 00037 { 00038 namespace support 00039 { 00040 namespace data 00041 { 00042 /** 00043 * @Class Boolean Boolean.hpp "Boolean.hpp" 00044 * @Description Class representing a boolean data value 00045 * @Author Marco Barbosa + Nelson Ramos 00046 */ 00047 00048 class Boolean : public DataValue 00049 { 00050 00051 friend class Data; //because Data::copyFrom(const Data& d) method 00052 friend class DataFactory; //because DataFactory::buildBoolean(Data * data, std::string valueString) 00053 public: 00054 00055 /** 00056 * @Description Default boolean constructor 00057 */ 00058 Boolean * clone(); 00059 00060 00061 /** 00062 * @Description Boolean value setter. 00063 * @Argument value Value to which the Boolean instance should be set 00064 */ 00065 void setValue (bool value); 00066 00067 /** 00068 * @Description Boolean value getter. 00069 * @Returns Current value of the Boolean instance. 00070 */ 00071 bool getValue() const; 00072 00073 /** 00074 * @Description Method to convert value to string 00075 */ 00076 virtual operator std::string() const; 00077 00078 00079 private: 00080 00081 00082 /** 00083 * @Description Default boolean constructor 00084 */ 00085 Boolean(); 00086 00087 /** 00088 * @Description Boolean constructor with initial value 00089 * @Argument value Initial value of the Boolean instance 00090 */ 00091 Boolean (bool value); 00092 00093 00094 bool boolValue_; //< Boolean value 00095 }; 00096 } // namespace data 00097 } // namespace support 00098 } // namespace mermaid 00099 00100 #endif // __DATASTRUCTURE_BOOLEAN_H_