Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
QH::ErrorCodes Namespace Reference

ErrorCodes This namesapce contains all error codes of the Heart Library. More...

Classes

class  AbstractErrorCodesHelper
 The AbstractErrorCodesHelper class is helper class with static methods for translate the ErrorCodes enums to text. This helper know only about the AbstractErrorCodes enum. More...
 

Typedefs

using Code = unsigned char
 Code This is alias for the unsigned char type.
 

Enumerations

enum  AbstractErrorCodes : Code { NoError = 0 , UnknownError , InvalidRequest , AbstractErrorCodes }
 The AbstractErrorCodes enum This enum with default error codes. More...
 

Detailed Description

ErrorCodes This namesapce contains all error codes of the Heart Library.

Note
If you want to add won error code in this namespace then you should be create a own child of the AbstractErrorCodesHelper class and override toString method.
you new enum must be declared in the ErrorCodes namespace and your enum must be beginned of the last value from the ErrorCodes class.

Example of the create a own error codes.

cpp
namespace QH {
namespace ErrorCodes {
enum MyErrorCodes: unsigned char {
MyFirstError = AbstractErrorCodes::AbstractErrorCodes, // or another ErrorCodes enum.
MyErrorCodes,
};
class MyErrorCodesHelper {
public:
static QString toString(unsigned char enumData) {
switch (enumData) {
case ErrorCodes::MyFirstError: {
return "My Error";
}
default: return AbstractErrorCodesHelper::toString(enumData);
}
private:
MyErrorCodesHelper() = default;
};
}
}
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13
Note
in place the AbstractErrorCodes you can use another erorcodes class for example : DBErrorCodesHelper. Do not forget invoke toString method of the parent erorcodes class (in example case it is DBErrorCodesHelper class).

Typedef Documentation

◆ Code

using QH::ErrorCodes::Code = typedef unsigned char

Code This is alias for the unsigned char type.

Definition at line 70 of file abstracterrorcodes.h.

Enumeration Type Documentation

◆ AbstractErrorCodes

The AbstractErrorCodes enum This enum with default error codes.

Enumerator
NoError 

This reqest executed successful.

UnknownError 

This is unknown error. Default value.

InvalidRequest 

The sender to remote nodes request is invalid. This is default value.

AbstractErrorCodes 

This case using for inheritance new enum classes.

Definition at line 75 of file abstracterrorcodes.h.