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

cfg::Exception Class Reference

Exceptions thrown by the Config package. More...

#include <Exception.h>

List of all members.

Public Types

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

Public Member Functions

 Exception (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 13 of file fmwk/Config/Exception.h.


Member Enumeration Documentation

enum cfg::Exception::ECode_t
 

Enumeration values:
kUnknown 
kTypeMismatch 
kConfigRO 
kParamNotFound 
kConfigNotFound 

Definition at line 15 of file fmwk/Config/Exception.h.

00015                  {
00016       kUnknown,
00017       kTypeMismatch,
00018       kConfigRO,
00019       kParamNotFound,
00020       kConfigNotFound
00021     } ECode_t;


Constructor & Destructor Documentation

cfg::Exception::Exception 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 Exception.cxx.

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


Member Function Documentation

void cfg::Exception::Print  ) 
 

Definition at line 22 of file Exception.cxx.

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

00023 {
00024   std::cout << "cfg::Exception: ";
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 cfg::Config ";
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 cfg::Exception::fCode
 

Error code (see enum above).

Definition at line 28 of file fmwk/Config/Exception.h.

Referenced by Print().

const char* cfg::Exception::fFile
 

File name where error is reported.

Definition at line 30 of file fmwk/Config/Exception.h.

int cfg::Exception::fLine
 

Line number reporting error.

Definition at line 31 of file fmwk/Config/Exception.h.

const char* cfg::Exception::fMessage
 

Text message describing error.

Definition at line 29 of file fmwk/Config/Exception.h.

Referenced by Print().


The documentation for this class was generated from the following files:
Generated on Fri Jul 25 02:05:52 2008 for NOvA Offline by doxygen 1.3.5