9#ifndef _981c80db_b2ac_4f25_af6c_febf5563d178
10#define _981c80db_b2ac_4f25_af6c_febf5563d178
17#include <boost/asio.hpp>
39 Sta2, Sta3, Sta4, Sta5,
41 Sta7, Sta8, Sta9, Sta10, Sta11, Sta12,
49 TransportConnectionIndication, TransportConnectionConfirmation,
50 TransportConnectionClosedIndication,
52 AAssociateRQLocal, AAssociateRQRemote,
53 AAssociateACLocal, AAssociateACRemote,
54 AAssociateRJLocal, AAssociateRJRemote,
56 AReleaseRQLocal, AReleaseRQRemote,
57 AReleaseRPLocal, AReleaseRPRemote,
59 PDataTFLocal, PDataTFRemote,
61 AAbortLocal, AAbortRemote,
63 ARTIMTimerExpired, InvalidPDU,
132 AE_1, AE_2, AE_3, AE_4, AE_5, AE_6, AE_7, AE_8,
134 AR_1, AR_2, AR_3, AR_4, AR_5, AR_6, AR_7, AR_8, AR_9, AR_10,
135 AA_1, AA_2, AA_3, AA_4, AA_5, AA_6, AA_7, AA_8
139 std::tuple<State, Event, bool>,
140 std::pair<Action, State>> TransitionMap;
143 std::pair<State, Event>,
146 static TransitionMap
const _transitions;
147 static GuardMap
const _guards;
156 duration_type _timeout;
159 boost::asio::deadline_timer _artim_timer;
165 void _send_pdu(
EventData & data, uint8_t pdu_type);
Data related to events of the DUL state machine.
Definition EventData.h:28
State machine for the DICOM upper layer.
Definition StateMachine.h:32
Transport const & get_transport() const
Return the TCP transport.
State
States of the state machine.
Definition StateMachine.h:37
duration_type get_timeout() const
Return the timeout, default to infinity.
State get_state() const
Return the current state.
void transition(Event const &event, EventData &data)
Perform the transition related to the event and current state. Raise an exception if no such transiti...
boost::asio::deadline_timer::duration_type duration_type
Duration of the timeout.
Definition StateMachine.h:67
void receive_pdu(EventData &data)
Receive a PDU on the transport, perform the corresponding transition.
void stop_timer()
Stop the ARTIM timer.
void receive(EventData &data)
Receive a connection on the TCP transport, perform the corresponding transition.
AssociationAcceptor const & get_association_acceptor() const
Return the callback checking whether the association request is acceptable.
Transport & get_transport()
Return the TCP transport.
void set_timeout(duration_type timeout)
Set the timeout.
StateMachine()
Constructor, initializing to Sta1.
void set_association_acceptor(AssociationAcceptor const &acceptor)
Set the callback checking whether the association request is acceptable.
~StateMachine()
Destructor, closing the transport.
void start_timer(EventData &data)
Start (or re-start if already started) the ARTIM timer.
void send_pdu(EventData &data)
Send a PDU to the transport, perform the corresponding transition.
Event
Event causing the transitions.
Definition StateMachine.h:47
Definition Association.h:25
std::function< AssociationParameters(AssociationParameters const &)> AssociationAcceptor
Callback to check whether the association request is acceptable.
Definition AssociationAcceptor.h:30
#define ODIL_API
Definition odil.h:28
TCP transport for the DICOM Upper Layer.
Definition Transport.h:34