00001 #ifndef DDF_PROPERTY_H 00002 #define DDF_PROPERTY_H 00003 00004 #include "propertyiterator.h" 00005 #include <hdf5/hdf5.h> 00006 #include "vnode.h" 00007 #include "../util/io.h" 00008 #include "propertyset.h" 00009 #include "geometry.h" 00010 00011 #include <vector> 00012 00013 namespace afl 00014 { 00015 namespace ddf 00016 { 00017 00022 class Property 00023 { 00025 public: 00026 00030 typedef PropertyIterator iterator; 00031 00036 Property( PropertySet* parent ); 00037 00042 Property( const Property& toCopy ); 00043 00049 Property& operator=( const Property& toCopy); 00050 00054 ~Property( ); 00055 00067 void init( size_t rows = 1, size_t cols = 1, size_t epochs = 1 ); 00068 00084 void resize( size_t rows = 1, size_t cols = 1, size_t epochs = 1 ); 00085 00094 void resize( const Geometry* geom ); 00095 00100 const Geometry* getGeometry( ) const; 00101 00106 iterator begin( ); 00107 00112 iterator end( ); 00113 00118 iterator push_back( ); 00119 00123 void pop_back( ); 00124 00128 size_t size( ) const; 00129 00138 Node& operator[]( size_t index ); 00139 00148 const Node& operator[]( size_t index ) const; 00149 00156 PropertyIterator erase( const PropertyIterator& toErase ); 00157 00165 void insert( const PropertyIterator& toInsert ); 00166 00171 const Node* getMax( ) const; 00172 00177 const Node* getMin( ) const; 00178 00183 void save( const std::string& path ) const; 00184 00189 void load( const std::string& path ); 00190 00192 private: 00193 friend class Node; 00199 void process( data_t val, size_t loc ); 00200 00201 private: 00202 friend class PropertyIterator; 00203 void revalMin( ); 00204 void revalMax( ); 00205 00208 private: 00209 friend class PropertySet; 00213 PropertySet* _parent; 00214 00218 std::vector<Node> _nodes; 00219 00223 Node _max; 00224 00228 Node _min; 00229 00233 Geometry* _geom; 00234 }; 00235 00236 } 00237 } 00238 00239 #endif // PROPERTY_H 00240