00001 #ifndef BspGetReply_HPP 00002 #define BspGetReply_HPP 00003 00010 class BspGetReply{ 00011 00012 private: 00013 00014 int nBytes_; 00015 int superstep_; 00018 void * dst_; 00019 vector<unsigned char> memArea_; 00023 public: 00024 00028 BspGetReply & dst(void * aDst){ 00029 dst_ = aDst; 00030 return (*this); 00031 } 00032 00033 00037 BspGetReply & nBytes(const int & aNBytes){ 00038 nBytes_ = aNBytes; 00039 return (*this); 00040 } 00041 00045 BspGetReply & superstep(const int & aSuperstep){ 00046 superstep_ = aSuperstep; 00047 return (*this); 00048 } 00049 00050 //Getters--------------------------------------------------------------------- 00051 00055 void * dst() const{return dst_;} 00056 00060 int nBytes() const{ return nBytes_; } 00061 00065 int superstep() const{ return superstep_; } 00066 00070 const unsigned char * memArea() const{ return &memArea_[0]; } 00071 00072 //Other Methods--------------------------------------------------------------- 00073 00081 void writeInMem(const void * src){ 00082 00083 assert(nBytes_ >= 0); 00084 memArea_.resize(nBytes_); 00085 memcpy(&memArea_[0], src, nBytes_); 00086 00087 } 00088 00089 00096 void dump (bool dumpMem) const{ 00097 00098 cerr << "dst: " << dst_ << endl 00099 << "nBytes: " << nBytes_ << endl 00100 << "superstep: " << superstep_ << endl 00101 << "memArea: "; 00102 if (dumpMem){ 00103 for(int i = 0; i < nBytes_; i++){ 00104 cerr << (int) memArea_[i]; 00105 cerr << " * "; 00106 } 00107 cerr << endl; 00108 } 00109 } 00110 00111 };//class 00112 00113 #endif//BspGetReply_HPP