/[PAMELA software]/gp2root/pBlockPointer.cpp
ViewVC logotype

Diff of /gp2root/pBlockPointer.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by pamela, Wed Apr 19 23:35:58 2006 UTC revision 1.2 by cafagna, Sun Oct 22 08:26:37 2006 UTC
# Line 37  char* pBlockPointer::CreatePbuf() { Line 37  char* pBlockPointer::CreatePbuf() {
37  // Returns the size, in Byte, of the buffer  // Returns the size, in Byte, of the buffer
38  int pBlockPointer::TotBufSize(){    int pBlockPointer::TotBufSize(){  
39    int temp=0;    int temp=0;
40    for (int i=0; i< _pblockmap.size(); temp+=_pblockmap[i++].nbyte);    for (unsigned int i=0; i< _pblockmap.size(); temp+=_pblockmap[i++].nbyte);
41    return temp;    return temp;
42  }    }  
43    
44  // Does count the number of bytes associated with the block s  // Does count the number of bytes associated with the block s
45  int& pBlockPointer::CountByte(const std::string& s)  int& pBlockPointer::CountByte(const std::string& s)
46  {  {
47    for (int i=0; i< _pblockmap.size(); i++)    for (unsigned int i=0; i< _pblockmap.size(); i++)
48      if( s== _pblockmap[i].name) return _pblockmap[i].nbyte;      if( s== _pblockmap[i].name) return _pblockmap[i].nbyte;
49        
50    pBlockDesc p(s, 0, 0);    pBlockDesc p(s, 0, 0);
# Line 56  int& pBlockPointer::CountByte(const std: Line 56  int& pBlockPointer::CountByte(const std:
56  // Does count the number of bytes associated with the block s  // Does count the number of bytes associated with the block s
57  int& pBlockPointer::CountVar(const std::string& s)  int& pBlockPointer::CountVar(const std::string& s)
58  {  {
59    for (int i=0; i< _pblockmap.size(); i++)    for (unsigned int i=0; i< _pblockmap.size(); i++)
60      if( s== _pblockmap[i].name) return _pblockmap[i].nvar;      if( s== _pblockmap[i].name) return _pblockmap[i].nvar;
61        
62    pBlockDesc p(s, 0, 0);    pBlockDesc p(s, 0, 0);
# Line 67  int& pBlockPointer::CountVar(const std:: Line 67  int& pBlockPointer::CountVar(const std::
67  // Does count the number of bytes associated with the block s  // Does count the number of bytes associated with the block s
68  int& pBlockPointer::SetMult(const std::string& s)  int& pBlockPointer::SetMult(const std::string& s)
69  {  {
70    for (int i=0; i< _pblockmap.size(); i++)    for (unsigned int i=0; i< _pblockmap.size(); i++)
71      if( s== _pblockmap[i].name) return _pblockmap[i].nmult;      if( s== _pblockmap[i].name) return _pblockmap[i].nmult;
72        
73    pBlockDesc p(s, 0, 0);    pBlockDesc p(s, 0, 0);
# Line 80  int& pBlockPointer::SetMult(const std::s Line 80  int& pBlockPointer::SetMult(const std::s
80  int pBlockPointer::BlockInd(const std::string& s)  int pBlockPointer::BlockInd(const std::string& s)
81  {  {
82    int temp=0;    int temp=0;
83    for (int i=0; i< _pblockmap.size(); ++i) {    for (unsigned int i=0; i< _pblockmap.size(); ++i) {
84      if( s== _pblockmap[i].name) {      if( s== _pblockmap[i].name) {
85        break;        break;
86      } else {      } else {
# Line 92  int pBlockPointer::BlockInd(const std::s Line 92  int pBlockPointer::BlockInd(const std::s
92    
93  pBlockDesc* pBlockPointer::GetBlockDesc(const std::string& s)  pBlockDesc* pBlockPointer::GetBlockDesc(const std::string& s)
94  {  {
95    for (int i=0; i< _pblockmap.size(); ++i) {    for (unsigned int i=0; i< _pblockmap.size(); ++i) {
96      if( s== _pblockmap[i].name) {      if( s== _pblockmap[i].name) {
97        return &_pblockmap[i];        return &_pblockmap[i];
98      }      }
# Line 121  char * pBlockPointer::BuffReorder(){ Line 121  char * pBlockPointer::BuffReorder(){
121    char* junk;    char* junk;
122  //   for (pBlockMap::const_iterator p=_pblockmap.begin();  //   for (pBlockMap::const_iterator p=_pblockmap.begin();
123  //        p!=_pblockmap.end(); ++p)  //        p!=_pblockmap.end(); ++p)
124    for (int i=0; i<_pblockmap.size(); ++i)    for (unsigned int i=0; i<_pblockmap.size(); ++i)
125      {      {
126        if(_pblockmap[i].nmult==1){        if(_pblockmap[i].nmult==1){
127          for(int j=0;j<_pblockmap[i].nbyte;++j) *tempr++=*temp++;          for(int j=0;j<_pblockmap[i].nbyte;++j) *tempr++=*temp++;
# Line 151  char * pBlockPointer::BuffReorder(){ Line 151  char * pBlockPointer::BuffReorder(){
151      }      }
152    return _pbr;    return _pbr;
153  }  }
154    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23