1 #ifndef CARMA_UTIL_BASE_EXCEPTION_H
2 #define CARMA_UTIL_BASE_EXCEPTION_H
34 #include <log4cpp/Priority.hh>
67 virtual const char *
what( )
const throw( );
82 virtual void setMessageToCopy(
const char * mesg );
93 virtual void setMessageToCopy( const ::std::string & mesg );
104 virtual void setMessageToCopy( const ::std::ostringstream & oss );
139 virtual ::std::string getLogString( )
const;
152 void logException( log4cpp::Priority::PriorityLevel priority )
const;
182 const char * fileName,
186 const ::std::string & fileName,
190 const char * fileName,
194 const ::std::string & fileName,
198 const char * fileName,
202 const ::std::string & fileName,
228 void setSourceFileToCopy(
const char * file );
229 void setSourceFileToCopy( const ::std::string & file );
233 void clearSourceFile( );
238 bool weAllocatedMesg_;
239 const char * sourceFile_;
240 bool weAllocatedSourceFile_;
258 #define CARMA_EXCEPTION(x,y) x((y), __FILE__, __LINE__)
268 #define CARMA_TEST( e, ce, m ) \
272 ::std::ostringstream os; \
273 os << "CARMA_TEST FAIL: " << m; \
274 ce error( os, __FILE__, __LINE__); \
275 error.logException(::log4cpp::Priority::ERROR); \
280 #endif // CARMA_UTIL_BASE_EXCEPTION_H
virtual const char * getMessage() const
virtual void setLineNumber(int num)
virtual int getLineNumber() const
void logException(log4cpp::Priority::PriorityLevel priority) const
virtual const char * what() const
void setSourceFileDirectly(const char *file)
Interface file for the carma::util::Backtrace class.
Base exception class for managing carma errors.
Class to hold a captured call stack backtrace.
virtual void setMessageDirectly(const char *mesg)
virtual const char * getSourceFile() const