Odil
A C++11 library for the DICOM standard
Public Types | Public Member Functions | List of all members
odil::pdu::Item::Field Class Reference

Generic field. More...

#include <Item.h>

Public Types

enum  Type {
  Type::unsigned_int_8, Type::unsigned_int_16, Type::unsigned_int_32, Type::string,
  Type::items
}
 Possible types stored in the field. More...
 

Public Member Functions

 Field (uint8_t value)
 Constructor. More...
 
 Field (uint16_t value)
 Constructor. More...
 
 Field (uint32_t value)
 Constructor. More...
 
 Field (std::string const &value)
 Constructor. More...
 
 Field (std::vector< Item > const &value)
 Constructor. More...
 
Type get_type () const
 Return the concrete type stored in the field. More...
 
uint8_t as_unsigned_int_8 () const
 Return the uint8_t stored in the field. More...
 
uint8_t & as_unsigned_int_8 ()
 Return the uint8_t stored in the field. More...
 
uint16_t as_unsigned_int_16 () const
 Return the uint16_t stored in the field. More...
 
uint16_t & as_unsigned_int_16 ()
 Return the uint16_t stored in the field. More...
 
uint32_t as_unsigned_int_32 () const
 Return the uint32_t stored in the field. More...
 
uint32_t & as_unsigned_int_32 ()
 Return the uint32_t stored in the field. More...
 
const std::string & as_string () const
 Return the string stored in the field. More...
 
std::string & as_string ()
 Return the string stored in the field. More...
 
const std::vector< Item > & as_items () const
 Return the items stored in the field. More...
 
std::vector< Item > & as_items ()
 Return the items stored in the field. More...
 

Detailed Description

Generic field.

Member Enumeration Documentation

◆ Type

Possible types stored in the field.

Enumerator
unsigned_int_8 
unsigned_int_16 
unsigned_int_32 
string 
items 

Constructor & Destructor Documentation

◆ Field() [1/5]

odil::pdu::Item::Field::Field ( uint8_t  value)

Constructor.

◆ Field() [2/5]

odil::pdu::Item::Field::Field ( uint16_t  value)

Constructor.

◆ Field() [3/5]

odil::pdu::Item::Field::Field ( uint32_t  value)

Constructor.

◆ Field() [4/5]

odil::pdu::Item::Field::Field ( std::string const &  value)

Constructor.

◆ Field() [5/5]

odil::pdu::Item::Field::Field ( std::vector< Item > const &  value)

Constructor.

Member Function Documentation

◆ as_items() [1/2]

std::vector<Item>& odil::pdu::Item::Field::as_items ( )

Return the items stored in the field.

If the field does not contain items, a odil::Exception is raised.

◆ as_items() [2/2]

const std::vector<Item>& odil::pdu::Item::Field::as_items ( ) const

Return the items stored in the field.

If the field does not contain items, a odil::Exception is raised.

◆ as_string() [1/2]

std::string& odil::pdu::Item::Field::as_string ( )

Return the string stored in the field.

If the field does not contain an string, a odil::Exception is raised.

◆ as_string() [2/2]

const std::string& odil::pdu::Item::Field::as_string ( ) const

Return the string stored in the field.

If the field does not contain an string, a odil::Exception is raised.

◆ as_unsigned_int_16() [1/2]

uint16_t& odil::pdu::Item::Field::as_unsigned_int_16 ( )

Return the uint16_t stored in the field.

If the field does not contain an uint16_t, a odil::Exception is raised.

◆ as_unsigned_int_16() [2/2]

uint16_t odil::pdu::Item::Field::as_unsigned_int_16 ( ) const

Return the uint16_t stored in the field.

If the field does not contain an uint16_t, a odil::Exception is raised.

◆ as_unsigned_int_32() [1/2]

uint32_t& odil::pdu::Item::Field::as_unsigned_int_32 ( )

Return the uint32_t stored in the field.

If the field does not contain an uint32_t, a odil::Exception is raised.

◆ as_unsigned_int_32() [2/2]

uint32_t odil::pdu::Item::Field::as_unsigned_int_32 ( ) const

Return the uint32_t stored in the field.

If the field does not contain an uint32_t, a odil::Exception is raised.

◆ as_unsigned_int_8() [1/2]

uint8_t& odil::pdu::Item::Field::as_unsigned_int_8 ( )

Return the uint8_t stored in the field.

If the field does not contain an uint8_t, a odil::Exception is raised.

◆ as_unsigned_int_8() [2/2]

uint8_t odil::pdu::Item::Field::as_unsigned_int_8 ( ) const

Return the uint8_t stored in the field.

If the field does not contain an uint8_t, a odil::Exception is raised.

◆ get_type()

Type odil::pdu::Item::Field::get_type ( ) const

Return the concrete type stored in the field.


The documentation for this class was generated from the following file: