vega
unique_identifier_manipulator.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "vega/uid.h"
5 
6 namespace vega {
7  namespace manipulators {
9  private:
10  UID m_uid;
11 
12  public:
14  explicit UniqueIdentifierManipulator(std::shared_ptr<dicom::RawValue> raw_value);
15  explicit UniqueIdentifierManipulator(const std::string& str);
16  explicit UniqueIdentifierManipulator(const UID& uid);
17 
18  UID& uid();
19  const UID& uid() const;
20 
21  std::shared_ptr<dicom::RawValue> raw_value() override;
22  std::string str() const override;
23  bool read_from(dicom::RawReader* reader, size_t num_bytes) override;
24  size_t write_to(dicom::RawWriter* writer) const override;
25 
26  virtual bool is_valid_for(const VR& vr) const override {
27  return vr == vr::UI;
28  }
29 
30  private:
31  static UID uid_from_raw_value(const std::shared_ptr<dicom::RawValue>& raw_value);
32  };
33  }
34 
35  namespace vr {
36  template <>
37  bool manipulator_is_valid_for<manipulators::UniqueIdentifierManipulator>(VR::value_type value);
38  }
39 }
Definition: uid.h:6
Definition: vr.h:13
Definition: unique_identifier_manipulator.h:8
uint16_t value_type
Definition: vr.h:29
Definition: value_manipulator.h:29
const VR UI
Definition: vr_constants.h:379
bool read_from(dicom::RawReader *reader, size_t num_bytes) override
size_t write_to(dicom::RawWriter *writer) const override
std::shared_ptr< dicom::RawValue > raw_value() override
Definition: age.h:6
virtual bool is_valid_for(const VR &vr) const override
Definition: unique_identifier_manipulator.h:26