missing documentation added.
This commit is contained in:
+46
-11
@@ -27,43 +27,78 @@
|
||||
|
||||
/** the available data types. */
|
||||
enum DataType {
|
||||
dt_none, // default value
|
||||
dt_bool, //
|
||||
dt_int, //
|
||||
dt_long, //
|
||||
dt_float, //
|
||||
dt_string, //
|
||||
dt_none, // default for __text_only__
|
||||
dt_bool, // boolean
|
||||
dt_int, // integer
|
||||
dt_long, // long
|
||||
dt_float, // float
|
||||
dt_string // string
|
||||
};
|
||||
|
||||
/** option types. */
|
||||
enum OptionType {
|
||||
ot_none, // default value
|
||||
ot_optional, // a value is optional
|
||||
ot_mandatory, // a value is mandatory
|
||||
ot_none, // no option type is needed
|
||||
ot_optional, // a value is optional
|
||||
ot_mandatory // a value is mandatory
|
||||
};
|
||||
|
||||
/** structure for defining application options */
|
||||
typedef struct opt {
|
||||
typedef struct {
|
||||
/** long option name */
|
||||
const char* name;
|
||||
/** short option name */
|
||||
const char* shortname;
|
||||
/** description for this option */
|
||||
const char* description;
|
||||
/** data type for this option */
|
||||
DataType datatype;
|
||||
/** indicates whether an option takes an argument */
|
||||
OptionType optiontype;
|
||||
} opt_t;
|
||||
|
||||
/** union for option values */
|
||||
/**
|
||||
* @brief union for option values
|
||||
*/
|
||||
union OptVal {
|
||||
/** boolean */
|
||||
bool b;
|
||||
/** integer */
|
||||
int i;
|
||||
/** long */
|
||||
long l;
|
||||
/** float */
|
||||
float f;
|
||||
/** string */
|
||||
const char* c;
|
||||
|
||||
/**
|
||||
* @brief clear memory
|
||||
*/
|
||||
OptVal() { memset(this, 0, sizeof(OptVal)); }
|
||||
/**
|
||||
* @brief create boolean type
|
||||
* @param _b the boolean
|
||||
*/
|
||||
OptVal(bool _b) : b(_b) {}
|
||||
/**
|
||||
* @brief create integer type
|
||||
* @param _i the integer
|
||||
*/
|
||||
OptVal(int _i) : i(_i) {}
|
||||
/**
|
||||
* @brief create long type
|
||||
* @param _l the long
|
||||
*/
|
||||
OptVal(long _l) : l(_l) {}
|
||||
/**
|
||||
* @brief create float type
|
||||
* @param _f the float
|
||||
*/
|
||||
OptVal(float _f) : f(_f) {}
|
||||
/**
|
||||
* @brief create string type
|
||||
* @param _c the string
|
||||
*/
|
||||
OptVal(const char* _c) : c(_c) {}
|
||||
};
|
||||
|
||||
|
||||
@@ -35,16 +35,16 @@ enum AreasType {
|
||||
bus=4, // ebus
|
||||
cyc=8, // cycle
|
||||
all=15, // type for all subsystems
|
||||
Size_of_Areas=4, // number of possible areas
|
||||
Size_of_Areas=4 // number of possible areas
|
||||
};
|
||||
|
||||
/** available logging levels */
|
||||
enum LevelType {
|
||||
error=0, //
|
||||
event, //
|
||||
trace, //
|
||||
debug, //
|
||||
Size_of_Level, // number of possible levels
|
||||
error=0, // silent run, only errors will be printed
|
||||
event, // only interesting message for normal use
|
||||
trace, // most of the information for normal use
|
||||
debug, // print internal states too
|
||||
Size_of_Level // number of possible levels
|
||||
};
|
||||
|
||||
/** global function to get calculate logging areas */
|
||||
@@ -260,14 +260,14 @@ public:
|
||||
|
||||
/**
|
||||
* @brief adds a logging sink and returns the reference to logger.
|
||||
* @param pointer of logging sink.
|
||||
* @param sink the used logging sink.
|
||||
* @return the reference to logger.
|
||||
*/
|
||||
Logger& operator+=(LogSink* sink);
|
||||
|
||||
/**
|
||||
* @brief removes a logging sink and returns the reference to logger.
|
||||
* @param pointer of logging sink.
|
||||
* @param sink the used logging sink.
|
||||
* @return the reference to logger.
|
||||
*/
|
||||
Logger& operator-=(const LogSink* sink);
|
||||
|
||||
Reference in New Issue
Block a user