CfgException Class Reference

Exceptions thrown by the Config package. More...

#include <CfgException.h>

List of all members.

Public Types

 kUnknown
 kTypeMismatch
 kConfigRO
 kParamNotFound
enum  ECode_t { kUnknown, kTypeMismatch, kConfigRO, kParamNotFound }

Public Member Functions

 CfgException (ECode_t ec, const char *message, const char *file, int line)
 Construct a description of the error which occured.
void Print ()

Public Attributes

ECode_t fCode
 Error code (see enum above).
const char * fMessage
 Text message describing error.
const char * fFile
 File name where error is reported.
int fLine
 Line number reporting error.


Detailed Description

Exceptions thrown by the Config package.

Definition at line 11 of file CfgException.h.


Member Enumeration Documentation

enum CfgException::ECode_t

Enumerator:
kUnknown 
kTypeMismatch 
kConfigRO 
kParamNotFound 

Definition at line 14 of file CfgException.h.

00014                {
00015     kUnknown,
00016     kTypeMismatch,
00017     kConfigRO,
00018     kParamNotFound
00019   } ECode_t;


Constructor & Destructor Documentation

CfgException::CfgException ( ECode_t  ec,
const char *  message,
const char *  file,
int  line 
)

Construct a description of the error which occured.

Definition at line 11 of file CfgException.cxx.

00012                                            :
00013   fCode(ec),
00014   fMessage(message),
00015   fFile(file),
00016   fLine(line)
00017 {
00018 }


Member Function Documentation

void CfgException::Print (  ) 

Definition at line 22 of file CfgException.cxx.

References fCode, fMessage, kConfigRO, kParamNotFound, and kTypeMismatch.

Referenced by CfgConfigEditor::Apply(), CfgConfigBuilder::Publish(), and CfgObserver::SetWatch().

00023 {
00024   std::cout << "CfgException: ";
00025   switch (fCode) {
00026   case kTypeMismatch:
00027     std::cout << "type mismatch of parameter ";
00028     break;
00029 
00030   case kConfigRO:
00031     std::cout << "request for write access to read-only CfgConfig ";
00032     break;
00033     
00034   case kParamNotFound:
00035     std::cout << "missing parameter ";
00036     break;
00037 
00038   default:
00039     std::cout << "unknown error! ";
00040     break;
00041   }
00042   std::cout << fMessage << std::endl;
00043 }


Member Data Documentation

ECode_t CfgException::fCode

Error code (see enum above).

Definition at line 26 of file CfgException.h.

Referenced by Print().

const char* CfgException::fFile

File name where error is reported.

Definition at line 28 of file CfgException.h.

int CfgException::fLine

Line number reporting error.

Definition at line 29 of file CfgException.h.

const char* CfgException::fMessage

Text message describing error.

Definition at line 27 of file CfgException.h.

Referenced by Print().


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 08:04:00 2009 for MIPP(E907) by  doxygen 1.4.7