documentation for class BaseLoop added; most enum types adapted.
This commit is contained in:
@@ -60,7 +60,7 @@ void ConfigCommands::setType(const FileType type)
|
||||
delete m_configfile;
|
||||
|
||||
switch (type) {
|
||||
case CSV:
|
||||
case ft_csv:
|
||||
m_configfile = new ConfigFileCSV();
|
||||
m_extension = "csv";
|
||||
break;
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
#include <vector>
|
||||
|
||||
/** available file endings / types. */
|
||||
enum FileType { CSV };
|
||||
enum FileType {
|
||||
ft_csv
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief base class for config files.
|
||||
|
||||
@@ -232,9 +232,9 @@ Port::Port(const std::string deviceName, const bool noDeviceCheck)
|
||||
|
||||
if (strchr(deviceName.c_str(), '/') == NULL &&
|
||||
strchr(deviceName.c_str(), ':') != NULL)
|
||||
setType(NETWORK);
|
||||
setType(dt_network);
|
||||
else
|
||||
setType(SERIAL);
|
||||
setType(dt_serial);
|
||||
}
|
||||
|
||||
void Port::setType(const DeviceType type)
|
||||
@@ -243,10 +243,10 @@ void Port::setType(const DeviceType type)
|
||||
delete m_device;
|
||||
|
||||
switch (type) {
|
||||
case SERIAL:
|
||||
case dt_serial:
|
||||
m_device = new DeviceSerial();
|
||||
break;
|
||||
case NETWORK:
|
||||
case dt_network:
|
||||
m_device = new DeviceNetwork();
|
||||
break;
|
||||
};
|
||||
|
||||
+4
-1
@@ -26,7 +26,10 @@
|
||||
#include <unistd.h>
|
||||
|
||||
/** available device types. */
|
||||
enum DeviceType { SERIAL, NETWORK };
|
||||
enum DeviceType {
|
||||
dt_serial,
|
||||
dt_network,
|
||||
};
|
||||
|
||||
/** max bytes write to bus. */
|
||||
#define MAX_WRITE_SIZE 1
|
||||
|
||||
@@ -51,7 +51,7 @@ void readCSV(std::istream& is, Commands& commands){
|
||||
|
||||
int main()
|
||||
{
|
||||
Commands* commands = ConfigCommands("test", CSV).getCommands();
|
||||
Commands* commands = ConfigCommands("test", ft_csv).getCommands();
|
||||
std::cout << "Commands: " << commands->sizeCmdDB() << std::endl;
|
||||
|
||||
//~ std::string data("g ci password pin1");
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
int main() {
|
||||
|
||||
std::string dir("test");
|
||||
ConfigCommands config(dir, CSV);
|
||||
ConfigCommands config(dir, ft_csv);
|
||||
|
||||
Commands* commands = config.getCommands();
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ public:
|
||||
|
||||
/**
|
||||
* @brief start listening of tcp socket.
|
||||
* @return result of low level functions.
|
||||
*/
|
||||
int start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user