class LogInstance renamed to Logger; documentation for logging subsystem added.
This commit is contained in:
+15
-12
@@ -31,14 +31,14 @@ namespace libebus
|
||||
enum FileType { CSV, XML };
|
||||
|
||||
/**
|
||||
* @brief Base class for config files.
|
||||
* @brief base class for config files.
|
||||
*/
|
||||
class ConfigFile
|
||||
{
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
virtual ~ConfigFile() {}
|
||||
|
||||
@@ -52,14 +52,14 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class for CSV config files.
|
||||
* @brief class for CSV config files.
|
||||
*/
|
||||
class ConfigFileCSV : public ConfigFile
|
||||
{
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
~ConfigFileCSV() {}
|
||||
|
||||
@@ -73,14 +73,14 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class for XML config files.
|
||||
* @brief class for XML config files.
|
||||
*/
|
||||
class ConfigFileXML : public ConfigFile
|
||||
{
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
~ConfigFileXML() {}
|
||||
|
||||
@@ -95,32 +95,32 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* @brief Class for class Device.
|
||||
* @brief class for class device.
|
||||
*/
|
||||
class ConfigCommands
|
||||
{
|
||||
|
||||
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 Filetype to parse.
|
||||
* @param filetype to parse.
|
||||
*/
|
||||
ConfigCommands(const std::string path, const FileType type);
|
||||
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
~ConfigCommands() { delete m_configfile; }
|
||||
|
||||
/**
|
||||
* @brief setter for file type.
|
||||
* @param FileType of files.
|
||||
* @param filetype of files.
|
||||
*/
|
||||
void setType(const FileType type);
|
||||
|
||||
/**
|
||||
* @brief Parse files for commands and store them into commands instance.
|
||||
* @brief parse files for commands and store them into commands instance.
|
||||
* @return a commands instance
|
||||
*/
|
||||
Commands* getCommands();
|
||||
@@ -128,10 +128,13 @@ public:
|
||||
private:
|
||||
/** the configfile instance */
|
||||
ConfigFile* m_configfile;
|
||||
|
||||
/** main path for configuration files */
|
||||
std::string m_path;
|
||||
|
||||
/** valid file extension */
|
||||
std::string m_extension;
|
||||
|
||||
/** vector of configuration files */
|
||||
std::vector<std::string> m_files;
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
private:
|
||||
/** the name of dump file*/
|
||||
std::string m_filename;
|
||||
|
||||
/** max. size of dump file */
|
||||
long m_filesize;
|
||||
|
||||
|
||||
+16
-10
@@ -39,19 +39,19 @@ enum DeviceType { SERIAL, NETWORK };
|
||||
|
||||
|
||||
/**
|
||||
* @brief Base class for input devices.
|
||||
* @brief base class for input devices.
|
||||
*/
|
||||
class Device
|
||||
{
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs a new instance.
|
||||
* @brief constructs a new instance.
|
||||
*/
|
||||
Device() : m_fd(-1), m_open(false), m_noDeviceCheck(false) {}
|
||||
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
virtual ~Device() {}
|
||||
|
||||
@@ -104,12 +104,16 @@ public:
|
||||
protected:
|
||||
/** if of file descriptor */
|
||||
int m_fd;
|
||||
|
||||
/** state of device*/
|
||||
bool m_open;
|
||||
|
||||
/** state of device check */
|
||||
bool m_noDeviceCheck;
|
||||
|
||||
/** queue for received bytes */
|
||||
std::queue<unsigned char> m_recvBuffer;
|
||||
|
||||
/** receive buffer */
|
||||
unsigned char m_buffer[MAX_READ_SIZE];
|
||||
|
||||
@@ -123,14 +127,14 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class for serial input device.
|
||||
* @brief class for serial input device.
|
||||
*/
|
||||
class DeviceSerial : public Device
|
||||
{
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
~DeviceSerial() { closeDevice(); }
|
||||
|
||||
@@ -153,14 +157,14 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class for network input device.
|
||||
* @brief class for network input device.
|
||||
*/
|
||||
class DeviceNetwork : public Device
|
||||
{
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
~DeviceNetwork() { closeDevice(); }
|
||||
|
||||
@@ -181,21 +185,21 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Wrapper class for class Device.
|
||||
* @brief wrapper class for class device.
|
||||
*/
|
||||
class Port
|
||||
{
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Constructs a new instance and determine device type.
|
||||
* @brief constructs a new instance and determine device type.
|
||||
* @param deviceName to determine device type.
|
||||
* @param noDeviceCheck en-/disable device check.
|
||||
*/
|
||||
Port(const std::string deviceName, const bool noDeviceCheck);
|
||||
|
||||
/**
|
||||
* @brief Destructor.
|
||||
* @brief destructor.
|
||||
*/
|
||||
~Port() { delete m_device; }
|
||||
|
||||
@@ -248,8 +252,10 @@ public:
|
||||
private:
|
||||
/** the device name */
|
||||
std::string m_deviceName;
|
||||
|
||||
/** the device instance */
|
||||
Device* m_device;
|
||||
|
||||
/** true if device check is disabled */
|
||||
bool m_noDeviceCheck;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user