ObjectProperties.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  *  ObjectProperties.h
00003  *
00004  *  (C) 2007 AG Aktives Sehen <agas@uni-koblenz.de>
00005  *           Universitaet Koblenz-Landau
00006  *
00007  *  Additional information:
00008  *  $Id: ObjectProperties.h 30210 2009-03-13 15:36:58Z sisuthie $
00009  *******************************************************************************/
00010 
00011 
00012 #ifndef OBJECTPROPERTIES_H
00013 #define OBJECTPROPERTIES_H
00014 
00015 #include <vector>
00016 #include <string>
00017 
00018 #include "ImagePropertiesCV.h"
00019 
00020 // include headers that implement an archive in binary format
00021 #include <boost/archive/binary_iarchive.hpp>
00022 #include <boost/archive/binary_oarchive.hpp>
00023 #include <boost/archive/text_iarchive.hpp>
00024 #include <boost/archive/text_oarchive.hpp>
00025 
00031 class ObjectProperties {
00032 
00033   public:
00034 
00035     friend class boost::serialization::access;
00036 
00038     ObjectProperties( std::string name="" );
00039 
00041     ObjectProperties( const ObjectProperties& other );
00042 
00044     ~ObjectProperties();
00045 
00047     ObjectProperties& operator= (const ObjectProperties& right);
00048 
00050     void addImageProperties( ImagePropertiesCV* imageProperties );
00051 
00053     void setType(std::string type) { m_Type = type; }
00054 
00055     void setName( std::string name ) { m_Name = name; }
00056 
00057     // GETTER FUNCTIONS
00058 
00060     std::vector<std::string> getImageNames();
00061 
00063     std::string getName() { return m_Name; }
00064 
00066     std::string getType() { return m_Type; }
00067 
00068     const std::vector< ImagePropertiesCV* > getImageProperties( ) const { return m_ImageProperties; }
00069 
00070     const ImagePropertiesCV* getImageProperties( std::string name ) const;
00071 
00072     void deleteImageProperties( std::string name );
00073 
00074     void deleteImageProperties( int index );
00075 
00076     // SERIALIZATION
00077 
00078     template<class Archive>
00079     void save(Archive & ar, const unsigned int version) const
00080     {
00081         unsigned x = 12;
00082         ar & x;
00083 
00084         ar & m_Name;
00085         ar & m_Type;
00086 
00087         unsigned size = m_ImageProperties.size();
00088         ar & size;
00089 
00090         for ( unsigned i=0; i < size; i++)
00091         {
00092             ar & m_ImageProperties[i];
00093         }
00094     }
00095 
00096     template<class Archive>
00097     void load(Archive & ar, const unsigned int version_b)
00098     {
00099         unsigned version = 0;
00100         ar & version;
00101 
00102         if ( version != 12 )
00103         {
00104           throw "Loaded object-file has wrong version number.";
00105         }
00106 
00107         ar & m_Name;
00108         ar & m_Type;
00109         unsigned size;
00110         ar & size;
00111 
00112         m_ImageProperties.reserve( size );
00113         for ( unsigned i=0; i < size; i++)
00114         {
00115             ImagePropertiesCV* imageProperties=new ImagePropertiesCV( );
00116             ar & imageProperties;
00117             addImageProperties( imageProperties );
00118         }
00119     }
00120 
00121     BOOST_SERIALIZATION_SPLIT_MEMBER()
00122 
00123     
00124     void printOn( std::ostream& strm );
00125 
00126   private:
00127 
00128     std::string m_Name;
00129 
00130     std::string m_Type;
00131 
00132     std::vector< ImagePropertiesCV* > m_ImageProperties;
00133 };
00134 
00135 BOOST_CLASS_VERSION(ObjectProperties, 12)
00136 
00137 #endif


or_libs
Author(s): raphael
autogenerated on Mon Oct 6 2014 02:53:18