Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

gdcmDebug.h File Reference

#include "gdcmCommon.h"
#include "gdcmCommand.h"
#include <iostream>
#include <sstream>
#include <fstream>
#include <assert.h>
#include <errno.h>

Include dependency graph for gdcmDebug.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  gdcm

Classes

class  gdcm::Debug
 Debug is an object for warning/logging/tracing programs. It has the following modes :
  • error : for bad library use, seriously wrong DICOM
  • debug : for information/debug messages
  • warning : Warns the user when some oddity occured.
  • log : we display messages when anything is not Dicom Kosher
  • debug : we help developper to trace, at a glance, the execution
  • assert : design by contract implementation. A function should have proper input and proper output. (should not happen, not user controlled).
More...

Defines

#define GDCM_FUNCTION   "<unknow>"
#define gdcmMessageBodyMacro(type, obj, msg, adds)
 Debug : To be used to help bug tracking developer.
#define gdcmDebugBodyMacro(obj, msg)
 Debug : To be used to help bug tracking developer.
#define gdcmDebugMacro(msg)   gdcmDebugBodyMacro(NULL,msg)
#define gdcmStaticDebugMacro(msg)   gdcmDebugBodyMacro(NULL,msg)
#define gdcmLogBodyMacro(obj, msg)
 Log : we display messages when anything is not Dicom Kosher.
#define gdcmLogMacro(msg)   gdcmLogBodyMacro(this,msg)
#define gdcmStaticLogMacro(msg)   gdcmLogBodyMacro(NULL,msg)
#define gdcmWarningBodyMacro(obj, msg)
 Warning : To be used to warn the user when some oddity occurs.
#define gdcmWarningMacro(msg)   gdcmWarningBodyMacro(this,msg)
#define gdcmStaticWarningMacro(msg)   gdcmWarningBodyMacro(NULL,msg)
#define gdcmErrorBodyMacro(obj, msg)
 Error : To be used when unecoverabale error occurs at a 'deep' level. (don't use it if file is not ACR/DICOM!).
#define gdcmErrorMacro(msg)   gdcmErrorBodyMacro(this,msg)
#define gdcmStaticErrorMacro(msg)   gdcmErrorBodyMacro(NULL,msg)
#define gdcmAssertBodyMacro(obj, arg)
 Assert : To be used when an *absolutely* impossible error occurs No function should be allowed to stop the process instead of warning the caller!
#define gdcmAssertMacro(msg)   gdcmAssertBodyMacro(NULL,msg)
#define gdcmStaticAssertMacro(msg)   gdcmAssertBodyMacro(NULL,msg)


Define Documentation

#define GDCM_FUNCTION   "<unknow>"
 

Definition at line 157 of file gdcmDebug.h.

#define gdcmAssertBodyMacro obj,
arg   ) 
 

Value:

{                                                              \
   if( !(arg) )                                                \
   {                                                           \
      gdcmMessageBodyMacro(gdcm::CMD_ASSERT,obj,"","");        \
      assert ( arg );                                          \
   }                                                           \
}
Assert : To be used when an *absolutely* impossible error occurs No function should be allowed to stop the process instead of warning the caller!

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

Definition at line 270 of file gdcmDebug.h.

#define gdcmAssertMacro msg   )     gdcmAssertBodyMacro(NULL,msg)
 

Definition at line 278 of file gdcmDebug.h.

Referenced by gdcm::Util::DicomString(), gdcm::DocEntry::DocEntry(), gdcm::FileHelper::FileHelper(), gdcm::RLEFrame::GetLength(), gdcm::DictSet::GetNextDict(), gdcm::ElementSet::GetNextEntry(), gdcm::Dict::GetNextEntry(), gdcm::JPEGFragmentsInfo::GetNextFragment(), gdcm::RLEFramesInfo::GetNextFrame(), gdcm::DicomDirSerie::GetNextImage(), gdcm::DicomDir::GetNextPatient(), gdcm::DicomDirStudy::GetNextSerie(), gdcm::SerieHelper::GetNextSingleSerieUIDFileSet(), gdcm::SeqEntry::GetNextSQItem(), gdcm::DicomDirPatient::GetNextStudy(), gdcm::DicomDirStudy::GetNextVisit(), gdcm::RLEFrame::GetOffset(), gdcm::Orientation::GetOrientationType(), gdcm::PixelReadConvert::ReadAndDecompressJPEGFile(), gdcm::RLEFrame::SetLength(), gdcm::RLEFrame::SetOffset(), and gdcm::DocEntry::~DocEntry().

#define gdcmDebugBodyMacro obj,
msg   ) 
 

Value:

{                                                              \
   if( Debug::GetDebugFlag() )                                 \
   {                                                           \
      std::string adds="";                                     \
      if( errno )                                              \
      {                                                        \
         adds = "Last system error was: ";                     \
         adds += strerror(errno);                              \
         adds += "\n";                                         \
      }                                                        \
      gdcmMessageBodyMacro(gdcm::CMD_DEBUG,obj,msg,adds);      \
   }                                                           \
}
Debug : To be used to help bug tracking developer.

Parameters:
msg message part

Definition at line 184 of file gdcmDebug.h.

#define gdcmDebugMacro msg   )     gdcmDebugBodyMacro(NULL,msg)
 

Definition at line 198 of file gdcmDebug.h.

Referenced by gdcm::SerieHelper::AddFileName(), gdcm::SerieHelper::AddGdcmFile(), gdcm::Document::Backtrack(), gdcm::PixelReadConvert::BuildLUTRGBA(), gdcm::PixelReadConvert::BuildRGBImage(), gdcm::Document::CheckSwap(), gdcm::Util::CompareDicomString(), gdcm::PixelReadConvert::ConvertHandleColor(), gdcm::DicomDir::CreateDicomDir(), gdcm::DicomDir::CreateDicomDirChainedList(), gdcm::Document::DoTheLoadingDocumentJob(), gdcm::DicomDir::DoTheLoadingJob(), gdcm::File::GetRescaleSlope(), gdcm::Document::GetTransferSyntaxName(), gdcm::Document::HandleBrokenEndian(), gdcm::Document::HandleOutOfGroup0002(), gdcm::File::IsPaletteColor(), gdcm::File::IsYBRFull(), gdcm::Document::LoadEntryBinArea(), gdcm::Document::OpenFile(), gdcm::Document::ParseDES(), gdcm::File::ReadEncapsulatedBasicOffsetTable(), gdcm::File::ReadTagLength(), gdcm::SQItem::RemoveEntry(), gdcm::DicomDir::SetElement(), gdcm::SerieHelper::SplitOnOrientation(), gdcm::SerieHelper::SplitOnPosition(), gdcm::SerieHelper::SplitOnTagValue(), gdcm::Document::SwitchByteSwapCode(), and gdcm::DataEntry::WriteContent().

#define gdcmErrorBodyMacro obj,
msg   ) 
 

Value:

Error : To be used when unecoverabale error occurs at a 'deep' level. (don't use it if file is not ACR/DICOM!).

Parameters:
msg second message part

Definition at line 249 of file gdcmDebug.h.

#define gdcmErrorMacro msg   )     gdcmErrorBodyMacro(this,msg)
 

Definition at line 253 of file gdcmDebug.h.

Referenced by gdcm::Dict::AddEntry(), gdcm::DicomDir::CreateDicomDir(), gdcm::JPEGFragment::DecompressJPEGFramesFromFile(), gdcm::Document::DoTheLoadingDocumentJob(), gdcm::DicomDir::DoTheLoadingJob(), gdcm::DirList::Explore(), gdcm::Orientation::GetOrientationType(), gdcm::Document::GetTransferSyntaxName(), gdcm::DataEntry::GetValue(), gdcm::File::GetXOrigin(), gdcm::File::GetYOrigin(), gdcm::File::GetZOrigin(), gdcm::SerieHelper::ImagePositionPatientOrdering(), gdcm::DicomDir::IsReadable(), gdcm::File::ReadTag(), gdcm::File::ReadTagLength(), gdcm::DicomDir::SetElement(), gdcm::DataEntry::SetValue(), gdcm::Document::SwapDouble(), gdcm::Document::SwapLong(), and gdcm::FileHelper::WriteRawData().

#define gdcmLogBodyMacro obj,
msg   ) 
 

Value:

{                                                              \
   if( Debug::GetLogFlag() )                               \
      gdcmMessageBodyMacro(gdcm::CMD_LOG,obj,msg,"");      \
}
Log : we display messages when anything is not Dicom Kosher.

Parameters:
msg message part

Definition at line 212 of file gdcmDebug.h.

#define gdcmLogMacro msg   )     gdcmLogBodyMacro(this,msg)
 

Definition at line 217 of file gdcmDebug.h.

#define gdcmMessageBodyMacro type,
obj,
msg,
adds   ) 
 

Value:

{                                                              \
   std::ostringstream osmacro;                                 \
   osmacro << "In " __FILE__ ", line " << __LINE__             \
           << ", function " << GDCM_FUNCTION << "\n"           \
           << adds << msg << "\n\n";                           \
   gdcm::Debug::SendToOutput(type,osmacro.str(),obj);          \
}
Debug : To be used to help bug tracking developer.

Parameters:
msg message part

Definition at line 164 of file gdcmDebug.h.

#define gdcmStaticAssertMacro msg   )     gdcmAssertBodyMacro(NULL,msg)
 

Definition at line 280 of file gdcmDebug.h.

#define gdcmStaticDebugMacro msg   )     gdcmDebugBodyMacro(NULL,msg)
 

Definition at line 200 of file gdcmDebug.h.

#define gdcmStaticErrorMacro msg   )     gdcmErrorBodyMacro(NULL,msg)
 

Definition at line 255 of file gdcmDebug.h.

Referenced by gdcm::Util::CreateUniqueUID(), gdcm::gdcm_read_JPEG2000_file(), and gdcm::DirList::IsDirectory().

#define gdcmStaticLogMacro msg   )     gdcmLogBodyMacro(NULL,msg)
 

Definition at line 219 of file gdcmDebug.h.

#define gdcmStaticWarningMacro msg   )     gdcmWarningBodyMacro(NULL,msg)
 

Definition at line 237 of file gdcmDebug.h.

Referenced by gdcm::DictSet::BuildDictPath(), gdcm::Util::GetMACAddress(), and gdcm::Global::Global().

#define gdcmWarningBodyMacro obj,
msg   ) 
 

Value:

{                                                              \
   if( Debug::GetWarningFlag() )                               \
      gdcmMessageBodyMacro(gdcm::CMD_WARNING,obj,msg,"");      \
}
Warning : To be used to warn the user when some oddity occurs.

Parameters:
msg message part

Definition at line 230 of file gdcmDebug.h.

#define gdcmWarningMacro msg   )     gdcmWarningBodyMacro(this,msg)
 

Definition at line 235 of file gdcmDebug.h.

Referenced by gdcm::Dict::AddDict(), gdcm::ElementSet::AddEntry(), gdcm::SerieHelper::AddFileName(), gdcm::File::AnonymizeFile(), gdcm::File::AnonymizeNoLoad(), gdcm::PixelReadConvert::BuildLUTRGBA(), gdcm::FileHelper::CheckMandatoryElements(), gdcm::Document::CheckSwap(), gdcm::FileHelper::CheckWriteIntegrity(), gdcm::File::ComputeJPEGFragmentInfo(), gdcm::File::ComputeRLEInfo(), gdcm::PixelReadConvert::ConvertReArrangeBits(), gdcm::PixelReadConvert::ConvertRGBPlanesToRGBPixels(), gdcm::PixelReadConvert::ConvertSwapZone(), gdcm::PixelReadConvert::ConvertYcBcRPlanesToRGBPixels(), gdcm::DicomDir::CreateDicomDir(), gdcm::SerieHelper::CreateUniqueSeriesIdentifier(), gdcm::DicomDirElement::DicomDirElement(), gdcm::Dict::Dict(), gdcm::DictGroupName::DictGroupName(), gdcm::Document::DoTheLoadingDocumentJob(), gdcm::DicomDir::DoTheLoadingJob(), gdcm::Document::FindDocEntryLength(), gdcm::Document::FindDocEntryLengthOBOrOW(), gdcm::Document::FindDocEntryVR(), gdcm::Document::FixDocEntryFoundLength(), gdcm::gdcm_read_JPEGLS_file(), gdcm::File::GetBitsAllocated(), gdcm::File::GetBitsStored(), gdcm::DocEntrySet::GetDictEntry(), gdcm::File::GetHighBitPosition(), gdcm::File::GetImageOrientationPatient(), gdcm::File::GetPixelAreaLength(), gdcm::File::GetPixelOffset(), gdcm::File::GetPixelSize(), gdcm::File::GetPixelType(), gdcm::FileHelper::GetRaw(), gdcm::File::GetRescaleIntercept(), gdcm::File::GetSamplesPerPixel(), gdcm::Document::GetTransferSyntax(), gdcm::File::GetXOrigin(), gdcm::File::GetXSpacing(), gdcm::File::GetYOrigin(), gdcm::File::GetYSpacing(), gdcm::File::GetZOrigin(), gdcm::File::GetZSpacing(), gdcm::PixelReadConvert::GrabInformationsFromFile(), gdcm::Document::HandleBrokenEndian(), gdcm::Document::HandleOutOfGroup0002(), gdcm::SerieHelper::ImageNumberOrdering(), gdcm::SerieHelper::ImagePositionPatientOrdering(), gdcm::DocEntrySet::InsertEntryBinArea(), gdcm::DocEntrySet::InsertEntryString(), gdcm::DocEntrySet::InsertSeqEntry(), gdcm::Document::IsDocEntryAnInteger(), gdcm::File::IsMonochrome(), gdcm::File::IsMonochrome1(), gdcm::Document::IsParsable(), gdcm::File::IsReadable(), gdcm::DicomDir::IsReadable(), gdcm::File::IsSignedPixelData(), gdcm::Document::Load(), gdcm::Document::LoadEntryBinArea(), gdcm::DocEntrySet::NewDataEntry(), gdcm::DocEntrySet::NewSeqEntry(), gdcm::Document::OpenFile(), gdcm::Document::ParseDES(), gdcm::Document::ParseSQ(), gdcm::SerieHelper::Print(), gdcm::SeqEntry::Print(), gdcm::PixelReadConvert::Print(), gdcm::PixelReadConvert::ReadAndDecompressJPEGFile(), gdcm::PixelReadConvert::ReadAndDecompressPixelData(), gdcm::RLEFrame::ReadAndDecompressRLEFragment(), gdcm::Document::ReadNextDocEntry(), gdcm::File::ReadTag(), gdcm::Dict::RemoveDict(), gdcm::SQItem::RemoveEntry(), gdcm::ElementSet::RemoveEntry(), gdcm::Dict::RemoveEntry(), gdcm::DicomDir::SetElement(), gdcm::DocEntrySet::SetEntryBinArea(), gdcm::DocEntrySet::SetEntryString(), gdcm::SerieHelper::SplitOnPosition(), gdcm::TS::TS(), gdcm::VR::VR(), gdcm::File::Write(), gdcm::DicomDir::Write(), and gdcm::FileHelper::WriteRawData().


Generated on Fri Jan 20 10:14:27 2006 for gdcm by  doxygen 1.4.4