9#ifndef _dca5b15b_b8df_4925_a446_d42efe06c923
10#define _dca5b15b_b8df_4925_a446_d42efe06c923
13#include <initializer_list>
54 typedef std::vector<Real>
Reals;
60 typedef std::vector<std::shared_ptr<DataSet>>
DataSets;
63 typedef std::vector<std::vector<uint8_t>>
Binary;
65#define ODIL_VALUE_CONSTRUCTORS(type) \
66 Value(type const & value); \
67 Value(type && value); \
68 Value(std::initializer_list<type::value_type> const & value);
79#undef ODIL_VALUE_CONSTRUCTORS
81 Value(std::initializer_list<int>
const & value);
83 Value(std::initializer_list<std::initializer_list<uint8_t>>
const & value);
189 std::shared_ptr<DataSets> _data_sets;
209template<
typename TVisitor>
210typename TVisitor::result_type
216template<
typename TVisitor>
217typename TVisitor::result_type
222#include "odil/Value.txx"
#define ODIL_VALUE_CONSTRUCTORS(type)
Definition: Value.h:65
A value held in a DICOM element.
Definition: Value.h:29
std::vector< String > Strings
String container.
Definition: Value.h:57
int64_t Integer
Integer type.
Definition: Value.h:42
Binary & as_binary()
Return the binary data contained in the value.
bool empty() const
Test whether the value is empty.
void clear()
Clear the value (value.empty() will be true).
bool operator!=(Value const &other) const
Difference test.
std::vector< Integer > Integers
Integer container.
Definition: Value.h:51
std::vector< std::vector< uint8_t > > Binary
Binary data container.
Definition: Value.h:63
Integers const & as_integers() const
Return the integers contained in the value.
std::string String
String type.
Definition: Value.h:48
Type
Possible types stored in the value.
Definition: Value.h:33
std::vector< Real > Reals
Real container.
Definition: Value.h:54
Type get_type() const
Return the type store in the value.
Strings const & as_strings() const
Return the strings contained in the value.
Reals const & as_reals() const
Return the reals contained in the value.
Value(std::initializer_list< int > const &value)
DataSets const & as_data_sets() const
Return the data sets contained in the value.
std::vector< std::shared_ptr< DataSet > > DataSets
Data sets container.
Definition: Value.h:60
Integers & as_integers()
Return the integers contained in the value.
std::size_t size() const
Return the number of items.
double Real
Real type.
Definition: Value.h:45
Reals & as_reals()
Return the reals contained in the value.
DataSets & as_data_sets()
Return the data sets contained in the value.
Binary const & as_binary() const
Return the binary data contained in the value.
Strings & as_strings()
Return the strings contained in the value.
bool operator==(Value const &other) const
Equality test.
Value(std::initializer_list< std::initializer_list< uint8_t > > const &value)
Value(Value const &)=default
Value & operator=(Value &&)=default
Value & operator=(Value const &)=default
Definition: Association.h:25
bool operator!=(Value::DataSets const &left, Value::DataSets const &right)
Difference test.
TVisitor::result_type apply_visitor(TVisitor const &visitor, Element const &element)
Visitor of elements.
bool operator==(Value::DataSets const &left, Value::DataSets const &right)
Equality test.
#define ODIL_API
Definition: odil.h:28