|
Odil
A C++11 library for the DICOM standard
|
A sequence of fields forming a full PDU or a part of it. More...
#include <Item.h>
Classes | |
| class | Field |
| Generic field. More... | |
Public Types | |
| typedef std::vector< std::pair< std::string, Field > > | Container |
| typedef Container::const_iterator | const_iterator |
Public Member Functions | |
| Item () | |
| Create an empty PDU item. More... | |
| Item (std::vector< std::pair< std::string, Field >> const &fields) | |
| Create an initialized PDU item. More... | |
| Item & | add (std::string const &name, Field const &field) |
| Add a new field to the PDU item. More... | |
| Container::size_type | size () const |
| Return the number of fields. More... | |
| bool | empty () const |
| Test whether the container is empty. More... | |
| bool | has_field (std::string const &name) const |
| Test whether the PDU item contains a field with a given name. More... | |
| Field const & | operator[] (std::string const &name) const |
| Return the named field. Raise an exception if no such field exists. More... | |
| Field & | operator[] (std::string const &name) |
| Return the named field. Raise an exception if no such field exists. More... | |
| uint8_t | as_unsigned_int_8 (std::string const &name) const |
| Return the named field as an uint8_t. More... | |
| uint8_t & | as_unsigned_int_8 (std::string const &name) |
| Return the named field as an uint8_t. More... | |
| uint16_t | as_unsigned_int_16 (std::string const &name) const |
| Return the named field as an uint16_t. More... | |
| uint16_t & | as_unsigned_int_16 (std::string const &name) |
| Return the named field as an uint16_t. More... | |
| uint32_t | as_unsigned_int_32 (std::string const &name) const |
| Return the named field as an uint32_t. More... | |
| uint32_t & | as_unsigned_int_32 (std::string const &name) |
| Return the named field as an uint32_t. More... | |
| std::string const & | as_string (std::string const &name) const |
| Return the named field as a string. More... | |
| std::string & | as_string (std::string const &name) |
| Return the named field as a sequence of items. More... | |
| std::vector< Item > const & | as_items (std::string const &name) const |
| std::vector< Item > & | as_items (std::string const &name) |
| Return the named field as a sequence of items. More... | |
| const_iterator | begin () const |
| const_iterator | end () const |
| void | read (std::istream &stream, std::string const &name, Field::Type type, std::streamsize size=0) |
| Read a field from a stream. More... | |
A sequence of fields forming a full PDU or a part of it.
| typedef Container::const_iterator odil::pdu::Item::const_iterator |
| typedef std::vector<std::pair<std::string, Field> > odil::pdu::Item::Container |
| odil::pdu::Item::Item | ( | ) |
Create an empty PDU item.
| odil::pdu::Item::Item | ( | std::vector< std::pair< std::string, Field >> const & | fields | ) |
Create an initialized PDU item.
Add a new field to the PDU item.
| std::vector<Item> const& odil::pdu::Item::as_items | ( | std::string const & | name | ) | const |
| std::vector<Item>& odil::pdu::Item::as_items | ( | std::string const & | name | ) |
Return the named field as a sequence of items.
Raise an exception if no such field exists or if the field does not contain a sequence of items.
| std::string const& odil::pdu::Item::as_string | ( | std::string const & | name | ) | const |
Return the named field as a string.
Raise an exception if no such field exists or if the field does not contain a string.
| std::string& odil::pdu::Item::as_string | ( | std::string const & | name | ) |
Return the named field as a sequence of items.
Raise an exception if no such field exists or if the field does not contain a sequence of items.
| uint16_t odil::pdu::Item::as_unsigned_int_16 | ( | std::string const & | name | ) | const |
Return the named field as an uint16_t.
Raise an exception if no such field exists or if the field does not contain an uint16_t.
| uint16_t& odil::pdu::Item::as_unsigned_int_16 | ( | std::string const & | name | ) |
Return the named field as an uint16_t.
Raise an exception if no such field exists or if the field does not contain an uint16_t.
| uint32_t odil::pdu::Item::as_unsigned_int_32 | ( | std::string const & | name | ) | const |
Return the named field as an uint32_t.
Raise an exception if no such field exists or if the field does not contain an uint32_t.
| uint32_t& odil::pdu::Item::as_unsigned_int_32 | ( | std::string const & | name | ) |
Return the named field as an uint32_t.
Raise an exception if no such field exists or if the field does not contain an uint32_t.
| uint8_t odil::pdu::Item::as_unsigned_int_8 | ( | std::string const & | name | ) | const |
Return the named field as an uint8_t.
Raise an exception if no such field exists or if the field does not contain an uint8_t.
| uint8_t& odil::pdu::Item::as_unsigned_int_8 | ( | std::string const & | name | ) |
Return the named field as an uint8_t.
Raise an exception if no such field exists or if the field does not contain an uint8_t.
| const_iterator odil::pdu::Item::begin | ( | ) | const |
| bool odil::pdu::Item::empty | ( | ) | const |
Test whether the container is empty.
| const_iterator odil::pdu::Item::end | ( | ) | const |
| bool odil::pdu::Item::has_field | ( | std::string const & | name | ) | const |
Test whether the PDU item contains a field with a given name.
| Field const& odil::pdu::Item::operator[] | ( | std::string const & | name | ) | const |
Return the named field. Raise an exception if no such field exists.
| Field& odil::pdu::Item::operator[] | ( | std::string const & | name | ) |
Return the named field. Raise an exception if no such field exists.
| void odil::pdu::Item::read | ( | std::istream & | stream, |
| std::string const & | name, | ||
| Field::Type | type, | ||
| std::streamsize | size = 0 |
||
| ) |
Read a field from a stream.
The size parameter is ignored for non-string types.
| Container::size_type odil::pdu::Item::size | ( | ) | const |
Return the number of fields.
1.8.13