gdcmTrace.h File Reference
`#include "gdcmTypes.h"`
`#include "gdcmSystem.h"`
`#include <iosfwd>`
`#include <cassert>`
Include dependency graph for gdcmTrace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes

class | gdcm::Trace
| Trace. More...

## Namespaces

namespace | gdcm

## Macros

#define | GDCM_FUNCTION "<unknown>"
#define | gdcmAssertAlwaysMacro(arg)
| AssertAlways.
#define | gdcmAssertMacro(arg)
| Assert.
#define | gdcmDebugMacro(msg)
| Debug.
#define | gdcmErrorMacro(msg)
| Error this is pretty bad, more than just warning It could mean lost of data, something not handle...
#define | gdcmWarningMacro(msg)
| Warning.

## Macro Definition Documentation

## GDCM_FUNCTION

#define GDCM_FUNCTION "<unknown>"

## gdcmAssertAlwaysMacro

#define gdcmAssertAlwaysMacro | ( |  | arg | ) |

Value:
gdcmAssertMacro(arg)
gdcmAssertMacro
#define gdcmAssertMacro(arg)
Assert.
Definition gdcmTrace.h:189

AssertAlways.

Parameters

  arg | argument to test An easy solution to pass also a message is to do: gdcmAssertMacro( "my message" && 2 < 3 )

Referenced by gdcm::DataElement::GetValue(), gdcm::DataElement::GetValue(), gdcm::BasicOffsetTable::Read(), gdcm::SequenceOfFragments::ReadValue(), gdcm::DataSet::Replace(), gdcm::DataSet::ReplaceEmpty(), and gdcm::VR::Write().

## gdcmAssertMacro

#define gdcmAssertMacro | ( |  | arg | ) |

Value:
{ \
if( !(arg) ) \
{ \
std::ostringstream osmacro; \
osmacro << "Assert: In " __FILE__ ", line " << __LINE__ \
<< ", function " << GDCM_FUNCTION \
<< "\n\n"; \
std::ostream &_os = gdcm::Trace::GetErrorStream(); \
_os << osmacro.str() << std::endl; \
assert ( arg ); \
} \
} \
GDCM_NOOP_STATEMENT
gdcm::Trace::GetErrorStream
static std::ostream & GetErrorStream()
GDCM_NOOP_STATEMENT
#define GDCM_NOOP_STATEMENT
Definition gdcmLegacyMacro.h:57
GDCM_FUNCTION
#define GDCM_FUNCTION
Definition gdcmTrace.h:109

Assert.

Parameters

  arg | argument to test An easy solution to pass also a message is to do: gdcmAssertMacro( "my message" && 2 < 3 )

Referenced by gdcm::PixelFormat::SetSamplesPerPixel().

## gdcmDebugMacro

#define gdcmDebugMacro | ( |  | msg | ) |

Value:
{ \
if( gdcm::Trace::GetDebugFlag() ) \
{ \
std::ostringstream osmacro; \
osmacro << "Debug: In " __FILE__ ", line " << __LINE__ \
<< ", function " << GDCM_FUNCTION << '\n' \
<< "Last system error was: " \
<< gdcm::System::GetLastSystemError() << '\n' << msg; \
std::ostream &_os = gdcm::Trace::GetDebugStream(); \
_os << osmacro.str() << "\n\n" << std::endl; \
} \
} \
GDCM_NOOP_STATEMENT
gdcm::System::GetLastSystemError
static const char * GetLastSystemError()
Return the last error.
gdcm::Trace::GetDebugStream
static std::ostream & GetDebugStream()
gdcm::Trace::GetDebugFlag
static bool GetDebugFlag()

Debug.

Parameters

  msg | message part

Referenced by gdcm::OpenSSLCryptoFactory::OpenSSLCryptoFactory(), gdcm::OpenSSLP7CryptoFactory::OpenSSLP7CryptoFactory(), gdcm::Item::Read(), gdcm::SequenceOfItems::Read(), gdcm::VR::Read(), gdcm::SequenceOfFragments::ReadPreValue(), and gdcm::SequenceOfFragments::ReadValue().

## gdcmErrorMacro

#define gdcmErrorMacro | ( |  | msg | ) |

Value:
{ \
if( gdcm::Trace::GetErrorFlag() ) \
{ \
std::ostringstream osmacro; \
osmacro << "Error: In " __FILE__ ", line " << __LINE__ \
<< ", function " << GDCM_FUNCTION << '\n' \
<< msg << "\n\n"; \
std::ostream &_os = gdcm::Trace::GetErrorStream(); \
_os << osmacro.str() << std::endl; \
} \
} \
GDCM_NOOP_STATEMENT
gdcm::Trace::GetErrorFlag
static bool GetErrorFlag()

Error this is pretty bad, more than just warning It could mean lost of data, something not handle...

Parameters

  msg | second message part

Referenced by gdcm::CommandDataSet::Insert(), gdcm::DataSet::Insert(), gdcm::FileMetaInformation::Insert(), gdcm::Item::Read(), and gdcm::Fragment::ReadBacktrack().

## gdcmWarningMacro

#define gdcmWarningMacro | ( |  | msg | ) |

Value:
{ \
if( gdcm::Trace::GetWarningFlag() ) \
{ \
std::ostringstream osmacro; \
osmacro << "Warning: In " __FILE__ ", line " << __LINE__ \
<< ", function " << GDCM_FUNCTION << "\n" \
<< msg << "\n\n"; \
std::ostream &_os = gdcm::Trace::GetWarningStream(); \
_os << osmacro.str() << std::endl; \
} \
} \
GDCM_NOOP_STATEMENT
gdcm::Trace::GetWarningFlag
static bool GetWarningFlag()
gdcm::Trace::GetWarningStream
static std::ostream & GetWarningStream()

Warning.

Parameters

  msg | message part

Referenced by gdcm::DataSet::InsertDataElement(), gdcm::Item::Read(), gdcm::SequenceOfItems::Read(), gdcm::Fragment::ReadBacktrack(), gdcm::Fragment::ReadValue(), gdcm::SequenceOfFragments::ReadValue(), gdcm::OpenSSLP7CryptographicMessageSyntax::SetPassword(), and gdcm::Item::Write().