missing documentation added.
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
/** available file endings / types. */
|
/** available file endings / types. */
|
||||||
enum FileType {
|
enum FileType {
|
||||||
ft_csv
|
ft_csv // CSV
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,7 +51,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief class for CSV config files.
|
* @brief derived class for CSV config files.
|
||||||
*/
|
*/
|
||||||
class ConfigFileCSV : public ConfigFile
|
class ConfigFileCSV : public ConfigFile
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief class for class device.
|
* @brief class to parse configuration files and store into commands instance.
|
||||||
*/
|
*/
|
||||||
class ConfigCommands
|
class ConfigCommands
|
||||||
{
|
{
|
||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief set file type and add recursive files from given path.
|
* @brief set file type and add recursive files from given path.
|
||||||
* @param path to configuration files.
|
* @param path to configuration files.
|
||||||
* @param filetype to parse.
|
* @param type to parse.
|
||||||
*/
|
*/
|
||||||
ConfigCommands(const std::string path, const FileType type);
|
ConfigCommands(const std::string path, const FileType type);
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief setter for file type.
|
* @brief setter for file type.
|
||||||
* @param filetype of files.
|
* @param type of files.
|
||||||
*/
|
*/
|
||||||
void setType(const FileType type);
|
void setType(const FileType type);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
/** available device types. */
|
/** available device types. */
|
||||||
enum DeviceType {
|
enum DeviceType {
|
||||||
dt_serial,
|
dt_serial, // serial device
|
||||||
dt_network,
|
dt_network // network device
|
||||||
};
|
};
|
||||||
|
|
||||||
/** max bytes write to bus. */
|
/** max bytes write to bus. */
|
||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief recvBytes read bytes from opened file descriptor.
|
* @brief recvBytes read bytes from opened file descriptor.
|
||||||
* @param timeoutmax time for new input data [usec].
|
* @param timeout time for new input data [usec].
|
||||||
* @param maxCount max size of receive buffer.
|
* @param maxCount max size of receive buffer.
|
||||||
* @return number of read bytes or -1 if an error has occured.
|
* @return number of read bytes or -1 if an error has occured.
|
||||||
*/
|
*/
|
||||||
|
|||||||
+45
-10
@@ -27,43 +27,78 @@
|
|||||||
|
|
||||||
/** the available data types. */
|
/** the available data types. */
|
||||||
enum DataType {
|
enum DataType {
|
||||||
dt_none, // default value
|
dt_none, // default for __text_only__
|
||||||
dt_bool, //
|
dt_bool, // boolean
|
||||||
dt_int, //
|
dt_int, // integer
|
||||||
dt_long, //
|
dt_long, // long
|
||||||
dt_float, //
|
dt_float, // float
|
||||||
dt_string, //
|
dt_string // string
|
||||||
};
|
};
|
||||||
|
|
||||||
/** option types. */
|
/** option types. */
|
||||||
enum OptionType {
|
enum OptionType {
|
||||||
ot_none, // default value
|
ot_none, // no option type is needed
|
||||||
ot_optional, // a value is optional
|
ot_optional, // a value is optional
|
||||||
ot_mandatory, // a value is mandatory
|
ot_mandatory // a value is mandatory
|
||||||
};
|
};
|
||||||
|
|
||||||
/** structure for defining application options */
|
/** structure for defining application options */
|
||||||
typedef struct opt {
|
typedef struct {
|
||||||
|
/** long option name */
|
||||||
const char* name;
|
const char* name;
|
||||||
|
/** short option name */
|
||||||
const char* shortname;
|
const char* shortname;
|
||||||
|
/** description for this option */
|
||||||
const char* description;
|
const char* description;
|
||||||
|
/** data type for this option */
|
||||||
DataType datatype;
|
DataType datatype;
|
||||||
|
/** indicates whether an option takes an argument */
|
||||||
OptionType optiontype;
|
OptionType optiontype;
|
||||||
} opt_t;
|
} opt_t;
|
||||||
|
|
||||||
/** union for option values */
|
/**
|
||||||
|
* @brief union for option values
|
||||||
|
*/
|
||||||
union OptVal {
|
union OptVal {
|
||||||
|
/** boolean */
|
||||||
bool b;
|
bool b;
|
||||||
|
/** integer */
|
||||||
int i;
|
int i;
|
||||||
|
/** long */
|
||||||
long l;
|
long l;
|
||||||
|
/** float */
|
||||||
float f;
|
float f;
|
||||||
|
/** string */
|
||||||
const char* c;
|
const char* c;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief clear memory
|
||||||
|
*/
|
||||||
OptVal() { memset(this, 0, sizeof(OptVal)); }
|
OptVal() { memset(this, 0, sizeof(OptVal)); }
|
||||||
|
/**
|
||||||
|
* @brief create boolean type
|
||||||
|
* @param _b the boolean
|
||||||
|
*/
|
||||||
OptVal(bool _b) : b(_b) {}
|
OptVal(bool _b) : b(_b) {}
|
||||||
|
/**
|
||||||
|
* @brief create integer type
|
||||||
|
* @param _i the integer
|
||||||
|
*/
|
||||||
OptVal(int _i) : i(_i) {}
|
OptVal(int _i) : i(_i) {}
|
||||||
|
/**
|
||||||
|
* @brief create long type
|
||||||
|
* @param _l the long
|
||||||
|
*/
|
||||||
OptVal(long _l) : l(_l) {}
|
OptVal(long _l) : l(_l) {}
|
||||||
|
/**
|
||||||
|
* @brief create float type
|
||||||
|
* @param _f the float
|
||||||
|
*/
|
||||||
OptVal(float _f) : f(_f) {}
|
OptVal(float _f) : f(_f) {}
|
||||||
|
/**
|
||||||
|
* @brief create string type
|
||||||
|
* @param _c the string
|
||||||
|
*/
|
||||||
OptVal(const char* _c) : c(_c) {}
|
OptVal(const char* _c) : c(_c) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -35,16 +35,16 @@ enum AreasType {
|
|||||||
bus=4, // ebus
|
bus=4, // ebus
|
||||||
cyc=8, // cycle
|
cyc=8, // cycle
|
||||||
all=15, // type for all subsystems
|
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 */
|
/** available logging levels */
|
||||||
enum LevelType {
|
enum LevelType {
|
||||||
error=0, //
|
error=0, // silent run, only errors will be printed
|
||||||
event, //
|
event, // only interesting message for normal use
|
||||||
trace, //
|
trace, // most of the information for normal use
|
||||||
debug, //
|
debug, // print internal states too
|
||||||
Size_of_Level, // number of possible levels
|
Size_of_Level // number of possible levels
|
||||||
};
|
};
|
||||||
|
|
||||||
/** global function to get calculate logging areas */
|
/** global function to get calculate logging areas */
|
||||||
@@ -260,14 +260,14 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief adds a logging sink and returns the reference to logger.
|
* @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.
|
* @return the reference to logger.
|
||||||
*/
|
*/
|
||||||
Logger& operator+=(LogSink* sink);
|
Logger& operator+=(LogSink* sink);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief removes a logging sink and returns the reference to logger.
|
* @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.
|
* @return the reference to logger.
|
||||||
*/
|
*/
|
||||||
Logger& operator-=(const LogSink* sink);
|
Logger& operator-=(const LogSink* sink);
|
||||||
|
|||||||
Reference in New Issue
Block a user