operators for floating point types
This commit is contained in:
parent
42ca307c4d
commit
45a8c673f0
|
@ -273,6 +273,54 @@ bufferstream& bufferstream::operator<< (const uint64_t& val)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief bufferstream::operator >>
|
||||
* @param val
|
||||
* @return
|
||||
*/
|
||||
bufferstream& bufferstream::operator>> (float& val)
|
||||
{
|
||||
val = readType<float>();
|
||||
return *this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief bufferstream::operator >>
|
||||
* @param val
|
||||
* @return
|
||||
*/
|
||||
bufferstream& bufferstream::operator>> (double& val)
|
||||
{
|
||||
val = readType<double>();
|
||||
return *this;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief bufferstream::operator <<
|
||||
* @param val
|
||||
* @return
|
||||
*/
|
||||
bufferstream& bufferstream::operator<< (const float& val)
|
||||
{
|
||||
writeType<float>(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief bufferstream::operator <<
|
||||
* @param val
|
||||
* @return
|
||||
*/
|
||||
bufferstream& bufferstream::operator<< (const double& val)
|
||||
{
|
||||
writeType<double>(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief bufferstream::operator >>
|
||||
* @param obj
|
||||
|
|
|
@ -74,6 +74,12 @@ public:
|
|||
bufferstream& operator<< (const int32_t& val);
|
||||
bufferstream& operator<< (const int64_t& val);
|
||||
|
||||
// floating point
|
||||
bufferstream& operator>> (float& val);
|
||||
bufferstream& operator>> (double& val);
|
||||
bufferstream& operator<< (const float& val);
|
||||
bufferstream& operator<< (const double& val);
|
||||
|
||||
// stream objects
|
||||
bufferstream& operator>> (streamable& obj);
|
||||
bufferstream& operator<< (const streamable& obj);
|
||||
|
|
Loading…
Reference in New Issue