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); |
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); |
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); |
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 { |
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 |
} |
} |
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++; |
151 |
} |
} |
152 |
return _pbr; |
return _pbr; |
153 |
} |
} |
154 |
|
|