Loading...
Searching...
No Matches
DcmBaseSCPPool::DcmBaseSCPWorker Class Referenceabstract

Abstract base class that handles forwarding the configuration and T_ASC_Association to the actual worker class for each worker thread. More...

Inheritance diagram for DcmBaseSCPPool::DcmBaseSCPWorker:

## Public Member Functions

virtual | ~DcmBaseSCPWorker ()
| Virtual Destructor.
virtual OFCondition | setAssociation (T_ASC_Association *assoc)
| Set the association that should be handled by the worker thread.
virtual OFCondition | setSharedConfig (const DcmSharedSCPConfig &config)=0
| Set SCP configuration that should be used by the worker in order to handle incoming association requests (presentation contexts, etc.).
virtual OFBool | busy ()=0
| Check whether worker is busy.
virtual void | exit ()
| Ends and exits worker thread.
virtual void | rerun ()
| Restart the worker thread.
Public Member Functions inherited from OFThread
| OFThread ()
| default constructor.
virtual | ~OFThread ()
| destructor.
int | start ()
| adds a new thread of control to the current process.
int | join ()
| blocks the calling thread until the thread referenced by the OFThread object terminates.
unsigned long | threadID ()
| returns the thread identifier of the thread referenced by the OFThread object, if the thread has already been started.
OFBool | equal (unsigned long tID)
| checks if the given thread ID matches the thread ID of the thread referenced by this object.

## Protected Member Functions

| DcmBaseSCPWorker (DcmBaseSCPPool &pool)
| Protected constructor which is called within the friend class DcmSCPWorkerFactory in order to create a worker.
virtual void | run ()
| Overwrites run() function provided by OFThread.
virtual OFCondition | workerListen (T_ASC_Association *const assoc)=0
| Starts listening on the given association.

## Protected Attributes

DcmBaseSCPPool & | m_pool
| Reference to pool in order to notify pool if thread exits, etc.
T_ASC_Association * | m_assoc
| Temporarily stores association parameter to be available for the run() method.

## Additional Inherited Members

Static Public Member Functions inherited from OFThread
static void | errorstr (OFString &description, int code)
| converts any of the error codes returned by the methods of this class into a textual description, which is written into the string object.
Static Public Attributes inherited from OFThread
static const int | busy
| this constant is returned by the join() method if another thread is already waiting for termination of the thread referenced by the OFThread object.
Static Protected Member Functions inherited from OFThread
static void | thread_exit ()
| terminates the calling thread, in a similar way that exit() terminates the calling process.
static unsigned long | self ()
| returns the thread ID of the calling thread.

## Detailed Description

Abstract base class that handles forwarding the configuration and T_ASC_Association to the actual worker class for each worker thread.

## Constructor & Destructor Documentation

## DcmBaseSCPWorker()

DcmBaseSCPPool::DcmBaseSCPWorker::DcmBaseSCPWorker | ( | DcmBaseSCPPool & | pool | ) |

protected

Protected constructor which is called within the friend class DcmSCPWorkerFactory in order to create a worker.

Parameters

  pool | Handle to the SCP pool in order to inform pool about exiting the underlying thread, etc.

References DcmBaseSCPPool::DcmBaseSCPPool().

## Member Function Documentation

## busy()

virtual OFBool DcmBaseSCPPool::DcmBaseSCPWorker::busy | ( |  | ) |

pure virtual

Check whether worker is busy.

Returns
  OFTrue if worker is busy, OFFalse otherwise.

## exit()

virtual void DcmBaseSCPPool::DcmBaseSCPWorker::exit | ( |  | ) |

virtual

Ends and exits worker thread.

Call will not return.

## run()

virtual void DcmBaseSCPPool::DcmBaseSCPWorker::run | ( |  | ) |

protected virtual

Overwrites run() function provided by OFThread.

Is automatically executed when start() is called (also provided by OFThread).

Implements OFThread.

## setAssociation()

virtual OFCondition DcmBaseSCPPool::DcmBaseSCPWorker::setAssociation | ( | T_ASC_Association * | assoc | ) |

virtual

Set the association that should be handled by the worker thread.

This must happen before actually calling run() (i.e. start()) on the worker.

Parameters

  assoc | The association that should be handled by the worker.

Returns
  EC_Normal if OK, error code otherwise. An error may occur if the the function was called before with a valid association, or if the given association is NULL.

## setSharedConfig()

virtual OFCondition DcmBaseSCPPool::DcmBaseSCPWorker::setSharedConfig | ( | const DcmSharedSCPConfig & | config | ) |

pure virtual

Set SCP configuration that should be used by the worker in order to handle incoming association requests (presentation contexts, etc.).

Parameters

  config | A DcmSharedSCPConfig object to be used by this worker.

Returns
  EC_Normal, if configuration is accepted, error code otherwise.

## workerListen()

virtual OFCondition DcmBaseSCPPool::DcmBaseSCPWorker::workerListen | ( | T_ASC_Association *const | assoc | ) |

protected pure virtual

Starts listening on the given association.

Note that the underlying TCP connection must be already accepted, i.e. ASC_receiveAssociation() must have been called already on the association; after that, this listen() function kicks in and has to take over full responsibility of the association, including accepting it, refusing it, handling incoming DIMSE messages, freeing memory of the T_ASC_Association struct, and the like.

Parameters

  assoc | Pointer to the association that should be handled. Must not be NULL.

Returns
  EC_Normal if association was handled properly (i.e. was handled, refused, ... Only in case of connection or messaging errors, an error code will be returned instead.

## Member Data Documentation

## m_assoc

T_ASC_Association* DcmBaseSCPPool::DcmBaseSCPWorker::m_assoc

protected

Temporarily stores association parameter to be available for the run() method.

run() will set the pointer immediately to NULL; the deletion takes place inside the actual worker m_worker which starts its operation afterwards in run().

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

- dcmnet/include/dcmtk/dcmnet/scppool.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0