IErrorManager Class Referenceabstract

Interface for Kernel error handler implementationThis manager is reponsible for handling errors in the framework. Errors in the framework are considered as not acceptable behavior that can be detected and handled by the system. The concept of error is thus independant of warning or fatal crashes that must be handled separately. More...

Inheritance diagram for IErrorManager:
IKernelObject IObject

Public Member Functions

virtual void pushError (OpenViBE::Kernel::ErrorType type, const char *description)=0
 Push error to the manager. More...
 
virtual void pushErrorAtLocation (OpenViBE::Kernel::ErrorType type, const char *description, const char *filename, unsigned int line)=0
 Push error with location information to the manager. More...
 
virtual void releaseErrors ()=0
 Release manager errors. More...
 
virtual bool hasError () const =0
 Check for existing errors in the manager. More...
 
virtual const OpenViBE::Kernel::IErrorgetLastError () const =0
 Get last error added to the manager. More...
 
virtual const char * getLastErrorString () const =0
 Get description of last error added to the manager. More...
 
virtual OpenViBE::Kernel::ErrorType getLastErrorType () const =0
 Get type of last error added to the manager. More...
 
- Public Member Functions inherited from IObject
virtual OpenViBE::CIdentifier getClassIdentifier (void) const =0
 Returns the final class identifier of the concrete class. More...
 
virtual OpenViBE::boolean isDerivedFromClass (const OpenViBE::CIdentifier &rClassIdentifier) const
 Checks if this object is compatible with a class identifier. More...
 
virtual OpenViBE::boolean acceptVisitor (OpenViBE::IObjectVisitor &rObjectVisitor)
 Requests this object to accept a visitor. More...
 

Detailed Description

Interface for Kernel error handler implementation

This manager is reponsible for handling errors in the framework. Errors in the framework are considered as not acceptable behavior that can be detected and handled by the system. The concept of error is thus independant of warning or fatal crashes that must be handled separately.

Author
Charles Garraud (Inria)
Date
2016-07-12

Member Function Documentation

virtual void pushError ( OpenViBE::Kernel::ErrorType  type,
const char *  description 
)
pure virtual

Push error to the manager.

Parameters
typethe error type
descriptiona self-explanatory description message

Errors already added to the manager will be nested in the newly added error.

virtual void pushErrorAtLocation ( OpenViBE::Kernel::ErrorType  type,
const char *  description,
const char *  filename,
unsigned int  line 
)
pure virtual

Push error with location information to the manager.

Parameters
typethe error type
descriptiona self-explanatory description of the error
filenamethe source file where the error was detected
linethe line number where the error was detected

Errors already added to the manager will be nested in the newly added error.

virtual void releaseErrors ( )
pure virtual

Release manager errors.

Release last error added to the manager and potentially all the nested errors recursively.

Warning
After this call, do not use pointers to IError retrieved before. It will lead to unexpected behavior mostly due to dangling pointers.
virtual bool hasError ( ) const
pure virtual

Check for existing errors in the manager.

Returns
true if manager contains errors, false otherwise
virtual const OpenViBE::Kernel::IError* getLastError ( ) const
pure virtual

Get last error added to the manager.

Returns
the error if manager contains errors, nullptr otherwise
Warning
The manager keeps the ownership of IError instances. Therefore the API consumer is not responsible for their life cycle/management and must use releaseErrors to release them.
virtual const char* getLastErrorString ( ) const
pure virtual

Get description of last error added to the manager.

Returns
the description if manager contains errors, empty string otherwise
virtual OpenViBE::Kernel::ErrorType getLastErrorType ( ) const
pure virtual

Get type of last error added to the manager.

Returns
the type if manager contains error, NoErrorFound otherwise