9 namespace manipulators {
23 if (raw_value->size() %
sizeof(T) != 0)
throw vega::Exception(
"Incompatible size for FixedSizeElementManipulator");
26 reinterpret_cast<const T * const>(&*raw_value->begin()),
27 reinterpret_cast<const T * const>(&*raw_value->end()),
28 std::back_inserter(*
this)
34 return std::make_shared<dicom::RawValue>(
35 reinterpret_cast<const char * const
>(&*this->begin()),
36 reinterpret_cast<const char * const>(&*this->end())
44 for (
size_t i = 0; i < this->size(); ++i) {
45 ss << vega::to_string<T>((*this)[i]);
46 if (i < this->size()-1) {
58 if (num_bytes %
sizeof(T) != 0)
throw vega::Exception(
"Incompatible num_bytes for FixedSizeElementManipulator");
60 for (
size_t i = 0; i < num_bytes; i +=
sizeof(T)) {
62 if (!reader->read_into(&this->back()))
return false;
70 return writer->write_from(this->begin(), this->end());
76 if (!other_ptr)
return false;
78 if (this->size() != other_ptr->size())
return false;
79 return std::equal(this->begin(), this->end(), other_ptr->begin());
84 return !(*
this == other);
The base class for exceptions that are raised by the vega library.
Definition: vega.h:11
base_vector::const_iterator const_iterator
Definition: fixed_size_element_manipulator.h:28
Definition: value_manipulator.h:29
FixedSizeElementManipulator()
Definition: fixed_size_element_manipulator_impl.h:16
virtual std::string str() const override
Definition: fixed_size_element_manipulator_impl.h:41
A manipulator class for VR that represent fixed size elements like integers and floating point number...
Definition: fixed_size_element_manipulator.h:20