DCMTK  Version 3.6.7
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
WlmActivityManager Class Reference

This class encapsulates data structures and operations for basic worklist management service class providers. More...

Public Member Functions

 WlmActivityManager (WlmDataSource *dataSourcev, OFCmdUnsignedInt opt_portv, OFBool opt_refuseAssociationv, OFBool opt_rejectWithoutImplementationUIDv, OFCmdUnsignedInt opt_sleepBeforeFindReqv, OFCmdUnsignedInt opt_sleepAfterFindv, OFCmdUnsignedInt opt_sleepDuringFindv, OFCmdUnsignedInt opt_maxPDUv, E_TransferSyntax opt_networkTransferSyntaxv, OFBool opt_failInvalidQueryv, OFBool opt_singleProcessv, int opt_maxAssociationsv, T_DIMSE_BlockingMode opt_blockModev, int opt_dimse_timeoutv, int opt_acse_timeoutv, OFBool opt_forkedChildv=OFFalse, int argcv=0, char *argvv[]=NULL)
 constructor. More...
 
 ~WlmActivityManager ()
 destructor
 
OFCondition StartProvidingService ()
 Starts providing the implemented service for calling SCUs. More...
 
OFBool setRequestFilePath (const OFString &path="", const OFString &format="#t.dump")
 Set directory to store request files to. More...
 

Protected Member Functions

OFCondition WaitForAssociation (T_ASC_Network *net)
 This function takes care of receiving, negotiating and accepting/refusing an association request. More...
 
void CleanChildren ()
 This function takes care of removing items referring to (terminated) subprocess from the table which stores all subprocess information. More...
 
OFCondition NegotiateAssociation (T_ASC_Association *assoc)
 This function negotiates a presentation context which will be used by this application and the other DICOM application that requests an association. More...
 
void AddProcessToTable (int pid, T_ASC_Association *assoc)
 This function adds a process to the table that stores process information. More...
 
void RemoveProcessFromTable (int pid)
 This function removes one particular item from the table which stores all subprocess information. More...
 
void RefuseAssociation (T_ASC_Association **assoc, WlmRefuseReasonType reason)
 This function takes care of refusing an association request. More...
 
void HandleAssociation (T_ASC_Association *assoc)
 This function takes care of handling the other DICOM application's request. More...
 
OFCondition ReceiveAndHandleCommands (T_ASC_Association *assoc)
 This function takes care of handling the other DICOM application's request. More...
 
OFCondition HandleEchoSCP (T_ASC_Association *assoc, T_DIMSE_C_EchoRQ *req, T_ASC_PresentationContextID presId)
 Having received a DIMSE C-ECHO-RQ message, this function takes care of sending a DIMSE C-ECHO-RSP message over the network connection. More...
 
OFCondition HandleFindSCP (T_ASC_Association *assoc, T_DIMSE_C_FindRQ *request, T_ASC_PresentationContextID presID)
 This function processes a DIMSE C-FIND-RQ commmand that was received over the network connection. More...
 
 WlmActivityManager (const WlmActivityManager &Src)
 Protected undefined copy-constructor. More...
 
WlmActivityManageroperator= (const WlmActivityManager &Src)
 Protected undefined operator=. More...
 

Protected Attributes

WlmDataSourcedataSource
 data source connection object
 
OFCmdUnsignedInt opt_port
 port on which the application is listening
 
OFBool opt_refuseAssociation
 indicates if the application shall refuse any association
 
OFBool opt_rejectWithoutImplementationUID
 indicates if the application shall reject associations without implementation class UIDs
 
OFCmdUnsignedInt opt_sleepBeforeFindReq
 indicates how many seconds the application is supposed to sleep before handling a find request
 
OFCmdUnsignedInt opt_sleepAfterFind
 indicates how long the application shall sleep after a find
 
OFCmdUnsignedInt opt_sleepDuringFind
 indicates how long the application shall sleep during a find
 
OFCmdUnsignedInt opt_maxPDU
 max PDU size
 
E_TransferSyntax opt_networkTransferSyntax
 preferred network transfer syntax
 
OFBool opt_failInvalidQuery
 indicates if the application shall fail on an invalid C-Find RQ message
 
OFBool opt_singleProcess
 indicates if the application is run in single process mode or not
 
OFBool opt_forkedChild
 indicates, that this process was spawn as child from a parent process needed for multiprocess mode on WIN32
 
int cmd_argc
 number of arguments in commandline, needed for multiprocess mode on WIN32
 
char ** cmd_argv
 complete command line, needed for multiprocess mode on WIN32
 
int opt_maxAssociations
 maximum number of association for non-single process mode
 
T_DIMSE_BlockingMode opt_blockMode
 blocking mode for DIMSE operations
 
int opt_dimse_timeout
 timeout for DIMSE operations
 
int opt_acse_timeout
 timeout for ACSE operations
 
char ** supportedAbstractSyntaxes
 array of supported abstract syntaxes
 
int numberOfSupportedAbstractSyntaxes
 number of array fields
 
OFList< WlmProcessSlotType * > processTable
 table of processes for non-single process mode
 
OFString opt_requestFilePath
 the directory where to store request files to
 
OFString opt_requestFileFormat
 the format used for the request file names. More...
 

Detailed Description

This class encapsulates data structures and operations for basic worklist management service class providers.

Constructor & Destructor Documentation

◆ WlmActivityManager() [1/2]

WlmActivityManager::WlmActivityManager ( const WlmActivityManager Src)
protected

Protected undefined copy-constructor.

Shall never be called.

Parameters
SrcSource object.

◆ WlmActivityManager() [2/2]

WlmActivityManager::WlmActivityManager ( WlmDataSource dataSourcev,
OFCmdUnsignedInt  opt_portv,
OFBool  opt_refuseAssociationv,
OFBool  opt_rejectWithoutImplementationUIDv,
OFCmdUnsignedInt  opt_sleepBeforeFindReqv,
OFCmdUnsignedInt  opt_sleepAfterFindv,
OFCmdUnsignedInt  opt_sleepDuringFindv,
OFCmdUnsignedInt  opt_maxPDUv,
E_TransferSyntax  opt_networkTransferSyntaxv,
OFBool  opt_failInvalidQueryv,
OFBool  opt_singleProcessv,
int  opt_maxAssociationsv,
T_DIMSE_BlockingMode  opt_blockModev,
int  opt_dimse_timeoutv,
int  opt_acse_timeoutv,
OFBool  opt_forkedChildv = OFFalse,
int  argcv = 0,
char *  argvv[] = NULL 
)

constructor.

Parameters
dataSourcevPointer to the data source which shall be used.
opt_portvThe port on which the application is supposed to listen.
opt_refuseAssociationvSpecifies if an association shall always be refused by the SCP.
opt_rejectWithoutImplementationUIDvSpecifies if the application shall reject an association if no implementation class UID is provided by the calling SCU.
opt_sleepBeforeFindReqvSpecifies how many seconds the application is supposed to sleep before handling a C-FIND-Req.
opt_sleepAfterFindvSpecifies how many seconds the application is supposed to sleep after having handled a C-FIND-Rsp.
opt_sleepDuringFindvSpecifies how many seconds the application is supposed to sleep during the handling of a C-FIND-Rsp.
opt_maxPDUvMaximum length of a PDU that can be received in bytes.
opt_networkTransferSyntaxvSpecifies the preferred network transfer syntaxes.
opt_failInvalidQueryvSpecifies if the application shall fail on an invalid query.
opt_singleProcessvSpecifies if the application shall run in a single process.
opt_maxAssociationsvSpecifies many concurrent associations the application shall be able to handle.
opt_blockModevSpecifies the blocking mode for DIMSE operations
opt_dimse_timeoutvSpecifies the timeout for DIMSE operations
opt_acse_timeoutvSpecifies the timeout for ACSE operations
opt_forkedChildIndicates, whether this process was "forked" from a parent process, default: false
argcvNumber of commandline arguments given
argvvComplete command line

Member Function Documentation

◆ AddProcessToTable()

void WlmActivityManager::AddProcessToTable ( int  pid,
T_ASC_Association assoc 
)
protected

This function adds a process to the table that stores process information.

Parameters
pidthe process id of the sub-process which was just started.
assocThe association (network connection to another DICOM application).

◆ CleanChildren()

void WlmActivityManager::CleanChildren ( )
protected

This function takes care of removing items referring to (terminated) subprocess from the table which stores all subprocess information.

Three different versions for three different platforms are implemented.

◆ HandleAssociation()

void WlmActivityManager::HandleAssociation ( T_ASC_Association assoc)
protected

This function takes care of handling the other DICOM application's request.

After having accomplished all necessary steps, the association will be dropped and destroyed.

Parameters
assocThe association (network connection to another DICOM application).

◆ HandleEchoSCP()

OFCondition WlmActivityManager::HandleEchoSCP ( T_ASC_Association assoc,
T_DIMSE_C_EchoRQ req,
T_ASC_PresentationContextID  presId 
)
protected

Having received a DIMSE C-ECHO-RQ message, this function takes care of sending a DIMSE C-ECHO-RSP message over the network connection.

Parameters
assocThe association (network connection to another DICOM application).
reqThe DIMSE C-ECHO-RQ message that was received.
presIdThe ID of the presentation context which was specified in the PDV which contained the DIMSE command.
Returns
OFCondition value denoting success or error.

◆ HandleFindSCP()

OFCondition WlmActivityManager::HandleFindSCP ( T_ASC_Association assoc,
T_DIMSE_C_FindRQ request,
T_ASC_PresentationContextID  presID 
)
protected

This function processes a DIMSE C-FIND-RQ commmand that was received over the network connection.

Parameters
assocThe association (network connection to another DICOM application).
requestThe DIMSE C-FIND-RQ message that was received.
presIDThe ID of the presentation context which was specified in the PDV which contained the DIMSE command.
Returns
OFCondition value denoting success or error.

◆ NegotiateAssociation()

OFCondition WlmActivityManager::NegotiateAssociation ( T_ASC_Association assoc)
protected

This function negotiates a presentation context which will be used by this application and the other DICOM application that requests an association.

Parameters
assocThe association (network connection to another DICOM application).

◆ operator=()

WlmActivityManager& WlmActivityManager::operator= ( const WlmActivityManager Src)
protected

Protected undefined operator=.

Shall never be called.

Parameters
SrcSource object.
Returns
Reference to this.

◆ ReceiveAndHandleCommands()

OFCondition WlmActivityManager::ReceiveAndHandleCommands ( T_ASC_Association assoc)
protected

This function takes care of handling the other DICOM application's request.

Parameters
assocThe association (network connection to another DICOM application).
Returns
An OFCondition value 'cond' for which 'cond.bad()' will always be set indicating that either some kind of error occurred, or that the peer aborted the association (DUL_PEERABORTEDASSOCIATION), or that the peer requested the release of the association (DUL_PEERREQUESTEDRELEASE).

◆ RefuseAssociation()

void WlmActivityManager::RefuseAssociation ( T_ASC_Association **  assoc,
WlmRefuseReasonType  reason 
)
protected

This function takes care of refusing an association request.

Parameters
assocThe association (network connection to another DICOM application).
reasonThe reason why the association request will be refused.

◆ RemoveProcessFromTable()

void WlmActivityManager::RemoveProcessFromTable ( int  pid)
protected

This function removes one particular item from the table which stores all subprocess information.

The item which shall be deleted will be identified by its process id.

Parameters
pidprocess id.

◆ setRequestFilePath()

OFBool WlmActivityManager::setRequestFilePath ( const OFString path = "",
const OFString format = "#t.dump" 
)

Set directory to store request files to.

If set to empty path (default), request files are not stored.

Parameters
pathPath to directory where request files should be stored to. Must exist and be writable for worklist application.
formatThe format used for the request file names. Several placeholders can be used by (denoted by #):
#a: calling application entity title of the peer SCU
#c: called application entity title (AE title of worklist SCP application)
#i: process id of the worklist SCP application process handling the request
#p: patient ID if present, otherwise empty string
#t: timestamp in the format YYYYMMDDhhmmssffffff
Default is #t.dump.
Returns
OFTrue if path is accepted, OFFalse otherwise

◆ StartProvidingService()

OFCondition WlmActivityManager::StartProvidingService ( )

Starts providing the implemented service for calling SCUs.

After having created an instance of this class, this function shall be called from main.

Returns
Value that is supposed to be returned from main().

◆ WaitForAssociation()

OFCondition WlmActivityManager::WaitForAssociation ( T_ASC_Network net)
protected

This function takes care of receiving, negotiating and accepting/refusing an association request.

Additionally, it handles the request the association requesting application transmits after a connection is established.

Parameters
netContains network parameters.

Member Data Documentation

◆ opt_requestFileFormat

OFString WlmActivityManager::opt_requestFileFormat
protected

the format used for the request file names.

Several placeholders can be used by(denoted by #) : #a: calling application entity title of the peer SCU #c: called application entity title (AE title of worklist SCP application) #i process id of the worklist SCP application process handling the request #p: patient ID if present, otherwise empty string \ #t: timestamp in the format YYYYMMDDhhmmssffffff


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


Generated on Thu Apr 28 2022 for DCMTK Version 3.6.7 by Doxygen 1.9.1