Odil
A C++11 library for the DICOM standard
|
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... | |
const Transport & | get_transport () const |
Return the TCP transport. More... | |
Transport & | get_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... | |
const AssociationAcceptor & | 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... | |
State machine for the DICOM upper layer.
typedef boost::asio::deadline_timer::duration_type odil::dul::StateMachine::duration_type |
Duration of the timeout.
|
strong |
Event causing the transitions.
|
strong |
odil::dul::StateMachine::StateMachine | ( | ) |
Constructor, initializing to Sta1.
odil::dul::StateMachine::~StateMachine | ( | ) |
Destructor, closing the transport.
const AssociationAcceptor& odil::dul::StateMachine::get_association_acceptor | ( | ) | const |
Return the callback checking whether the association request is acceptable.
By default, all association requests are accepted.
State odil::dul::StateMachine::get_state | ( | ) | const |
Return the current state.
duration_type odil::dul::StateMachine::get_timeout | ( | ) | const |
Return the timeout, default to infinity.
Transport& odil::dul::StateMachine::get_transport | ( | ) |
Return the TCP transport.
const Transport& odil::dul::StateMachine::get_transport | ( | ) | const |
Return the TCP transport.
void odil::dul::StateMachine::receive | ( | EventData & | data | ) |
Receive a connection on the TCP transport, perform the corresponding transition.
void odil::dul::StateMachine::receive_pdu | ( | EventData & | data | ) |
Receive a PDU on the transport, perform the corresponding transition.
void odil::dul::StateMachine::send_pdu | ( | EventData & | data | ) |
Send a PDU to the transport, perform the corresponding transition.
void odil::dul::StateMachine::set_association_acceptor | ( | AssociationAcceptor const & | acceptor | ) |
Set the callback checking whether the association request is acceptable.
void odil::dul::StateMachine::set_timeout | ( | duration_type | timeout | ) |
Set the timeout.
void odil::dul::StateMachine::start_timer | ( | EventData & | data | ) |
Start (or re-start if already started) the ARTIM timer.
void odil::dul::StateMachine::stop_timer | ( | ) |
Stop the ARTIM timer.
Perform the transition related to the event and current state. Raise an exception if no such transition exists.