class CYCData: methode addCommands added.
This commit is contained in:
+13
-7
@@ -27,13 +27,7 @@ extern LogInstance& L;
|
||||
CYCData::CYCData(EBusLoop* ebusloop, Commands* commands)
|
||||
: m_ebusloop(ebusloop), m_commands(commands), m_stop(false)
|
||||
{
|
||||
for (size_t index = 0; index < commands->size(); index++) {
|
||||
if (strcasecmp((*m_commands)[index][0].c_str(),"cyc") == 0) {
|
||||
Command* cmd = new Command(index, (*m_commands)[index]);
|
||||
m_cycDB.insert(pair_t(index, cmd));
|
||||
}
|
||||
}
|
||||
|
||||
addCommands(m_commands);
|
||||
}
|
||||
|
||||
CYCData::~CYCData()
|
||||
@@ -139,3 +133,15 @@ void CYCData::storeData(int index, std::string data)
|
||||
}
|
||||
}
|
||||
|
||||
void CYCData::addCommands(Commands* commands)
|
||||
{
|
||||
for (size_t index = 0; index < commands->size(); index++) {
|
||||
if (strcasecmp((*m_commands)[index][0].c_str(),"cyc") == 0) {
|
||||
Command* cmd = new Command(index, (*m_commands)[index]);
|
||||
m_cycDB.insert(pair_t(index, cmd));
|
||||
}
|
||||
}
|
||||
|
||||
L.log(cyc, trace, "%d cycle commands added", m_cycDB.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@ public:
|
||||
|
||||
std::string getData(int index);
|
||||
|
||||
void addCommands(Commands* commands);
|
||||
|
||||
private:
|
||||
EBusLoop* m_ebusloop;
|
||||
Commands* m_commands;
|
||||
|
||||
Reference in New Issue
Block a user