ADTF
cErrorHandler

Base class for implementing error handlers. More...

Inheritance diagram for cErrorHandler:
[legend]

Public Member Functions

 cErrorHandler (const char *strErrorSource, const char *strErrorCategory, IErrorHandling::tAction eAction)
 Constructs a new error handler. More...
 
void Handle (tResult oError) override
 Call this to notify the error handling of an error that occured. More...
 
IErrorHandling::tAction GetAction () const
 
void SetAction (IErrorHandling::tAction eAction)
 Sets the current action in case an error occurs. More...
 
const char * GetErrorSource () const
 
const char * GetErrorCategory () const
 
- Public Member Functions inherited from object< IErrorHandling::IErrorHandler >
tResult GetInterface (const char *i_strIID, void *&o_pInterface) override
 Query interfaces on an object. More...
 
tResult GetInterface (const char *i_strIID, const void *&o_pInterface) const override
 Provides const correct interface querying. More...
 
void Destroy () const override
 Destruct and deallocate instantiations of type IObject. More...
 
- Public Member Functions inherited from IObject
 ADTF_IID (IObject, "object.ant.ucom.adtf.iid")
 Marks the IObject to be castable with the ucom_cast() More...
 

Additional Inherited Members

- Protected Member Functions inherited from IObject
 ~IObject ()=default
 Protected destructor --> Use implemented Destroy() instead of delete!
 

Detailed Description

Base class for implementing error handlers.

Definition at line 83 of file error_handling_intf.h.

Constructor & Destructor Documentation

◆ cErrorHandler()

cErrorHandler ( const char *  strErrorSource,
const char *  strErrorCategory,
IErrorHandling::tAction  eAction 
)

Constructs a new error handler.

Parameters
[in]strErrorSourceThe name of the error source.
[in]strErrorCategoryThe name of the error category.
[in]eActionThe action that should be taken if an error occurs.

Member Function Documentation

◆ GetAction()

IErrorHandling::tAction GetAction ( ) const
Returns
The action that is currently set.

◆ GetErrorCategory()

const char* GetErrorCategory ( ) const
Returns
The error category name.

◆ GetErrorSource()

const char* GetErrorSource ( ) const
Returns
The error source name.

◆ Handle()

void Handle ( tResult  oError)
override

Call this to notify the error handling of an error that occured.

Note that you still need to deal with this error in your component as good as possible!

Parameters
[in]oErrorThe error result.

◆ SetAction()

void SetAction ( IErrorHandling::tAction  eAction)

Sets the current action in case an error occurs.

Parameters
[in]eActionThe new action.