Odil
A C++11 library for the DICOM standard
|
Go to the documentation of this file.
9 #ifndef _dcfa5213_ad7e_4194_8b4b_e630aa0df2e8
10 #define _dcfa5213_ad7e_4194_8b4b_e630aa0df2e8
23 #define ODIL_MESSAGE_MANDATORY_FIELD_MACRO(name, tag, TValueType, function) \
25 TValueType const & get_##name() const \
27 auto const & data = this->_command_set->function(tag); \
30 throw Exception("Empty element"); \
35 void set_##name(TValueType const & value) \
37 if(!this->_command_set->has(tag)) \
39 this->_command_set->add(tag); \
41 this->_command_set->function(tag) = { value }; \
44 #define ODIL_MESSAGE_OPTIONAL_FIELD_MACRO(name, tag, TValueType, function) \
45 ODIL_MESSAGE_MANDATORY_FIELD_MACRO(name, tag, TValueType, function) \
46 bool has_##name() const \
48 return this->_command_set->has(tag);; \
50 void delete_##name() \
52 this->_command_set->remove(tag); \
55 #define ODIL_MESSAGE_SET_OPTIONAL_FIELD_MACRO(dataset, name, tag, function) \
56 if(dataset->has(tag)) \
58 this->set_##name(dataset->function(tag, 0)); \
61 #define ODIL_MESSAGE_MANDATORY_FIELD_INTEGER_MACRO(name, tag) \
62 ODIL_MESSAGE_MANDATORY_FIELD_MACRO(name, tag, Value::Integer, as_int)
64 #define ODIL_MESSAGE_MANDATORY_FIELD_STRING_MACRO(name, tag) \
65 ODIL_MESSAGE_MANDATORY_FIELD_MACRO(name, tag, Value::String, as_string)
67 #define ODIL_MESSAGE_OPTIONAL_FIELD_INTEGER_MACRO(name, tag) \
68 ODIL_MESSAGE_OPTIONAL_FIELD_MACRO(name, tag, Value::Integer, as_int)
70 #define ODIL_MESSAGE_OPTIONAL_FIELD_STRING_MACRO(name, tag) \
71 ODIL_MESSAGE_OPTIONAL_FIELD_MACRO(name, tag, Value::String, as_string)
98 N_EVENT_REPORT_RQ = 0x0100,
99 N_EVENT_REPORT_RSP = 0x8100,
107 N_ACTION_RQ = 0x0130,
108 N_ACTION_RSP = 0x8130,
110 N_CREATE_RQ = 0x0140,
111 N_CREATE_RSP = 0x8140,
113 N_DELETE_RQ = 0x0150,
114 N_DELETE_RSP = 0x8150,
132 std::shared_ptr<DataSet> command_set=std::make_shared<DataSet>(),
133 std::shared_ptr<DataSet> data_set={});
180 #endif // _dcfa5213_ad7e_4194_8b4b_e630aa0df2e8
Message & operator=(Message &&)=default
std::shared_ptr< DataSet > _command_set
Command set of the message.
Definition: Message.h:170
std::shared_ptr< DataSet const > get_command_set() const
Return the command set of the message (by reference or shared pointer).
void set_data_set(std::shared_ptr< DataSet > data_set)
Set the data set of the message.
Priority
Definition: Message.h:118
Message & operator=(Message const &)=default
Tag const CommandField(0x0000, 0x0100)
Message(Message &&)=default
virtual ~Message()=default
Definition: Association.h:25
#define ODIL_API
Definition: odil.h:28
bool has_data_set() const
Test whether as data set is present in the message.
DataSetType
Definition: Message.h:125
Message(Message const &)=default
Command
Definition: Message.h:80
void delete_data_set()
Delete the data set in this message.
std::shared_ptr< DataSet > _data_set
Data set of the message.
Definition: Message.h:173
Message(std::shared_ptr< DataSet > command_set=std::make_shared< DataSet >(), std::shared_ptr< DataSet > data_set={})
Create a message with an empty command set and no data set.
std::shared_ptr< DataSet const > get_data_set() const
Return the data set of the message, raise an exception if no data set is present.
#define ODIL_MESSAGE_MANDATORY_FIELD_INTEGER_MACRO(name, tag)
Definition: Message.h:61
std::shared_ptr< DataSet > get_data_set()
Return the data set of the message, raise an exception if no data set is present.
Base class for all DIMSE messages.
Definition: Message.h:77