fdhwlib  2.0.25
PbusError Class Reference

#include <PbusError.h>

List of all members.

Public Member Functions

Private Attributes


Detailed Description

Exeption handling for any PBUS error.

Todo:
Windows has a different implementation of the runtime_error?! Compare the implementation in both systems!
    	explicit runtime_error(const string& _S): exception(""), _Str(_S) {}
 

Definition at line 34 of file PbusError.h.


Constructor & Destructor Documentation

PbusError::PbusError ( unsigned long  addr,
unsigned long  data 
) [inline]

Definition at line 74 of file PbusError.h.

References addr, data, and msg.

                : runtime_error("PbusError")
{
  if ( snprintf(msg,sizeof(msg),"writing %08lx to %08lx",data,addr)
       >= (int)sizeof(msg) )
    msg[sizeof(msg)-1]=0;
  this->addr = addr;
  this->data = data;
}
PbusError::PbusError ( unsigned long  addr) [inline]

Definition at line 85 of file PbusError.h.

References addr, data, and msg.

                 : runtime_error("PbusError")
{
  if ( snprintf(msg, sizeof(msg), "reading %08lx",addr) >= (int)sizeof(msg) )
    msg[sizeof(msg)-1]=0;
   this->addr = addr;
  this->data = 0;
}
PbusError::PbusError ( const char *  msg,
unsigned long  addr = 0,
unsigned long  data = 0 
) [inline]

Definition at line 94 of file PbusError.h.

References addr, data, and msg.

                 : runtime_error(msg)
{
  if ( snprintf(this->msg,sizeof(this->msg),"%s",msg) >= (int)sizeof(this->msg) )
    this->msg[sizeof(this->msg)-1]=0;
  this->addr = addr;
  this->data = data;
}
PbusError::PbusError ( const char *  msg,
const char *  fmt,
  ... 
) [inline]

Member Function Documentation

void PbusError::displayMsg ( FILE *  fout) [inline]

Definition at line 104 of file PbusError.h.

References addr, data, and msg.

                                           {

  if ( strlen(msg) ) fprintf(fout,"PbusError: %s",msg);
  else fprintf(fout, "PbusError: Unspecified access error");
  if (addr > 0) fprintf(fout,", addr=%lx", addr);
  if (data > 0) fprintf(fout,", data=%lx", data);
  fprintf(fout,"\n");
}
unsigned long PbusError::getAddr ( ) const [inline]

Definition at line 47 of file PbusError.h.

References addr.

         { return addr; }
unsigned long PbusError::getData ( ) const [inline]

Definition at line 50 of file PbusError.h.

References data.

         { return data; }
const char* PbusError::getMsg ( ) const [inline]

Definition at line 53 of file PbusError.h.

References msg.

Referenced by what().

                                   {
          if ( *msg ) return msg;
          else return("Unspecified access error");
        }
const char* PbusError::what ( ) const throw () [inline]

Definition at line 58 of file PbusError.h.

References getMsg().

         { return getMsg(); }

Member Data Documentation

unsigned long PbusError::addr [private]

Definition at line 65 of file PbusError.h.

Referenced by displayMsg(), getAddr(), and PbusError().

unsigned long PbusError::data [private]

Definition at line 68 of file PbusError.h.

Referenced by displayMsg(), getData(), and PbusError().

char PbusError::msg[120] [private]

Definition at line 70 of file PbusError.h.

Referenced by displayMsg(), getMsg(), and PbusError().


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