6 #ifndef LOFAR_BLOB_BLOBOSTREAM_H
7 #define LOFAR_BLOB_BLOBOSTREAM_H
54 uint64_t
size()
const {
return itsCurLength; }
72 unsigned int putStart(
int objectVersion);
73 unsigned int putStart(
const std::string& objectType,
int objectVersion);
74 unsigned int putStart(
const char* objectType,
int objectVersion);
105 void put(
const bool* values, uint64_t nrval);
106 void put(
const char* values, uint64_t nrval);
107 void put(
const int8_t* values, uint64_t nrval);
108 void put(
const uint8_t* values, uint64_t nrval);
109 void put(
const int16_t* values, uint64_t nrval);
110 void put(
const uint16_t* values, uint64_t nrval);
111 void put(
const int32_t* values, uint64_t nrval);
112 void put(
const uint32_t* values, uint64_t nrval);
113 void put(
const int64_t* values, uint64_t nrval);
114 void put(
const uint64_t* values, uint64_t nrval);
115 void put(
const float* values, uint64_t nrval);
116 void put(
const double* values, uint64_t nrval);
117 void put(
const std::complex<float>* values, uint64_t nrval);
118 void put(
const std::complex<double>* values, uint64_t nrval);
119 void put(
const std::string* values, uint64_t nrval);
125 void put(
const std::vector<bool>& values);
127 void put(
const std::vector<T>& values);
154 unsigned int doPutStart(
const char* objectType,
unsigned int nrc,
159 void putBuf(
const void* buf, uint64_t sz);
163 void checkPut()
const;
164 void throwPut()
const;
168 uint64_t itsCurLength;
169 unsigned int itsLevel;
171 std::stack<uint64_t> itsObjLen;
173 std::stack<int64_t> itsObjPtr;
186 return doPutStart(
"", 0, objectVersion);
191 return doPutStart(objectType.data(), objectType.size(), objectVersion);
196 return doPutStart(objectType, strlen(objectType), objectVersion);
204 put(&vec[0], vec.size());
211 inline void BlobOStream::checkPut()
const {
212 if (itsLevel == 0) throwPut();
Abstract base class for output buffer for a blob.
Definition: BlobOBuffer.h:32
virtual int64_t tellPos() const =0
Output stream for a blob.
Definition: BlobOStream.h:40
BlobOStream & operator<<(const int16_t &value)
void put(const uint8_t *values, uint64_t nrval)
BlobOStream & operator<<(const uint8_t &value)
BlobOStream & operator<<(const std::complex< float > &value)
void put(const bool *values, uint64_t nrval)
unsigned int align(unsigned int n)
void put(const float *values, uint64_t nrval)
BlobOStream & operator<<(const uint32_t &value)
BlobOStream(BlobOBuffer &)
void put(const char *values, uint64_t nrval)
BlobOStream & operator<<(const int32_t &value)
BlobOStream & operator<<(const char *value)
BlobOStream & operator<<(const float &value)
void put(const uint64_t *values, uint64_t nrval)
uint64_t size() const
Get the total size.
Definition: BlobOStream.h:54
unsigned int putStart(int objectVersion)
Definition: BlobOStream.h:185
BlobOStream & operator<<(const int64_t &value)
BlobOStream & operator<<(const char &value)
void put(const uint16_t *values, uint64_t nrval)
BlobOStream & operator<<(const uint16_t &value)
void put(const int8_t *values, uint64_t nrval)
BlobOStream & operator<<(const uint64_t &value)
void putBoolVec(const std::vector< bool > &values)
Put a vector of bools (without putting the size).
void put(const uint32_t *values, uint64_t nrval)
BlobOStream & operator<<(const std::string &value)
BlobOStream & operator<<(const bool &value)
int64_t setSpace(uint64_t nbytes)
BlobOStream & operator<<(const int8_t &value)
void put(const std::complex< double > *values, uint64_t nrval)
void put(const std::string *values, uint64_t nrval)
void put(const std::complex< float > *values, uint64_t nrval)
~BlobOStream()
Destructor.
void put(const double *values, uint64_t nrval)
void clear()
Clear the object. I.e., reset the current level and length.
Definition: BlobOStream.h:180
void put(const int64_t *values, uint64_t nrval)
void put(const int16_t *values, uint64_t nrval)
void put(const int32_t *values, uint64_t nrval)
int64_t tellPos() const
Definition: BlobOStream.h:199
BlobOStream & operator<<(const double &value)
BlobOStream & operator<<(const std::complex< double > &value)
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53