Class to store comments in BLOB without any data.
More...
#include <TileCalibDrawerCmt.h>
|
| virtual | ~TileCalibDrawerCmt () |
| | Dtor.
|
| virtual uint16_t | getType () const |
| | Returns TileCalibType::CMT.
|
| void | init (const std::string &author, const std::string &comment="", uint64_t timeStamp=0) |
| | Initializing a TileCalibDrawerCmt.
|
| virtual void | dump () const |
| | Print the header to std::cout.
|
| virtual void | dump (std::ostream &stm) const |
| | Print the header.
|
| virtual void | clone (const TileCalibDrawerBase &other) |
| | Initialzes Blob with content of other Blob.
|
| long | getBlobSize () const |
| | Returns the BLOB size in units of bytes.
|
| long | getBlobSize32 () const |
| | Returns the BLOB size in units of uint32_t.
|
| uint16_t | getObjType () const |
| | Returns the BLOB object type.
|
| uint16_t | getObjVersion () const |
| | Returns the BLOB object version.
|
| uint32_t | getObjSizeUint32 () const |
| | Returns the size of a data object in units of uint32_t.
|
| uint32_t | getObjSizeByte () const |
| | Returns the size of a data object in units of bytes.
|
| uint32_t | getNObjs () const |
| | Returns the number of data objects stored int the BLOB.
|
| uint16_t | getNChans () const |
| | Returns the number of channels stored in the BLOB.
|
| uint16_t | getNGains () const |
| | Returns the number of gains stored for each channel.
|
| uint32_t | getCommentSizeUint32 () const |
| | Returns the space occupied by the comment fields in units of uint32_t.
|
| uint32_t | getCommentSizeChar () const |
| | Returns the space occupied by the comment fields in units of chars.
|
| std::string | getAuthor () const |
| | Returns the comment author.
|
| std::string | getComment () const |
| | Returns the actual comment.
|
| uint64_t | getTimeStamp () const |
| | Returns the unix timestamp of the comment (seconds since 1.1.1970)
|
| std::string | getDate () const |
| | Returns the date of the comment as string (derived from timestamp)
|
| std::string | getFullComment () const |
| | Returns a formated string build from all comment fields.
|
| const void * | getAddress (unsigned int iEle) const |
| | Returns start address of iEle-th basic unit.
|
| void * | getAddress (unsigned int iEle) |
|
| static const unsigned int | m_hdrSize32 = 5 |
| | The header size in units of uint32_t.
|
|
| | TileCalibDrawerCmt (const coral::Blob &blob) |
| | Ctor used when interpreting an already existing BLOB.
|
| | TileCalibDrawerCmt (coral::Blob &blob) |
| | Ctor (non-const).
|
| uint32_t | createBlob (uint16_t objType, uint16_t objVersion, uint32_t objSizeUint32, uint32_t nObjs, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0) |
| | (re-)creation of the referenced BLOB object.
|
| void | dumpHeader (std::ostream &stm) const |
| | Prints the BLOB header summary information.
|
|
| coral::Blob * | m_blob_nc |
| | Non-const reference to the BLOB.
|
| const coral::Blob * | m_blob |
| | Const reference to the BLOB (always there)
|
| const uint32_t * | m_blobStart32 |
| | Cache blob starting address as uint_32t*.
|
| const uint16_t * | m_blobStart16 |
| | Cache blob starting address as uint_16t*.
|
| uint64_t | m_blobSize32 |
| | Cache blob size in units of uint32_t.
|
| bool | m_isBlobOwner |
| | Is this TileCalibDrawer owner of the BLOB.
|
Class to store comments in BLOB without any data.
- Author
- Nils Gollub nils..nosp@m.goll.nosp@m.ub@ce.nosp@m.rn.c.nosp@m.h
This is a specialesed TileCalibDrawer class that holds only the comment fields but no calibration data. It should only be stored in the COOL comment channel (see TileCalibUtils class).
Definition at line 20 of file TileCalibDrawerCmt.h.
◆ ~TileCalibDrawerCmt()
| virtual TileCalibDrawerCmt::~TileCalibDrawerCmt |
( |
| ) |
|
|
inlinevirtual |
◆ TileCalibDrawerCmt() [1/2]
| TileCalibDrawerCmt::TileCalibDrawerCmt |
( |
const coral::Blob & | blob | ) |
|
|
protected |
Ctor used when interpreting an already existing BLOB.
- Parameters
-
| blob | A const reference to the coral::Blob to interpret. |
Definition at line 35 of file TileCalibDrawerCmt.cxx.
38{
39
40}
TileCalibDrawerBase(const TileCalibDrawerBase &other)
Copy Ctor.
◆ TileCalibDrawerCmt() [2/2]
| TileCalibDrawerCmt::TileCalibDrawerCmt |
( |
coral::Blob & | blob | ) |
|
|
protected |
◆ clone()
Initialzes Blob with content of other Blob.
- Parameters
-
| other | TileCalibDrawer used for initialization |
Definition at line 74 of file TileCalibDrawerBase.cxx.
75{
76
78
82}
uint64_t m_blobSize32
Cache blob size in units of uint32_t.
const uint32_t * m_blobStart32
Cache blob starting address as uint_32t*.
const coral::Blob * m_blob
Const reference to the BLOB (always there)
const uint16_t * m_blobStart16
Cache blob starting address as uint_16t*.
coral::Blob * m_blob_nc
Non-const reference to the BLOB.
◆ createBlob()
| uint32_t TileCalibDrawerBase::createBlob |
( |
uint16_t | objType, |
|
|
uint16_t | objVersion, |
|
|
uint32_t | objSizeUint32, |
|
|
uint32_t | nObjs, |
|
|
uint16_t | nChans, |
|
|
uint16_t | nGains, |
|
|
const std::string & | author = "", |
|
|
const std::string & | comment = "", |
|
|
uint64_t | timeStamp = 0 ) |
|
protectedinherited |
(re-)creation of the referenced BLOB object.
- Parameters
-
| objType | Object type |
| objVersion | Object version |
| objSizeUint32 | Size of a data object (in uint32_t) |
| nObjs | Total number of data objects |
| nChans | number of stored channels |
| nGains | number of stored gains |
| author | comment author |
| comment | actual comment |
| timeStamp | unix time stamp (if 0, current time is used) |
Definition at line 87 of file TileCalibDrawerBase.cxx.
96{
97
99
100
104
105 commentSizeChar += (commentSizeChar %
sizeof(
uint32_t)) ?
106 (sizeof(uint32_t)-(commentSizeChar % sizeof(uint32_t))) : 0;
107 }
108
109
110 uint32_t blobSizeInBytes = dataSizeByte+commentSizeChar;
115
118
119
120 blobStart16[0] = objType;
122 blobStart32[1] = objSizeUint32;
123 blobStart32[2] = nObjs;
124 blobStart16[6] = nChans;
125 blobStart16[7] = nGains;
126 blobStart32[4] = commentSizeChar/
sizeof(
uint32_t);
127
128
129 if(commentSizeChar){
133 char* pChar = reinterpret_cast<char*>(++pTimeStamp);
134 std::string::const_iterator iStr =
author.begin();
135 for(; iStr!=
author.end(); ++iStr){ *pChar = *iStr; ++pChar; }
136 *pChar = 0;
137 for(iStr=
comment.begin(); iStr!=
comment.end(); ++iStr){ *(++pChar) = *iStr; }
138 *(++pChar) = 0;
139 }
140
141 return (blobSizeInBytes/sizeof(uint32_t));
142}
static const unsigned int m_hdrSize32
The header size in units of uint32_t.
◆ dump() [1/2]
| virtual void TileCalibDrawerCmt::dump |
( |
| ) |
const |
|
inlinevirtual |
Print the header to std::cout.
Reimplemented from TileCalibDrawerBase.
Definition at line 48 of file TileCalibDrawerCmt.h.
void dumpHeader(std::ostream &stm) const
Prints the BLOB header summary information.
◆ dump() [2/2]
| virtual void TileCalibDrawerCmt::dump |
( |
std::ostream & | stm | ) |
const |
|
inlinevirtual |
◆ dumpHeader()
| void TileCalibDrawerBase::dumpHeader |
( |
std::ostream & | stm | ) |
const |
|
protectedinherited |
Prints the BLOB header summary information.
- Parameters
-
Definition at line 200 of file TileCalibDrawerBase.cxx.
201{
203 stm <<
"ObjType : " <<
getObjType() << std::endl;
206 stm <<
"NObjs : " <<
getNObjs() << std::endl;
207 stm <<
"NChannels : " <<
getNChans() << std::endl;
208 stm <<
"NGains : " <<
getNGains() << std::endl;
210 stm << "=== No comment available ===" << std::endl;
211 }
212 else{
213 stm <<
"Author : " <<
getAuthor() << std::endl;
215 stm <<
"Comment: : " <<
getComment() << std::endl;
216 }
217}
uint32_t getCommentSizeUint32() const
Returns the space occupied by the comment fields in units of uint32_t.
uint16_t getNChans() const
Returns the number of channels stored in the BLOB.
std::string getComment() const
Returns the actual comment.
uint16_t getObjType() const
Returns the BLOB object type.
uint16_t getNGains() const
Returns the number of gains stored for each channel.
uint64_t getTimeStamp() const
Returns the unix timestamp of the comment (seconds since 1.1.1970)
std::string getDate() const
Returns the date of the comment as string (derived from timestamp)
uint32_t getNObjs() const
Returns the number of data objects stored int the BLOB.
std::string getAuthor() const
Returns the comment author.
uint16_t getObjVersion() const
Returns the BLOB object version.
uint32_t getObjSizeByte() const
Returns the size of a data object in units of bytes.
static std::string getClassName(TileCalibType::TYPE type)
Returns the class name.
◆ getAddress() [1/2]
| void * TileCalibDrawerBase::getAddress |
( |
unsigned int | iEle | ) |
|
|
inherited |
◆ getAddress() [2/2]
| const void * TileCalibDrawerBase::getAddress |
( |
unsigned int | iEle | ) |
const |
|
inherited |
Returns start address of iEle-th basic unit.
- Parameters
-
| iEle | sequential basic unit number |
◆ getAuthor()
| std::string TileCalibDrawerBase::getAuthor |
( |
| ) |
const |
|
inherited |
Returns the comment author.
Definition at line 147 of file TileCalibDrawerBase.cxx.
148{
150 const char* iBeg =
154 return std::string(iBeg);
155}
uint32_t getObjSizeUint32() const
Returns the size of a data object in units of uint32_t.
◆ getBlobSize()
| long TileCalibDrawerBase::getBlobSize |
( |
| ) |
const |
|
inlineinherited |
◆ getBlobSize32()
| long TileCalibDrawerBase::getBlobSize32 |
( |
| ) |
const |
|
inlineinherited |
◆ getComment()
| std::string TileCalibDrawerBase::getComment |
( |
| ) |
const |
|
inherited |
Returns the actual comment.
Definition at line 161 of file TileCalibDrawerBase.cxx.
162{
164 const char* iBeg =
169 iBeg = std::find(iBeg,iEnd,0);
170 return std::string(++iBeg);
171}
uint32_t getCommentSizeChar() const
Returns the space occupied by the comment fields in units of chars.
◆ getCommentSizeChar()
| uint32_t TileCalibDrawerBase::getCommentSizeChar |
( |
| ) |
const |
|
inlineinherited |
Returns the space occupied by the comment fields in units of chars.
Definition at line 112 of file TileCalibDrawerBase.h.
◆ getCommentSizeUint32()
| uint32_t TileCalibDrawerBase::getCommentSizeUint32 |
( |
| ) |
const |
|
inherited |
Returns the space occupied by the comment fields in units of uint32_t.
◆ getDate()
| std::string TileCalibDrawerBase::getDate |
( |
| ) |
const |
|
inherited |
Returns the date of the comment as string (derived from timestamp)
Definition at line 176 of file TileCalibDrawerBase.cxx.
177{
181 char* iBeg = ::ctime_r(&timeStamp, buf);
182 char* iEnd = iBeg;
183 while(*iEnd!='\n'){++iEnd;}
184 return std::string(iBeg,iEnd-iBeg);
185}
◆ getFullComment()
| std::string TileCalibDrawerBase::getFullComment |
( |
| ) |
const |
|
inherited |
◆ getInstance() [1/2]
Returns a pointer to a const TileCalibDrawerCmt.
Definition at line 24 of file TileCalibDrawerCmt.cxx.
25{
26
28 throw TileCalib::InvalidBlob("TileCalibDrawerCmt::getInstance");
29 }
31}
TileCalibDrawerCmt(const coral::Blob &blob)
Ctor used when interpreting an already existing BLOB.
◆ getInstance() [2/2]
| TileCalibDrawerCmt * TileCalibDrawerCmt::getInstance |
( |
coral::Blob & | blob, |
|
|
const std::string & | author, |
|
|
const std::string & | comment = "", |
|
|
uint64_t | timeStamp = 0 ) |
|
static |
Returns a pointer to a non-const TileCalibDrawerCmt.
- Parameters
-
| blob | Reference to a coral::Blob |
| author | String containing the author user id |
| comment | String containing the actual comment |
| timeStamp | Unix time stamp (if 0, current time is used) |
Definition at line 11 of file TileCalibDrawerCmt.cxx.
◆ getNChans()
| uint16_t TileCalibDrawerBase::getNChans |
( |
| ) |
const |
|
inherited |
Returns the number of channels stored in the BLOB.
◆ getNGains()
| uint16_t TileCalibDrawerBase::getNGains |
( |
| ) |
const |
|
inherited |
Returns the number of gains stored for each channel.
◆ getNObjs()
| uint32_t TileCalibDrawerBase::getNObjs |
( |
| ) |
const |
|
inherited |
Returns the number of data objects stored int the BLOB.
◆ getObjSizeByte()
| uint32_t TileCalibDrawerBase::getObjSizeByte |
( |
| ) |
const |
|
inlineinherited |
◆ getObjSizeUint32()
| uint32_t TileCalibDrawerBase::getObjSizeUint32 |
( |
| ) |
const |
|
inherited |
Returns the size of a data object in units of uint32_t.
◆ getObjType()
| uint16_t TileCalibDrawerBase::getObjType |
( |
| ) |
const |
|
inherited |
Returns the BLOB object type.
◆ getObjVersion()
| uint16_t TileCalibDrawerBase::getObjVersion |
( |
| ) |
const |
|
inherited |
Returns the BLOB object version.
◆ getTimeStamp()
| uint64_t TileCalibDrawerBase::getTimeStamp |
( |
| ) |
const |
|
inherited |
Returns the unix timestamp of the comment (seconds since 1.1.1970)
◆ getType()
| virtual uint16_t TileCalibDrawerCmt::getType |
( |
| ) |
const |
|
inlinevirtual |
◆ init()
| void TileCalibDrawerCmt::init |
( |
const std::string & | author, |
|
|
const std::string & | comment = "", |
|
|
uint64_t | timeStamp = 0 ) |
Initializing a TileCalibDrawerCmt.
- Parameters
-
| author | String containing the author user id |
| comment | String containing the actual comment |
| timeStamp | Unix time stamp (if 0, current time is used) |
Definition at line 54 of file TileCalibDrawerCmt.cxx.
57{
59}
uint32_t createBlob(uint16_t objType, uint16_t objVersion, uint32_t objSizeUint32, uint32_t nObjs, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
(re-)creation of the referenced BLOB object.
◆ m_blob
| const coral::Blob* TileCalibDrawerBase::m_blob |
|
privateinherited |
◆ m_blob_nc
| coral::Blob* TileCalibDrawerBase::m_blob_nc |
|
privateinherited |
Non-const reference to the BLOB.
(Only present if we were created with a non-const blob.)
Definition at line 174 of file TileCalibDrawerBase.h.
◆ m_blobSize32
| uint64_t TileCalibDrawerBase::m_blobSize32 |
|
privateinherited |
◆ m_blobStart16
| const uint16_t* TileCalibDrawerBase::m_blobStart16 |
|
privateinherited |
◆ m_blobStart32
| const uint32_t* TileCalibDrawerBase::m_blobStart32 |
|
privateinherited |
◆ m_hdrSize32
| const unsigned int TileCalibDrawerBase::m_hdrSize32 = 5 |
|
staticinherited |
◆ m_isBlobOwner
| bool TileCalibDrawerBase::m_isBlobOwner |
|
privateinherited |
The documentation for this class was generated from the following files: