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

State machine for the DICOM upper layer. More...

#include <StateMachine.h>

Public Types

enum  State {
  State::Sta1, State::Sta2, State::Sta3, State::Sta4,
  State::Sta5, State::Sta6, State::Sta7, State::Sta8,
  State::Sta9, State::Sta10, State::Sta11, State::Sta12,
  State::Sta13
}
 States of the state machine. More...
 
enum  Event {
  Event::None, Event::TransportConnectionIndication, Event::TransportConnectionConfirmation, Event::TransportConnectionClosedIndication,
  Event::AAssociateRQLocal, Event::AAssociateRQRemote, Event::AAssociateACLocal, Event::AAssociateACRemote,
  Event::AAssociateRJLocal, Event::AAssociateRJRemote, Event::AReleaseRQLocal, Event::AReleaseRQRemote,
  Event::AReleaseRPLocal, Event::AReleaseRPRemote, Event::PDataTFLocal, Event::PDataTFRemote,
  Event::AAbortLocal, Event::AAbortRemote, Event::ARTIMTimerExpired, Event::InvalidPDU
}
 Event causing the transitions. More...
 
typedef boost::asio::deadline_timer::duration_type duration_type
 Duration of the timeout. More...
 

Public Member Functions

 StateMachine ()
 Constructor, initializing to Sta1. More...
 
 ~StateMachine ()
 Destructor, closing the transport. More...
 
void transition (Event const &event, EventData &data)
 Perform the transition related to the event and current state. Raise an exception if no such transition exists. More...
 
State get_state () const
 Return the current state. More...
 
Transport const & get_transport () const
 Return the TCP transport. More...
 
Transportget_transport ()
 Return the TCP transport. More...
 
duration_type get_timeout () const
 Return the timeout, default to infinity. More...
 
void set_timeout (duration_type timeout)
 Set the timeout. More...
 
void receive (EventData &data)
 Receive a connection on the TCP transport, perform the corresponding transition. More...
 
void send_pdu (EventData &data)
 Send a PDU to the transport, perform the corresponding transition. More...
 
void receive_pdu (EventData &data)
 Receive a PDU on the transport, perform the corresponding transition. More...
 
void start_timer (EventData &data)
 Start (or re-start if already started) the ARTIM timer. More...
 
void stop_timer ()
 Stop the ARTIM timer. More...
 
AssociationAcceptor const & get_association_acceptor () const
 Return the callback checking whether the association request is acceptable. More...
 
void set_association_acceptor (AssociationAcceptor const &acceptor)
 Set the callback checking whether the association request is acceptable. More...
 

Detailed Description

State machine for the DICOM upper layer.

Member Typedef Documentation

◆ duration_type

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

Duration of the timeout.

Member Enumeration Documentation

◆ Event

Event causing the transitions.

Enumerator
None 
TransportConnectionIndication 
TransportConnectionConfirmation 
TransportConnectionClosedIndication 
AAssociateRQLocal 
AAssociateRQRemote 
AAssociateACLocal 
AAssociateACRemote 
AAssociateRJLocal 
AAssociateRJRemote 
AReleaseRQLocal 
AReleaseRQRemote 
AReleaseRPLocal 
AReleaseRPRemote 
PDataTFLocal 
PDataTFRemote 
AAbortLocal 
AAbortRemote 
ARTIMTimerExpired 
InvalidPDU 

◆ State

States of the state machine.

Enumerator
Sta1 
Sta2 
Sta3 
Sta4 
Sta5 
Sta6 
Sta7 
Sta8 
Sta9 
Sta10 
Sta11 
Sta12 
Sta13 

Constructor & Destructor Documentation

◆ StateMachine()

odil::dul::StateMachine::StateMachine ( )

Constructor, initializing to Sta1.

◆ ~StateMachine()

odil::dul::StateMachine::~StateMachine ( )

Destructor, closing the transport.

Member Function Documentation

◆ get_association_acceptor()

AssociationAcceptor const& odil::dul::StateMachine::get_association_acceptor ( ) const

Return the callback checking whether the association request is acceptable.

By default, all association requests are accepted.

◆ get_state()

State odil::dul::StateMachine::get_state ( ) const

Return the current state.

◆ get_timeout()

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

Return the timeout, default to infinity.

◆ get_transport() [1/2]

Transport const& odil::dul::StateMachine::get_transport ( ) const

Return the TCP transport.

◆ get_transport() [2/2]

Transport& odil::dul::StateMachine::get_transport ( )

Return the TCP transport.

◆ receive()

void odil::dul::StateMachine::receive ( EventData data)

Receive a connection on the TCP transport, perform the corresponding transition.

◆ receive_pdu()

void odil::dul::StateMachine::receive_pdu ( EventData data)

Receive a PDU on the transport, perform the corresponding transition.

◆ send_pdu()

void odil::dul::StateMachine::send_pdu ( EventData data)

Send a PDU to the transport, perform the corresponding transition.

◆ set_association_acceptor()

void odil::dul::StateMachine::set_association_acceptor ( AssociationAcceptor const &  acceptor)

Set the callback checking whether the association request is acceptable.

◆ set_timeout()

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

Set the timeout.

◆ start_timer()

void odil::dul::StateMachine::start_timer ( EventData data)

Start (or re-start if already started) the ARTIM timer.

◆ stop_timer()

void odil::dul::StateMachine::stop_timer ( )

Stop the ARTIM timer.

◆ transition()

void odil::dul::StateMachine::transition ( Event const &  event,
EventData data 
)

Perform the transition related to the event and current state. Raise an exception if no such transition exists.


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