/usr/include/odil/Element.h is in libodil0-dev 0.7.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | /*************************************************************************
* odil - Copyright (C) Universite de Strasbourg
* Distributed under the terms of the CeCILL-B license, as published by
* the CEA-CNRS-INRIA. Refer to the LICENSE file or to
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
* for details.
************************************************************************/
#ifndef _9c3d8f32_0310_4e3a_b5d2_6d69f229a2cf
#define _9c3d8f32_0310_4e3a_b5d2_6d69f229a2cf
#include <cstddef>
#include <initializer_list>
#include "odil/Tag.h"
#include "odil/Value.h"
#include "odil/VR.h"
namespace odil
{
/**
* @brief Element of a DICOM data set.
*/
class Element
{
public:
/// @brief VR of the element.
VR vr;
/// @brief Constructor.
Element(Value const & value=Value(), VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(Value::Integers const & value, VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(Value::Reals const & value, VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(Value::Strings const & value, VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(Value::DataSets const & value, VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(Value::Binary const & value, VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(
std::initializer_list<int> const & value, VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(
std::initializer_list<Value::Integer> const & value,
VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(
std::initializer_list<Value::Real> const & value,
VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(
std::initializer_list<Value::String> const & value,
VR const & vr=VR::INVALID);
/// @brief Constructor.
Element(
std::initializer_list<DataSet> const & value,
VR const & vr=VR::INVALID);
/// @brief Test whether the element is empty.
bool empty() const;
/// @brief Return the number of items in the value.
std::size_t size() const;
/// @brief Return the raw value.
Value const & get_value() const;
/// @brief Test whether the value contains integers.
bool is_int() const;
/**
* @brief Return the integers contained in the element.
*
* If the element does not contain integers, a odil::Exception is raised.
*/
Value::Integers const & as_int() const;
/**
* @brief Return the integers contained in the element.
*
* If the element does not contain integers, a odil::Exception is raised.
*/
Value::Integers & as_int();
/// @brief Test whether the value contains reals.
bool is_real() const;
/**
* @brief Return the reals contained in the element.
*
* If the element does not contain reals, a odil::Exception is raised.
*/
Value::Reals const & as_real() const;
/**
* @brief Return the reals contained in the element.
*
* If the element does not contain reals, a odil::Exception is raised.
*/
Value::Reals & as_real();
/// @brief Test whether the value contains strings.
bool is_string() const;
/**
* @brief Return the strings contained in the element.
*
* If the element does not contain strings, a odil::Exception is raised.
*/
Value::Strings const & as_string() const;
/**
* @brief Return the strings contained in the element.
*
* If the element does not contain strings, a odil::Exception is raised.
*/
Value::Strings & as_string();
/// @brief Test whether the value contains data sets.
bool is_data_set() const;
/**
* @brief Return the data sets contained in the element.
*
* If the element does not contain data sets, a odil::Exception is raised.
*/
Value::DataSets const & as_data_set() const;
/**
* @brief Return the data sets contained in the element.
*
* If the element does not contain data sets, a odil::Exception is raised.
*/
Value::DataSets & as_data_set();
/// @brief Test whether the value contains data sets.
bool is_binary() const;
/**
* @brief Return the binary data contained in the element.
*
* If the element does not contain binary data, a odil::Exception is raised.
*/
Value::Binary const & as_binary() const;
/**
* @brief Return the binary data contained in the element.
*
* If the element does not contain binary data, a odil::Exception is raised.
*/
Value::Binary & as_binary();
/// @brief Equality test
bool operator==(Element const & other) const;
/// @brief Difference test
bool operator!=(Element const & other) const;
private:
struct Empty
{
typedef bool result_type;
template<typename T>
bool operator()(T const & container) const
{
return container.empty();
}
};
struct Size
{
typedef std::size_t result_type;
template<typename T>
std::size_t operator()(T const & container) const
{
return container.size();
}
};
Value _value;
};
/**
* @brief Visitor of elements.
*/
template<typename TVisitor>
typename TVisitor::result_type
apply_visitor(TVisitor const & visitor, Element const & element);
}
#include "odil/Element.txx"
#endif // _9c3d8f32_0310_4e3a_b5d2_6d69f229a2cf
|