DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
DSRTemplateCommon Class Reference

Class managing common information on an SR template. More...

Inheritance diagram for DSRTemplateCommon:

## Public Member Functions
virtual void | clear ()
| clear non-static member variables
virtual OFBool | hasTemplateIdentification () const
| check whether template identification is set
virtual OFBool | isTemplateIdentificationValid (const OFBool check=OFTrue) const
| check whether template identification is valid
virtual OFBool | isExtensible () const
| check whether template is extensible
virtual OFBool | isOrderSignificant () const
| check whether the order of content items in this template is significant
virtual OFBool | compareTemplateIdentication (const OFString &templateIdentifier, const OFString &mappingResource, const OFString &mappingResourceUID="") const
| compare template identification with given values
const OFString & | getTemplateIdentifier () const
| get template identifier
const OFString & | getMappingResource () const
| get mapping resource
const OFString & | getMappingResourceUID () const
| get optional mapping resource UID
virtual void | setExtensible (const OFBool mode=OFTrue)
| change mode specifying whether the template is extensible or non-extensible
virtual void | setOrderSignificant (const OFBool mode=OFTrue)
| change mode specifying whether the order of content items in this template is significant or non-significant

## Protected Member Functions
| DSRTemplateCommon (const OFString &templateIdentifier, const OFString &mappingResource, const OFString &mappingResourceUID="")
| constructor
virtual | ~DSRTemplateCommon ()
| destructor
void | clearEntriesInNodeList ()
| clear all entries in the list of node IDs, i.e. set them to their initial value, which is 0
void | reserveEntriesInNodeList (const size_t count, const OFBool initialize=OFFalse)
| reserve a certain number of entries in the list of node IDs.
void | storeEntryInNodeList (const size_t pos, const size_t nodeID)
| store given entry at a certain position in the list of node IDs
size_t | getEntryFromNodeList (const size_t pos) const
| get a particular entry from the list of node IDs
size_t | gotoEntryFromNodeList (DSRDocumentTreeNodeCursor &cursor, const size_t pos) const
| set given cursor to a specific node
size_t | gotoEntryFromNodeList (DSRDocumentSubTree *tree, const size_t pos)
| set internal cursor of a given document tree to a specific node
size_t | gotoLastEntryFromNodeList (DSRDocumentSubTree *tree, const size_t lastPos, const size_t firstPos=0)
| set internal cursor of a given document tree to a particular node.

## Private Attributes
const OFString | TemplateIdentifier
| template identifier (VR=CS, mandatory)
const OFString | MappingResource
| mapping resource (VR=CS, mandatory)
const OFString | MappingResourceUID
| mapping resource UID (VR=UI, optional)
OFBool | ExtensibleMode
| mode indicating whether template is extensible (default: false)
OFBool | OrderSignificantMode
| mode indicating whether the order of content items in this template is significant (default: false)
OFVector< size_t > | NodeList
| list of node IDs used to remember certain positions in the template

## Detailed Description

Class managing common information on an SR template.

This class is used as a base class only.

## Constructor & Destructor Documentation

## ◆ DSRTemplateCommon()

DSRTemplateCommon::DSRTemplateCommon | ( | const OFString & | templateIdentifier,
|  | const OFString & | mappingResource,
|  | const OFString & | mappingResourceUID = "" )
| protected

constructor

Parameters

  templateIdentifier | identifier of the template
  mappingResource | mapping resource that defines the template
  mappingResourceUID | uniquely identifies the mapping resource (optional)

## Member Function Documentation

## ◆ compareTemplateIdentication()

virtual OFBool DSRTemplateCommon::compareTemplateIdentication | ( | const OFString & | templateIdentifier,
|  | const OFString & | mappingResource,
|  | const OFString & | mappingResourceUID = "" ) const
| virtual

compare template identification with given values

Parameters

  templateIdentifier | template identifier to compare with
  mappingResource | mapping resource that defines the template
  mappingResourceUID | uniquely identifies the mapping resource (optional). Not used for comparison if the value is empty.

Returns
  OFTrue if template identification is identical, OFFalse otherwise

## ◆ getEntryFromNodeList()

size_t DSRTemplateCommon::getEntryFromNodeList | ( | const size_t | pos | ) | const
| protected

get a particular entry from the list of node IDs

Parameters

  pos | index of the list entry to retrieve (starting from 0)

Returns
  node ID that is stored at the given position, 0 if not found or set

## ◆ getMappingResource()

const OFString & DSRTemplateCommon::getMappingResource | ( |  | ) | const
| inline

get mapping resource

Returns
  mapping resource that defines the template

References MappingResource.

## ◆ getMappingResourceUID()

const OFString & DSRTemplateCommon::getMappingResourceUID | ( |  | ) | const
| inline

get optional mapping resource UID

Returns
  unique identifier of the mapping resource (might be empty)

References MappingResourceUID.

## ◆ getTemplateIdentifier()

const OFString & DSRTemplateCommon::getTemplateIdentifier | ( |  | ) | const
| inline

get template identifier

Returns
  identifier of the template

References TemplateIdentifier.

## ◆ gotoEntryFromNodeList() [1/2]

size_t DSRTemplateCommon::gotoEntryFromNodeList | ( | DSRDocumentSubTree * | tree,
|  | const size_t | pos )
| protected

set internal cursor of a given document tree to a specific node

Parameters

  tree | pointer to document tree where nodes and cursor are stored
  pos | index of the list entry that stores the ID of the node

Returns
  ID of the new current node within the tree if successful, 0 otherwise

## ◆ gotoEntryFromNodeList() [2/2]

size_t DSRTemplateCommon::gotoEntryFromNodeList | ( | DSRDocumentTreeNodeCursor & | cursor,
|  | const size_t | pos ) const
| protected

set given cursor to a specific node

Parameters

  cursor | reference to document tree node cursor that is used to start searching the node from and that is set afterwards
  pos | index of the list entry that stores the ID of the node

Returns
  ID of the new current node within the tree if successful, 0 otherwise

## ◆ gotoLastEntryFromNodeList()

size_t DSRTemplateCommon::gotoLastEntryFromNodeList | ( | DSRDocumentSubTree * | tree,
|  | const size_t | lastPos,
|  | const size_t | firstPos = 0 )
| protected

set internal cursor of a given document tree to a particular node.

The node is determined from the list of node IDs, starting from the entry specified by the parameter 'lastPos'. The reverse search stops if either an entry with a non-zero value (valid node ID) is found or the first list entry is reached. This approach in particular supports handling of template tables where the order of content items is significant.

Parameters

  tree | pointer to document tree where nodes and cursor are stored
  lastPos | index of the last node list entry to start searching from
  firstPos | optional index of the node list entry to stop searching

Returns
  ID of the new current node within the tree if successful, 0 otherwise

## ◆ hasTemplateIdentification()

virtual OFBool DSRTemplateCommon::hasTemplateIdentification | ( |  | ) | const
| virtual

check whether template identification is set

Returns
  OFTrue if set, OFFalse otherwise

## ◆ isExtensible()

virtual OFBool DSRTemplateCommon::isExtensible | ( |  | ) | const
| inline virtual

check whether template is extensible

Returns
  OFTrue if extensible, OFFalse otherwise

References ExtensibleMode.

## ◆ isOrderSignificant()

virtual OFBool DSRTemplateCommon::isOrderSignificant | ( |  | ) | const
| inline virtual

check whether the order of content items in this template is significant

Returns
  OFTrue if order is significant, OFFalse otherwise

References OrderSignificantMode.

## ◆ isTemplateIdentificationValid()

virtual OFBool DSRTemplateCommon::isTemplateIdentificationValid | ( | const OFBool | check = OFTrue | ) | const
| virtual

check whether template identification is valid

Parameters

  check | check internally stored values for conformance with VR and VM if enabled

Returns
  OFTrue if valid, OFFalse otherwise

## ◆ reserveEntriesInNodeList()

void DSRTemplateCommon::reserveEntriesInNodeList | ( | const size_t | count,
|  | const OFBool | initialize = OFFalse )
| protected

reserve a certain number of entries in the list of node IDs.

Using this method can help to avoid unwanted memory allocations and copying of list entries.

Parameters

  count | number of entries to be reserved (for later use)
  initialize | initialize all entries with a value of 0 if OFTrue, just reserve but do not create them otherwise (default)

## ◆ setExtensible()

virtual void DSRTemplateCommon::setExtensible | ( | const OFBool | mode = OFTrue | ) |
| inline virtual

change mode specifying whether the template is extensible or non-extensible

Parameters

  mode | set template type to extensible if OFTrue (default)

References ExtensibleMode.

## ◆ setOrderSignificant()

virtual void DSRTemplateCommon::setOrderSignificant | ( | const OFBool | mode = OFTrue | ) |
| inline virtual

change mode specifying whether the order of content items in this template is significant or non-significant

Parameters

  mode | set order of content items to significant if OFTrue (default)

References OrderSignificantMode.

## ◆ storeEntryInNodeList()

void DSRTemplateCommon::storeEntryInNodeList | ( | const size_t | pos,
|  | const size_t | nodeID )
| protected

store given entry at a certain position in the list of node IDs

Parameters

  pos | index of the list entry to use for storage (starting from 0)
  nodeID | ID of the node that should be stored at the given position

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

- dcmsr/include/dcmtk/dcmsr/dsrctpl.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2