This is Unofficial EPICS BASE Doxygen Site
epics::pvData::BaseException Class Reference

Base for pvData exceptions. More...

#include "epicsException.h"

+ Inheritance diagram for epics::pvData::BaseException:
+ Collaboration diagram for epics::pvData::BaseException:

Public Member Functions

 BaseException (const std::string &msg)
 
virtual ~BaseException () throw ()
 
virtual const char * what () const throw ()
 

Detailed Description

Base for pvData exceptions.

Definition at line 205 of file epicsException.h.

Constructor & Destructor Documentation

epics::pvData::BaseException::BaseException ( const std::string &  msg)
inlineexplicit

Constructor.

Definition at line 210 of file epicsException.h.

210 : std::logic_error(msg) {}
virtual epics::pvData::BaseException::~BaseException ( )
throw (
)
inlinevirtual

Destructor.

Definition at line 215 of file epicsException.h.

215 {};

Member Function Documentation

const char * epics::pvData::BaseException::what ( ) const
throw (
)
virtual

Reason for excepton.

Definition at line 62 of file epicsException.cpp.

63 {
64  try{
65  if (base_msg.size()==0) {
66  const char *base=std::logic_error::what();
67  string out, stack;
68 
69  const ExceptionMixin *info=dynamic_cast<const ExceptionMixin*>(this);
70  if(info) {
71  stack=info->show();
72  }
73 
74  out.reserve(strlen(base)+1+stack.size()+1);
75 
76  out+=base;
77  out+="\n";
78  if(info) {
79  out+=stack;
80  out+="\n";
81  }
82 
83  base_msg.swap(out);
84  }
85  return base_msg.c_str();
86  } catch(std::bad_alloc&) {
87  return "BaseException::what - Insufficient memory to construct message";
88  } catch(...) {
89  return "BaseException::what - Unknown error when constructing message";
90  }
91 }
int * base
Definition: flex.c:92

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