Odil
A C++11 library for the DICOM standard
Public Types | Public Member Functions | List of all members
odil::dul::Transport Struct Reference

TCP transport for the DICOM Upper Layer. More...

#include <Transport.h>

Public Types

typedef boost::asio::ip::tcp::socket Socket
 Socket type. More...
 
typedef boost::asio::deadline_timer::duration_type duration_type
 Duration of the timeout. More...
 

Public Member Functions

 Transport ()
 Constructor. More...
 
 ~Transport ()
 Destructor. More...
 
boost::asio::io_service const & get_service () const
 Return the io_service. More...
 
boost::asio::io_service & get_service ()
 Return the io_service. More...
 
std::shared_ptr< Socket const > get_socket () const
 Return the socket. More...
 
std::shared_ptr< Socketget_socket ()
 Return the socket. More...
 
duration_type get_timeout () const
 Return the timeout, default to infinity. More...
 
void set_timeout (duration_type timeout)
 Set the timeout. More...
 
bool is_open () const
 Test whether the transport is open. More...
 
void connect (Socket::endpoint_type const &peer_endpoint)
 Connect to the specified endpoint, raise an exception upon error. More...
 
void receive (Socket::endpoint_type const &endpoint)
 Receive a connection on the specified endpoint, raise an exception upon error. More...
 
void close ()
 Close the connection. More...
 
std::string read (std::size_t length)
 Read data, raise an exception on error. More...
 
void write (std::string const &data)
 Write data, raise an exception on error. More...
 

Detailed Description

TCP transport for the DICOM Upper Layer.

The behavior of connect, receive, read and write is governed by the timeout value: if the timeout expires before the operation is completed, an exception will be raised.

Member Typedef Documentation

◆ duration_type

typedef boost::asio::deadline_timer::duration_type odil::dul::Transport::duration_type

Duration of the timeout.

◆ Socket

typedef boost::asio::ip::tcp::socket odil::dul::Transport::Socket

Socket type.

Constructor & Destructor Documentation

◆ Transport()

odil::dul::Transport::Transport ( )

Constructor.

◆ ~Transport()

odil::dul::Transport::~Transport ( )

Destructor.

Member Function Documentation

◆ close()

void odil::dul::Transport::close ( )

Close the connection.

◆ connect()

void odil::dul::Transport::connect ( Socket::endpoint_type const &  peer_endpoint)

Connect to the specified endpoint, raise an exception upon error.

◆ get_service() [1/2]

boost::asio::io_service & odil::dul::Transport::get_service ( )

Return the io_service.

◆ get_service() [2/2]

boost::asio::io_service const & odil::dul::Transport::get_service ( ) const

Return the io_service.

◆ get_socket() [1/2]

std::shared_ptr< Socket > odil::dul::Transport::get_socket ( )

Return the socket.

◆ get_socket() [2/2]

std::shared_ptr< Socket const > odil::dul::Transport::get_socket ( ) const

Return the socket.

◆ get_timeout()

duration_type odil::dul::Transport::get_timeout ( ) const

Return the timeout, default to infinity.

◆ is_open()

bool odil::dul::Transport::is_open ( ) const

Test whether the transport is open.

◆ read()

std::string odil::dul::Transport::read ( std::size_t  length)

Read data, raise an exception on error.

◆ receive()

void odil::dul::Transport::receive ( Socket::endpoint_type const &  endpoint)

Receive a connection on the specified endpoint, raise an exception upon error.

◆ set_timeout()

void odil::dul::Transport::set_timeout ( duration_type  timeout)

Set the timeout.

◆ write()

void odil::dul::Transport::write ( std::string const &  data)

Write data, raise an exception on error.


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