Loading...
Searching...
No Matches
OFCondition Class Reference

General purpose class for condition codes. More...

## Public Member Functions

| OFCondition (unsigned short aModule, unsigned short aCode, OFStatus aStatus, const char *aText)
| constructor for condition code with text
| OFCondition (const OFConditionConst &aConst=EC_Normal)
| constructor for condition code from constant data
| OFCondition (const OFCondition &arg)
| copy constructor
| ~OFCondition ()
| destructor
OFCondition & | operator= (const OFCondition &arg)
| copy assignment operator
unsigned short | module () const
| get the module identifier for this object.
unsigned short | code () const
| get the status code identifier for this object.
OFStatus | status () const
| get the error status this object represents.
const char * | text () const
| get a human readable text representation of this error code.
const OFConditionConst & | condition () const
| internal function only, don't use yourself.
OFBool | good () const
| check if the status is OK.
OFBool | bad () const
| check if the status is not OK, i.e. error or failure.
OFBool | operator== (const OFCondition &arg) const
| comparison operator.
OFBool | operator!= (const OFCondition &arg) const
| comparison operator.

## Private Attributes

OFConditionConst | theCondition
| The condition information.
OFBool | ownsText
| Does theCondition.theText point to our own heap string which must be freed?

## Detailed Description

General purpose class for condition codes.

Objects of this class can be efficiently passed by value. To make this possible, the contained string is not copied when possible.

## Constructor & Destructor Documentation

## OFCondition() [1/3]

OFCondition::OFCondition | ( | unsigned short | aModule,
|  | unsigned short | aCode,
|  | OFStatus | aStatus,
|  | const char * | aText )

inline

constructor for condition code with text

Parameters

  aModule | module identifier. 0 is reserved for global codes, other constants are defined elsewhere.
  aCode | status code that is unique for each module
  aStatus | condition status enum
  aText | error text.

References ownsText, and theCondition.

Referenced by OFCondition(), operator!=(), operator=(), and operator==().

## OFCondition() [2/3]

OFCondition::OFCondition | ( | const OFConditionConst & | aConst = EC_Normal | ) |

inline

constructor for condition code from constant data

Parameters

  aConst | OFConditionConst to use

References EC_Normal, ownsText, and theCondition.

## OFCondition() [3/3]

OFCondition::OFCondition | ( | const OFCondition & | arg | ) |

inline

copy constructor

Parameters

  arg | OFCondition to copy

References OFCondition(), ownsText, and theCondition.

## Member Function Documentation

## bad()

OFBool OFCondition::bad | ( |  | ) | const

inline

check if the status is not OK, i.e. error or failure.

Returns
  true if status is not OK, else false

References OF_ok, and theCondition.

Referenced by DcmSegmentation::addFrame(), DcmIODUtil::copyFromUint8Array(), and DcmIODUtil::writeSubSequence().

## code()

unsigned short OFCondition::code | ( |  | ) | const

inline

get the status code identifier for this object.

This uniquely identifies the error code within the module.

Returns
  the status code identifier for this object.

See also
  module()

References theCondition.

## condition()

const OFConditionConst & OFCondition::condition | ( |  | ) | const

inline

internal function only, don't use yourself.

Returns
  an equivalent OFConditionConst for this object.

References theCondition.

Referenced by operator!=(), operator!=(), operator==(), and operator==().

## good()

OFBool OFCondition::good | ( |  | ) | const

inline

check if the status is OK.

Returns
  true if status is OK, else false

References OF_ok, and theCondition.

Referenced by DcmSegmentation::addFrame(), DcmSegmentation::addFrame(), CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::checkMeasurementUnit(), DiInputPixelTemplate< T1, T2 >::convert(), DcmIODUtil::copyFromUint8Array(), FrameSorterIPP::getSliceDirection(), DRTSearch::searchPropertyEqual< IOD, Item, type, arg2, argument2 >::operator()(), DcmIODUtil::readSubSequence(), DcmIODUtil::setContentDateAndTimeNow(), CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setMeasurementUnit(), CMR_SRNumericMeasurementValueWithUnits< T_Units, T_DefinedGroup >::setValue(), FrameSorterIPP::sort(), DcmIODImage<>::write(), DcmIODUtil::writeSingleItem(), DcmIODUtil::writeSingleItem(), DcmIODUtil::writeSubSequence(), and DcmIODUtil::writeSubSequence().

## module()

unsigned short OFCondition::module | ( |  | ) | const

inline

get the module identifier for this object.

Returns
  the module identifier for this object.

See also
  code()

References theCondition.

## operator!=()

OFBool OFCondition::operator!= | ( | const OFCondition & | arg | ) | const

inline

comparison operator.

Compares status, code and module but not error text.

Parameters

  arg | error to compare to

Returns
  true if equal, false otherwise

References OFCondition(), and theCondition.

## operator=()

OFCondition & OFCondition::operator= | ( | const OFCondition & | arg | ) |

inline

copy assignment operator

Parameters

  arg | The OFCondition instance to copy

Returns
  *this

References OFCondition(), ownsText, theCondition, and OFConditionConst::theText.

## operator==()

OFBool OFCondition::operator== | ( | const OFCondition & | arg | ) | const

inline

comparison operator.

Compares status, code and module but not error text.

Parameters

  arg | error to compare to

Returns
  true if equal, false otherwise

References OFCondition(), and theCondition.

## status()

OFStatus OFCondition::status | ( |  | ) | const

inline

get the error status this object represents.

Returns
  the status for this object.

References theCondition.

## text()

const char * OFCondition::text | ( |  | ) | const

inline

get a human readable text representation of this error code.

The returned string is owned by this OFCondition instance and must not be modified or freed.

Returns
  the error message text for this object.

References theCondition.

Referenced by DcmSegmentation::addFrame(), DiInputPixelTemplate< T1, T2 >::convert(), DcmIODUtil::readSubSequence(), and DcmIODUtil::writeSubSequence().

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

- ofstd/include/dcmtk/ofstd/ofcond.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0