ADTF  3.18.2
adtf::base::elasto Namespace Reference

Namespace for all functionality of the ADTF Base SDK provided since v3.4. More...

Classes

class  IErrorHandling
 Error handling interface. More...
 
class  cErrorHandler
 Base class for implementing error handlers. More...
 
struct  tree_node_property_type
 Property type that creates a property that functions as a container for subproperties only. More...
 

Functions

ucom::ant::object_ptr< IErrorHandling::IErrorHandlercreate_error_handler (const char *strErrorSource, const char *strErrorCategory, IErrorHandling::tAction eDefaultAction)
 Creates a new error handler. More...
 
void handle_error (const char *strErrorSource, const char *strErrorCategory, IErrorHandling::tAction eDefaultAction, tResult oError)
 Convenience method to report an error for short lived objects. More...
 
std::string nested_exceptions_to_string (const std::exception &error)
 Formats nested std::exceptions into a string, line by line. More...
 
std::string current_exception_to_string ()
 Trys to format the current exception into a string. More...
 
tResult current_exception_to_result ()
 Converts the current exception object into a tResult. More...
 
std::pair< std::string, std::string > split_parents_and_leaf (const char *strPropertyPathAndName)
 Splits a property path into the parent path and the property name. More...
 
tResult create_property_tree (ant::IProperties &oProperties, const char *strPath)
 Creates a property tree structure. More...
 

Detailed Description

Namespace for all functionality of the ADTF Base SDK provided since v3.4.

Function Documentation

◆ create_error_handler()

ucom::ant::object_ptr<IErrorHandling::IErrorHandler> adtf::base::elasto::create_error_handler ( const char *  strErrorSource,
const char *  strErrorCategory,
IErrorHandling::tAction  eDefaultAction 
)

Creates a new error handler.

This works both if an error handling service is available or not.

Parameters
[in]strErrorSourceThe name of the error source.
[in]strErrorCategoryThe name of the error category.
[in]eDefaultActionThe default action that should be taken if an error occurs.
Returns
pHandler The new handler.

Referenced by cErrorChecker::Create().

◆ create_property_tree()

tResult adtf::base::elasto::create_property_tree ( ant::IProperties oProperties,
const char *  strPath 
)

Creates a property tree structure.

It creates new intermediate properties if they do not exist already.

Parameters
[in,out]oPropertiesThe property container to manipulate
[in]strPathThe path the properties, elements seperated by slashes.
Returns
Standard result.

◆ current_exception_to_result()

tResult adtf::base::elasto::current_exception_to_result ( )
inline

Converts the current exception object into a tResult.

Works for both tResult and std::exceptions.

Returns
The result containing the exception information.

Definition at line 46 of file base/include/adtfbase/exception_handling.h.

◆ current_exception_to_string()

std::string adtf::base::elasto::current_exception_to_string ( )
inline

Trys to format the current exception into a string.

This works for std::exception and tResult exception objects.

Returns
The formatted string.

Definition at line 36 of file base/include/adtfbase/exception_handling.h.

◆ handle_error()

void adtf::base::elasto::handle_error ( const char *  strErrorSource,
const char *  strErrorCategory,
IErrorHandling::tAction  eDefaultAction,
tResult  oError 
)

Convenience method to report an error for short lived objects.

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

◆ nested_exceptions_to_string()

std::string adtf::base::elasto::nested_exceptions_to_string ( const std::exception &  error)
inline

Formats nested std::exceptions into a string, line by line.

Parameters
[in]errorthe exception
Returns
The formatted string.

Definition at line 26 of file base/include/adtfbase/exception_handling.h.

◆ split_parents_and_leaf()

std::pair<std::string, std::string> adtf::base::elasto::split_parents_and_leaf ( const char *  strPropertyPathAndName)

Splits a property path into the parent path and the property name.

Parameters
[in]strPropertyPathAndNamePath seperated by slashes.
Returns
parent path and property name.