Line | |
---|
1 | #ifndef _FROG_BaseColl_Name_H__
|
---|
2 | #define _FROG_BaseColl_Name_H__
|
---|
3 |
|
---|
4 | #include "BaseColl_Id.h"
|
---|
5 |
|
---|
6 | namespace FROG{
|
---|
7 |
|
---|
8 | class BaseColl_Name : public BaseColl_Id {
|
---|
9 | public :
|
---|
10 | virtual unsigned int chunkId(){ return 3000;}
|
---|
11 | virtual bool isCompactible(){ return false; }
|
---|
12 |
|
---|
13 | BaseColl_Name(){}
|
---|
14 | BaseColl_Name(unsigned int detId, const char* name, ...) :
|
---|
15 | BaseColl_Id(detId){
|
---|
16 | char FullName[512];
|
---|
17 | va_list args;
|
---|
18 | va_start(args,name);
|
---|
19 | vsprintf(FullName,name,args);
|
---|
20 | va_end(args);
|
---|
21 | NameLength_ = strlen(FullName);
|
---|
22 | Name_ = new char[NameLength_+1];
|
---|
23 | sprintf(Name_,"%s",FullName);
|
---|
24 | }
|
---|
25 | ~BaseColl_Name() {delete [] Name_;}
|
---|
26 |
|
---|
27 | virtual ByteBuffer writeData(){
|
---|
28 | ByteBuffer toReturn = ByteBuffer(6 + NameLength_);
|
---|
29 | toReturn.putUInt(detId_);
|
---|
30 | toReturn.putUShort((unsigned short)NameLength_);
|
---|
31 | for(int c=0;c<NameLength_;c++)toReturn.putByte(Name_[c]);
|
---|
32 | return toReturn;
|
---|
33 | }
|
---|
34 | };
|
---|
35 |
|
---|
36 | }//FROG Namespace
|
---|
37 | #endif
|
---|
38 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.