class LogInstance renamed to Logger; documentation for logging subsystem added.

This commit is contained in:
Roland Jax
2014-11-18 20:15:01 +01:00
parent 1415b143af
commit e2f6bbffb0
21 changed files with 347 additions and 157 deletions
+16 -10
View File
@@ -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;