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

Association. More...

#include <Association.h>

Public Types

enum  Result { Accepted =0, RejectedPermanent =1, RejectedTransient =2 }
 Association result (ITU-T X.227, PS 3.8, 7.1.1.7 and PS 3.8, 9.3.4). More...
 
enum  ResultSource { ULServiceUser =1, ULServiceProviderACSERelatedFunction =2, ULServiceProvderPresentationRelatedFunction =3 }
 Source of association result (PS 3.8, 7.1.1.8 and PS 3.8, 9.3.4). More...
 
enum  Diagnostic {
  NoReasonGiven =1, ApplicationContextNameNotSupported =2, CallingAETitleNotRecognized =3, CallingAPInvocationIdentifierNotRecognized =4,
  CallingAEQualifierNotRecognized =5, CallingAEInvocationIdentifierNotRecognized =6, CalledAETitleNotRecognized =7, CalledAPInvocationIdentifierNotRecognized =8,
  CalledAEQualifierNotRecognized =9, CalledAEInvocationIdentifierNotRecognized =10, NoCommonULVersion =2, TemporaryCongestion =1,
  LocalLimitExceeded =2, CalledPresentationAddressUnknown =3, PresentationProtocolVersionNotSupported =4, NoPresentationServiceAccessPointAvailable =7
}
 Diagnostic of association result. More...
 
typedef dul::StateMachine::duration_type duration_type
 Duration of the timeout. More...
 

Public Member Functions

 Association ()
 Create a default, un-associated, association. More...
 
 Association (Association const &other)
 Create an un-associated association. More...
 
 ~Association ()
 Destroy the association, release it if necessary. More...
 
dul::Transportget_transport ()
 Return the TCP transport. More...
 
Associationoperator= (Association const &other)
 Assing an un-associated association; it remains un-associated. More...
 
AssociationParameters const & get_parameters () const
 Return the association parameters. More...
 
AssociationParametersupdate_parameters ()
 Return the association parameters. More...
 
void set_parameters (AssociationParameters const &value)
 Set the association parameters, throw an exception when associated. More...
 
AssociationParameters const & get_negotiated_parameters () const
 Return the negotiated association parameters. More...
 
Peer
std::string const & get_peer_host () const
 Return the host name of the peer. Defaults to "". More...
 
void set_peer_host (std::string const &host)
 Set the host name of the peer. More...
 
uint16_t get_peer_port () const
 Return the port of the peer. Defaults to 104. More...
 
void set_peer_port (uint16_t port)
 Set the port of the peer. More...
 
Timeouts
duration_type get_tcp_timeout () const
 Return the TCP timeout, default to infinity. More...
 
void set_tcp_timeout (duration_type const &duration)
 Set the timeout. More...
 
duration_type get_message_timeout () const
 Return the DIMSE timeout, default to 30s. More...
 
void set_message_timeout (duration_type const &duration)
 Set the DIMSE timeout. More...
 
Association
bool is_associated () const
 Test whether the object is currently associated to its peer. More...
 
void associate ()
 Request an association with the peer. Throws an exception if the endpoint can not be reached. More...
 
void receive_association (boost::asio::ip::tcp const &protocol, unsigned short port, AssociationAcceptor acceptor=default_association_acceptor)
 Receive an association from a peer. More...
 
void reject (Result result, ResultSource result_source, Diagnostic diagnostic)
 Reject the received association request. More...
 
void release ()
 Gracefully release the association. Throws an exception if not associated. More...
 
void abort (int source, int reason)
 Forcefully release the association. Throws an exception if not associated. More...
 
DIMSE messages sending and reception.
message::Message receive_message ()
 Receive a generic DIMSE message. More...
 
void send_message (message::Message const &message, std::string const &abstract_syntax)
 Send a DIMSE message. More...
 
uint16_t next_message_id ()
 Return the next available message id. More...
 

Detailed Description

Association.

Member Typedef Documentation

◆ duration_type

Duration of the timeout.

Member Enumeration Documentation

◆ Diagnostic

Diagnostic of association result.

Enumerator
NoReasonGiven 
ApplicationContextNameNotSupported 
CallingAETitleNotRecognized 
CallingAPInvocationIdentifierNotRecognized 
CallingAEQualifierNotRecognized 
CallingAEInvocationIdentifierNotRecognized 
CalledAETitleNotRecognized 
CalledAPInvocationIdentifierNotRecognized 
CalledAEQualifierNotRecognized 
CalledAEInvocationIdentifierNotRecognized 
NoCommonULVersion 
TemporaryCongestion 
LocalLimitExceeded 
CalledPresentationAddressUnknown 
PresentationProtocolVersionNotSupported 
NoPresentationServiceAccessPointAvailable 

◆ Result

Association result (ITU-T X.227, PS 3.8, 7.1.1.7 and PS 3.8, 9.3.4).

Enumerator
Accepted 
RejectedPermanent 
RejectedTransient 

◆ ResultSource

Source of association result (PS 3.8, 7.1.1.8 and PS 3.8, 9.3.4).

Enumerator
ULServiceUser 
ULServiceProviderACSERelatedFunction 
ULServiceProvderPresentationRelatedFunction 

Constructor & Destructor Documentation

◆ Association() [1/2]

odil::Association::Association ( )

Create a default, un-associated, association.

◆ Association() [2/2]

odil::Association::Association ( Association const &  other)

Create an un-associated association.

◆ ~Association()

odil::Association::~Association ( )

Destroy the association, release it if necessary.

Member Function Documentation

◆ abort()

void odil::Association::abort ( int  source,
int  reason 
)

Forcefully release the association. Throws an exception if not associated.

◆ associate()

void odil::Association::associate ( )

Request an association with the peer. Throws an exception if the endpoint can not be reached.

◆ get_message_timeout()

duration_type odil::Association::get_message_timeout ( ) const

Return the DIMSE timeout, default to 30s.

◆ get_negotiated_parameters()

AssociationParameters const& odil::Association::get_negotiated_parameters ( ) const

Return the negotiated association parameters.

◆ get_parameters()

AssociationParameters const& odil::Association::get_parameters ( ) const

Return the association parameters.

◆ get_peer_host()

std::string const& odil::Association::get_peer_host ( ) const

Return the host name of the peer. Defaults to "".

◆ get_peer_port()

uint16_t odil::Association::get_peer_port ( ) const

Return the port of the peer. Defaults to 104.

◆ get_tcp_timeout()

duration_type odil::Association::get_tcp_timeout ( ) const

Return the TCP timeout, default to infinity.

◆ get_transport()

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

Return the TCP transport.

◆ is_associated()

bool odil::Association::is_associated ( ) const

Test whether the object is currently associated to its peer.

◆ next_message_id()

uint16_t odil::Association::next_message_id ( )

Return the next available message id.

◆ operator=()

Association& odil::Association::operator= ( Association const &  other)

Assing an un-associated association; it remains un-associated.

◆ receive_association()

void odil::Association::receive_association ( boost::asio::ip::tcp const &  protocol,
unsigned short  port,
AssociationAcceptor  acceptor = default_association_acceptor 
)

Receive an association from a peer.

◆ receive_message()

message::Message odil::Association::receive_message ( )

Receive a generic DIMSE message.

Throw an AssociationReleased or AssociationAborted if the peer released or aborted the association.

◆ reject()

void odil::Association::reject ( Result  result,
ResultSource  result_source,
Diagnostic  diagnostic 
)

Reject the received association request.

◆ release()

void odil::Association::release ( )

Gracefully release the association. Throws an exception if not associated.

◆ send_message()

void odil::Association::send_message ( message::Message const &  message,
std::string const &  abstract_syntax 
)

Send a DIMSE message.

◆ set_message_timeout()

void odil::Association::set_message_timeout ( duration_type const &  duration)

Set the DIMSE timeout.

◆ set_parameters()

void odil::Association::set_parameters ( AssociationParameters const &  value)

Set the association parameters, throw an exception when associated.

◆ set_peer_host()

void odil::Association::set_peer_host ( std::string const &  host)

Set the host name of the peer.

◆ set_peer_port()

void odil::Association::set_peer_port ( uint16_t  port)

Set the port of the peer.

◆ set_tcp_timeout()

void odil::Association::set_tcp_timeout ( duration_type const &  duration)

Set the timeout.

◆ update_parameters()

AssociationParameters& odil::Association::update_parameters ( )

Return the association parameters.


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