RTC Toolkit  0.1.0-alpha
Classes | Public Types | Public Member Functions | List of all members
elt::error::CiiException Class Reference

Base class for the exceptions thrown by the client API. More...

#include <exceptions.hpp>

Inheritance diagram for elt::error::CiiException:
elt::error::CiiBaseException elt::error::CiiError rtctk::componentFramework::DataPointPath::InvalidPathException

Public Types

typedef std::chrono::system_clock clock_t
 The clock to use for determining the exception creation time. More...
 

Public Member Functions

 CiiException (const std::string &message)
 Constructor. More...
 
template<typename ... Args>
 CiiException (const std::string &formatter, Args ... args)
 Constructor that takes a formatter string and additional parameters to build the exception message. More...
 
virtual ~CiiException ()=default
 Destructor. More...
 
virtual std::string getCiiType () const
 
virtual std::string getCiiMethodName () const
 
virtual std::string getCiiClassName () const
 
virtual std::string getCiiFileName () const
 
virtual std::string getCiiHostName () const
 
virtual std::string getCiiStackTrace () const
 
virtual std::vector< std::string > getCiiExceptionStack () const
 
virtual std::string getCiiMessage () const
 
virtual std::string getCiiDetails () const
 
virtual int64_t getCiiCreationDate () const
 
const std::string GetCiiStackTrace () const noexcept
 
const boost::stacktrace::stacktrace & GetStackTrace () const
 Return the stack trace captured in the exception constructor. More...
 
const boost::stacktrace::stacktrace & GetOriginalStackTrace () const
 Return the stack trace captured in the most nested exception constructor. More...
 
std::string GetStackTraceAsString () const
 Same as GetStackTrace() but convert the trace to a string. More...
 
std::string GetOriginalStackTraceAsString () const
 Same as GetOriginalStackTrace() but convert the trace to a string. More...
 
std::string GetFullStackTraceAsString () const
 Return the full stack trace (including nested exceptions) More...
 
std::chrono::time_point< clock_tGetTimePoint () const
 Return the exception creation time as a chrono timepoint. More...
 
int64_t GetCreationDate () const
 Return the exception creation time as number of seconds since Unix Epoch. More...
 
std::thread::id GetThreadId () const
 Return the id of the thread in which the exception was created. More...
 
int GetProcessId () const
 Return the id of the process in which the exception was created. More...
 
const std::string & GetHostName () const
 Return the name of the host in which the exception was created. More...
 
std::string GetTypeName () const
 Return the exception class name. More...
 
void SetLineNumber (uint32_t lineNumber)
 Set the line number in which the exception was thrown. More...
 
uint32_t GetLineNumber () const
 Return the line number in which the exception was thrown. More...
 
void SetFunctionName (const std::string &functionName)
 Set the name of the function in which the exception was thrown. More...
 
const std::string & GetFunctionName () const
 Return the name of the function in which the exception was thrown. More...
 
void SetFileName (const std::string &fileName)
 Set the name of the file in which the exception was thrown. More...
 
const std::string & GetFileName () const
 Return the name of the file in which the exception was thrown. More...
 
void SetDetails (const std::string &details)
 Set the exception details. More...
 
std::string GetDetails () const
 Get the exception details. More...
 
void SetClassName (const std::string &className)
 Set the name of the class in which the exception was thrown. More...
 
std::string Dump () const
 Return all the exception's details. More...
 
std::string GetSeverity () const
 
std::string DumpWithNested () const
 Return all the exception's details, including details of nested exceptions. More...
 
const char * what () const noexcept override
 
const char * What () const noexcept
 Return all the exception's details, including details of nested exceptions. More...
 
void SetCiiExceptionStack (const std::vector< std::string > &nested_exceptions)
 

Detailed Description

Base class for the exceptions thrown by the client API.

Member Typedef Documentation

◆ clock_t

typedef std::chrono::system_clock elt::error::CiiException::clock_t

The clock to use for determining the exception creation time.

Possible values:

  • std::chrono::system_clock
  • std::chrono::steady_clock
  • std::chrono::high_resolution_clock
  • std::chrono::utc_clock (C++20)

Constructor & Destructor Documentation

◆ CiiException() [1/2]

elt::error::CiiException::CiiException ( const std::string &  message)
explicit

Constructor.

Parameters
messagea message describibng the error

◆ CiiException() [2/2]

template<typename ... Args>
elt::error::CiiException::CiiException ( const std::string &  formatter,
Args ...  args 
)
inlineexplicit

Constructor that takes a formatter string and additional parameters to build the exception message.

Parameters
formatterthe formatter string, in snprintf format
argsthe arguments for the formatter string

◆ ~CiiException()

virtual elt::error::CiiException::~CiiException ( )
virtualdefault

Destructor.

Member Function Documentation

◆ Dump()

std::string elt::error::CiiException::Dump ( ) const

Return all the exception's details.

Returns
all the exception details

◆ DumpWithNested()

std::string elt::error::CiiException::DumpWithNested ( ) const

Return all the exception's details, including details of nested exceptions.

Returns
all the exception details, including nested exceptions

◆ getCiiClassName()

virtual std::string elt::error::CiiException::getCiiClassName ( ) const
inlinevirtual

◆ getCiiCreationDate()

virtual int64_t elt::error::CiiException::getCiiCreationDate ( ) const
inlinevirtual

◆ getCiiDetails()

virtual std::string elt::error::CiiException::getCiiDetails ( ) const
inlinevirtual

◆ getCiiExceptionStack()

virtual std::vector<std::string> elt::error::CiiException::getCiiExceptionStack ( ) const
inlinevirtual

◆ getCiiFileName()

virtual std::string elt::error::CiiException::getCiiFileName ( ) const
inlinevirtual

◆ getCiiHostName()

virtual std::string elt::error::CiiException::getCiiHostName ( ) const
inlinevirtual

◆ getCiiMessage()

virtual std::string elt::error::CiiException::getCiiMessage ( ) const
inlinevirtual

◆ getCiiMethodName()

virtual std::string elt::error::CiiException::getCiiMethodName ( ) const
inlinevirtual

◆ getCiiStackTrace()

std::string elt::error::CiiException::getCiiStackTrace ( ) const
virtual

◆ GetCiiStackTrace()

const std::string elt::error::CiiException::GetCiiStackTrace ( ) const
inlinenoexcept

◆ getCiiType()

virtual std::string elt::error::CiiException::getCiiType ( ) const
inlinevirtual

◆ GetCreationDate()

int64_t elt::error::CiiException::GetCreationDate ( ) const

Return the exception creation time as number of seconds since Unix Epoch.

Returns
exception creation time as seconds since Unix epoch

◆ GetDetails()

std::string elt::error::CiiException::GetDetails ( ) const

Get the exception details.

Returns
exception details

◆ GetFileName()

const std::string & elt::error::CiiException::GetFileName ( ) const

Return the name of the file in which the exception was thrown.

Returns
the name of the file in which the exception was thrown

◆ GetFullStackTraceAsString()

std::string elt::error::CiiException::GetFullStackTraceAsString ( ) const

Return the full stack trace (including nested exceptions)

Returns
a string representing the full stack trace (including nested exceptions)

◆ GetFunctionName()

const std::string & elt::error::CiiException::GetFunctionName ( ) const

Return the name of the function in which the exception was thrown.

Returns
the name of the function in which the exception was thrown

◆ GetHostName()

const std::string & elt::error::CiiException::GetHostName ( ) const

Return the name of the host in which the exception was created.

Returns
the name of the host in which the exception was created

◆ GetLineNumber()

uint32_t elt::error::CiiException::GetLineNumber ( ) const

Return the line number in which the exception was thrown.

Returns
the line number in which the exception was thrown

◆ GetOriginalStackTrace()

const boost::stacktrace::stacktrace & elt::error::CiiException::GetOriginalStackTrace ( ) const

Return the stack trace captured in the most nested exception constructor.

Returns
the stack trace captured in the most nested exception constructor

◆ GetOriginalStackTraceAsString()

std::string elt::error::CiiException::GetOriginalStackTraceAsString ( ) const

Same as GetOriginalStackTrace() but convert the trace to a string.

Returns
a string representing the most nested exception's stack trace

◆ GetProcessId()

int elt::error::CiiException::GetProcessId ( ) const

Return the id of the process in which the exception was created.

Returns
the id of the process in which the exception was created

◆ GetSeverity()

std::string elt::error::CiiException::GetSeverity ( ) const

◆ GetStackTrace()

const boost::stacktrace::stacktrace & elt::error::CiiException::GetStackTrace ( ) const

Return the stack trace captured in the exception constructor.

Returns
the stack trace captured in the exception constructor

◆ GetStackTraceAsString()

std::string elt::error::CiiException::GetStackTraceAsString ( ) const

Same as GetStackTrace() but convert the trace to a string.

Returns
a string representing the stack trace

◆ GetThreadId()

std::thread::id elt::error::CiiException::GetThreadId ( ) const

Return the id of the thread in which the exception was created.

Returns
the id of the thread in which the exception was created

◆ GetTimePoint()

std::chrono::time_point< CiiException::clock_t > elt::error::CiiException::GetTimePoint ( ) const

Return the exception creation time as a chrono timepoint.

Returns
the exception creation time

◆ GetTypeName()

std::string elt::error::CiiException::GetTypeName ( ) const

Return the exception class name.

Returns
the exception class name

◆ SetCiiExceptionStack()

void elt::error::CiiException::SetCiiExceptionStack ( const std::vector< std::string > &  nested_exceptions)

◆ SetClassName()

void elt::error::CiiException::SetClassName ( const std::string &  className)

Set the name of the class in which the exception was thrown.

Parameters
classNamethe name of the class in which the exception was thrown.

◆ SetDetails()

void elt::error::CiiException::SetDetails ( const std::string &  details)

Set the exception details.

Parameters
detailsnew exception details

◆ SetFileName()

void elt::error::CiiException::SetFileName ( const std::string &  fileName)

Set the name of the file in which the exception was thrown.

Parameters
fileNamethe name of the file in which the exception was thrown

◆ SetFunctionName()

void elt::error::CiiException::SetFunctionName ( const std::string &  functionName)

Set the name of the function in which the exception was thrown.

Parameters
functionNamethe name of the function in which the exception was thrown

◆ SetLineNumber()

void elt::error::CiiException::SetLineNumber ( uint32_t  lineNumber)

Set the line number in which the exception was thrown.

Parameters
lineNumberthe line number in which the exception was thrown

◆ What()

const char* elt::error::CiiException::What ( ) const
inlinenoexcept

Return all the exception's details, including details of nested exceptions.

Returns
all the exception details, including nested exceptions

◆ what()

const char * elt::error::CiiException::what ( ) const
overridenoexcept

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