00001 #ifndef DDF_NODE_H 00002 #define DDF_NODE_H 00003 00004 #include <string> 00005 00006 #include <hdf5/hdf5.h> 00007 00008 #include "ddftypes.h" 00009 #include "geometry.h" 00010 00011 namespace afl 00012 { 00013 namespace ddf 00014 { 00015 00016 class VNode; 00017 class Property; 00018 00024 class Node 00025 { 00027 private: 00028 friend class Property; 00029 friend class VNode; 00030 00035 Node( Property* parent ); 00036 00042 void save( hid_t file_id, const std::string& dsName ) const; 00043 00048 void load( hid_t node_id ); 00049 00051 public: 00055 ~Node(); 00056 00061 Node(const Node& toCopy); 00062 00068 Node& operator=(const Node& toCopy); 00069 00073 void init( ); 00074 00078 const Geometry* getGeometry( ) const; 00079 00093 data_t get( size_t row = 0, size_t col = 0, size_t epoch = 0 ) const; 00094 00107 void set( data_t datum, size_t row = 0, size_t col = 0, size_t epoch = 0 ); 00108 00112 size_t getRows( ) const { return _rows; } 00113 00117 size_t getCols( ) const { return _cols; } 00118 00122 size_t getEpochs( ) const { return _epochs; } 00123 00125 private: 00126 inline size_t locate(size_t row, size_t col, size_t epoch) const; 00127 void resize( size_t rows, size_t cols, size_t epochs ); 00128 00129 00132 private: 00136 float* _data; 00140 size_t _epochs; 00144 size_t _rows; 00148 size_t _cols; 00149 00153 Property* _parent; 00154 00155 }; 00156 00157 } 00158 } 00159 00160 #endif // NODE_H 00161