DCMTK: FGInterface::ThreadedFGWriter Struct Reference

DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
FGInterface::ThreadedFGWriter Struct Reference

Threaded functional group writer, used to write per-frame functional groups in parallel. More...

Inheritance diagram for FGInterface::ThreadedFGWriter:

## Public Member Functions
void | init (OFVector< OFPair< Uint32, FunctionalGroups * > > *frameGroups, OFVector< DcmItem * > *perFrameResultItems, OFMutex *perFrameResultItemsMutex, const Uint32 startFrame, const Uint32 endFrame, OFConditionConst *errorOccurred, OFMutex *errorMutex)
| Initialize the thread.
| ThreadedFGWriter ()
| Default constructor.
| ~ThreadedFGWriter ()
| Destructor, nothing to do.
void | run ()
| Run method, called by OFThread::start() This method will write the functional groups for the frames assigned to this thread to the output vector.
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.

## Public Attributes
OFVector< OFPair< Uint32, FunctionalGroups * > > * | m_frameGroups
| Vector of pairs of frame number and functional groups to write for that frame.
OFVector< DcmItem * > * | m_perFrameResultItems
| Output vector, where the per-frame items are written to (one item per frame containing all functional groups for that frame).
OFMutex * | m_perFrameResultItemsMutex
| Mutex to protect the output vector.
Uint32 | m_startFrame
| Start frame this thread should handle (inclusive, starts with 0).
Uint32 | m_endFrame
| End frame this thread should handle (exclusive, i.e. the last frame this thread handles is m_endFrame - 1).
OFMutex * | m_errorMutex
| Mutex to protect error output.
OFConditionConst * | m_errorOccurred
| Pointer to a condition variable that is set if an error occurs during writing.

## 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

Threaded functional group writer, used to write per-frame functional groups in parallel.

Each thread gets assigned some frames and writes the functional groups for those frames to the output vector.

## Member Function Documentation

## ◆ init()

void FGInterface::ThreadedFGWriter::init | ( | OFVector< OFPair< Uint32, FunctionalGroups * > > * | frameGroups,
|  | OFVector< DcmItem * > * | perFrameResultItems,
|  | OFMutex * | perFrameResultItemsMutex,
|  | const Uint32 | startFrame,
|  | const Uint32 | endFrame,
|  | OFConditionConst * | errorOccurred,
|  | OFMutex * | errorMutex )

Initialize the thread.

Parameters

  frameGroups | Input vector of pairs of frame number and functional groups to write for that frame
  perFrameResultItems | Output vector, where the per-frame items are written to, (frame number as index, one item per frame containing all functional groups for that frame).
  perFrameResultItemsMutex | Mutex to protect the output vector
  startFrame | Start frame this thread should handle (inclusive, starts with 0)
  endFrame | End frame this thread should handle (exclusive, i.e. the last frame this thread handles is m_endFrame - 1)
  errorOccurred | Pointer to a condition variable that is set if an error occurs
  errorMutex | Mutex to protect error output

## ◆ run()

void FGInterface::ThreadedFGWriter::run | ( |  | ) |
| virtual

Run method, called by OFThread::start() This method will write the functional groups for the frames assigned to this thread to the output vector.

It will stop in case of an error and set the error condition variable to indicate that an error occurred.

Implements OFThread.

## Member Data Documentation

## ◆ m_errorOccurred

OFConditionConst* FGInterface::ThreadedFGWriter::m_errorOccurred

Pointer to a condition variable that is set if an error occurs during writing.

This is used to signal the main thread that an error occurred during writing. The main thread can then check the error condition variable to see if an error occurred and handle it accordingly.

## ◆ m_perFrameResultItems

OFVector<DcmItem*>* FGInterface::ThreadedFGWriter::m_perFrameResultItems

Output vector, where the per-frame items are written to (one item per frame containing all functional groups for that frame).

The vector is resized to the total number of frames before starting the threads.

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

- dcmfg/include/dcmtk/dcmfg/fginterface.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.16.1