47 #ifndef _MIRA_HASH_STREAM_H_ 48 #define _MIRA_HASH_STREAM_H_ 66 public std::vector<uint8>
74 std::vector<uint8>(iLength) {}
94 public std::basic_streambuf<char, std::char_traits<char> >
100 virtual void reset() = 0;
170 virtual void reset() { mBuffer.reset(); }
181 write(value, strlen(value));
187 write(value.c_str(), value.size());
193 write((
char*)&value,
sizeof(
bool));
199 write(&value,
sizeof(
char));
205 write((
char*)&value,
sizeof(uint8));
211 write((
char*)&value,
sizeof(uint16));
217 write((
char*)&value,
sizeof(uint32));
223 write((
char*)&value,
sizeof(uint64));
229 write((
char*)&value,
sizeof(int8));
235 write((
char*)&value,
sizeof(int16));
241 write((
char*)&value,
sizeof(int32));
247 write((
char*)&value,
sizeof(int64));
253 write((
char*)&value,
sizeof(
float));
259 write((
char*)&value,
sizeof(
double));
HashStream & operator<<(const std::string &value)
Put a STL string in the hash stream.
Definition: HashStream.h:186
HashDigest getDigest() const
Return the current digest of the hash algorithm.
Definition: HashStream.h:176
A generic hash streambuf class.
Definition: HashStream.h:93
Typedefs for OS independent basic data types.
HashStream & operator<<(const char *value)
Put a C-string in the hash stream.
Definition: HashStream.h:180
HashStream & operator<<(const uint32 &value)
Put a uint32 in the hash stream.
Definition: HashStream.h:216
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
HashStream & operator<<(const char &value)
Put a char in the hash stream.
Definition: HashStream.h:198
HashStream & operator<<(const uint64 &value)
Put a uint64 in the hash stream.
Definition: HashStream.h:222
virtual void reset()=0
Reset the hash value.
virtual void reset()
Reset the hash value.
Definition: HashStream.h:170
std::string toString(const T &value, int precision=-1)
Converts any data type to string (the data type must support the stream << operator).
Definition: ToString.h:256
HashStream & operator<<(const int16 &value)
Put a int16 in the hash stream.
Definition: HashStream.h:234
HashStream & operator<<(const int64 &value)
Put a int64 in the hash stream.
Definition: HashStream.h:246
A generic hash digest, which consists of an array of bytes.
Definition: HashStream.h:65
HashStream & operator<<(const double &value)
Put a double in the hash stream.
Definition: HashStream.h:258
MIRA_BASE_EXPORT void write(const Value &value, std::ostream &ioStream, bool formatted=false, int precision=-1)
Writes a json::Value into a given stream using the JSON format.
HashStream & operator<<(const int32 &value)
Put a int32 in the hash stream.
Definition: HashStream.h:240
HashStream & operator<<(const float &value)
Put a float in the hash stream.
Definition: HashStream.h:252
HashStream & operator<<(const uint8 &value)
Put a uint8 in the hash stream.
Definition: HashStream.h:204
virtual HashDigest getDigest() const =0
Return the current digest of the hash algorithm.
HashStream & operator<<(const uint16 &value)
Put a uint16 in the hash stream.
Definition: HashStream.h:210
virtual ~HashStream()
The destructor.
Definition: HashStream.h:165
HashStream & operator<<(const int8 &value)
Put a int8 in the hash stream.
Definition: HashStream.h:228
HashStream()
Th default constructor.
Definition: HashStream.h:162
HashDigest(size_t iLength=0)
Constructor.
Definition: HashStream.h:73
HashStream & operator<<(const bool &value)
Put a bool in the hash stream.
Definition: HashStream.h:192
A template base class for hash functions based on std::ostream.
Definition: HashStream.h:157