Flair
Framework Libre Air
|
Base class for all Framework's classes. More...
#include <Object.h>
Public Types | |
enum | color_t { Auto = 0, Red = 31, Green = 32, Orange = 33 } |
Public Member Functions | |
Object (const Object *parent=NULL, std::string name="", std::string type="") | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
std::string | ObjectName (void) const |
Name. More... | |
std::string | ObjectType (void) const |
Type. More... | |
const Object * | Parent (void) const |
Parent. More... | |
std::vector< const Object * > * | TypeChilds (void) const |
Childs of the same type. More... | |
std::vector< const Object * > * | Childs (void) const |
Childs. More... | |
void | Information (const char *function, int line, const char *format,...) const |
Formatted information. More... | |
void | Warning (const char *function, const char *format,...) const |
Formatted warning. More... | |
void | Error (const char *function, const char *format,...) const |
Formatted error. More... | |
bool | ErrorOccured (bool recursive=true) const |
Has an errror occured? More... | |
Base class for all Framework's classes.
This is the base class for all other classes.
It handles parent/child links and thus allow auto destruction of childs.
flair::core::Object::Object | ( | const Object * | parent = NULL , |
std::string | name = "" , |
||
std::string | type = "" |
||
) |
Constructor.
Construct an Object, which is child of its parent.
parent | parent |
name | name |
type | type |
|
virtual |
Destructor.
Calling it will automatically destruct all childs.
std::string flair::core::Object::ObjectName | ( | void | ) | const |
Name.
std::string flair::core::Object::ObjectType | ( | void | ) | const |
Type.
std::vector<const Object *>* flair::core::Object::TypeChilds | ( | void | ) | const |
Childs of the same type.
std::vector<const Object *>* flair::core::Object::Childs | ( | void | ) | const |
Childs.
void flair::core::Object::Information | ( | const char * | function, |
int | line, | ||
const char * | format, | ||
... | |||
) | const |
Formatted information.
Green colored Printf().
Note that it is better to call Info macro, which automatically fills calling function parameter.
function | name of calling function |
line | line number in calling function |
format | text string to display |
void flair::core::Object::Warning | ( | const char * | function, |
const char * | format, | ||
... | |||
) | const |
Formatted warning.
Orange colored Printf().
Note that it is better to call Warn macro, which automatically fills calling function parameter.
function | name of calling function |
format | text string to display |
void flair::core::Object::Error | ( | const char * | function, |
const char * | format, | ||
... | |||
) | const |
Formatted error.
Red colored Printf().
Note that it is better to call Err macro, which automatically fills function calling parameter.
After calling this method, ErrorOccured() will always return true.
function | name of calling function |
format | text string to display |
bool flair::core::Object::ErrorOccured | ( | bool | recursive = true | ) | const |