dataProxy.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef EQNBODY_DATAPROXY_H
00019 #define EQNBODY_DATAPROXY_H
00020
00021 #include <eq/eq.h>
00022
00023 namespace eqNbody
00024 {
00025 class DataProxy : public eq::Object
00026 {
00027 public:
00028
00029 DataProxy();
00030
00031 void init(const unsigned int offset, const unsigned int numBytes, float *pos, float *vel, float *col);
00032 void init(float *pos, float *vel, float *col);
00033 void exit();
00034
00035 void markDirty();
00036
00037 unsigned int getOffset() const {return _offset;}
00038 unsigned int getNumBytes() const {return _numBytes;}
00039
00040 float* getPosition() const {return _hPos;}
00041 float* getVelocity() const {return _hVel;}
00042
00043 protected:
00044 virtual void serialize( eq::net::DataOStream& os, const uint64_t dirtyBits );
00045 virtual void deserialize( eq::net::DataIStream& is, const uint64_t dirtyBits );
00046
00047 enum DirtyBits
00048 {
00049 DIRTY_DATA = eq::Object::DIRTY_CUSTOM << 0
00050 };
00051
00052 private:
00053 unsigned int _offset;
00054 unsigned int _numBytes;
00055
00056 float* _hPos;
00057 float* _hVel;
00058 float* _hCol;
00059 };
00060 }
00061
00062
00063 #endif // EQNBODY_DATAPROXY_H
00064