DataValueVector.hpp

Go to the documentation of this file.
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 DataValueVector.hpp
00024  * @Description DataValueVector class definition.
00025  * @Status Implementing
00026  * @Version $Id: DataValueVector.hpp 1 2011-03-04 18:13:18Z jreis $
00027  * @Maintainer
00028  */
00029 
00030 
00031 
00032 #ifndef __DATASTRUCTURE_DATAVALUEVECTOR_H_
00033 #define __DATASTRUCTURE_DATAVALUEVECTOR_H_
00034 
00035 
00036 
00037 #include "DataValue.hpp"
00038 
00039 #include <vector>
00040 
00041 namespace mermaid
00042 {
00043   namespace support
00044   {
00045     namespace data
00046     {
00047     
00048       using boost::shared_ptr;
00049       
00050       using std::vector;
00051       
00052       class DataValue;
00053       class DataFactory;
00054       
00055       /**
00056       * @Class DataValueVector DataValueVector.hpp "DataValueVector.hpp"
00057       * @Description Class representing a Data value Vector.
00058       * @Author Marco Barbosa
00059       */
00060       
00061       class DataValueVector
00062       {
00063       
00064           friend class Data;  //because  Data::copyFrom(const Data& d) method
00065           friend class DataFactory; //DataFactory::
00066           
00067         public:
00068         
00069           /**
00070           * @Description DataValueVector copy method
00071           */
00072           DataValueVector * clone();
00073           
00074           
00075           /**
00076           * @Description Value setter
00077           * @Argument value Value to which the vector instance should be set
00078           */
00079           void setValue (vector<shared_ptr<DataValue> > value);
00080           void pushBack (shared_ptr<DataValue> value);
00081           
00082           /**
00083           * @Description Value getter
00084           * @Returns Value at position pos
00085           * @Argument pos Position in the vector
00086           */
00087           shared_ptr<DataValue> getValue (unsigned int pos);
00088           
00089           void setValue (unsigned int pos, shared_ptr<DataValue> value);
00090           
00091           int getSize();
00092           
00093           /**
00094           * @Description Method to convert value to string
00095           */
00096           operator std::string() const;
00097           
00098           
00099           //conversion methods
00100           //DataValueVector& operator=(Bottle &b);
00101           //operator Bottle ();
00102           
00103           
00104         private:
00105         
00106           /**
00107           * @Description DataValueVector default private constructor
00108           */
00109           DataValueVector();
00110           
00111           /**
00112           * @Description DataValueVector constructor
00113           * @Argument value Initial float value.
00114           */
00115           DataValueVector (vector<shared_ptr<DataValue> > value);
00116           
00117           //static void buildDataValueVector(DataValueVector &v, Bottle &b);
00118           
00119           
00120           vector<shared_ptr<DataValue> > valueVector_;
00121           
00122       }; // class DataValueVector
00123     } // namespace data
00124   } // namespace support
00125 } // namespace mermaid
00126 
00127 
00128 #endif //__DATASTRUCTURE_DATAVALUEVECTOR_H_
Generated on Fri Mar 4 22:14:58 2011 for MeRMaID::support by  doxygen 1.6.3