This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <thread> | |
#include <future> | |
#include <queue> | |
class ITask | |
{ | |
public: | |
virtual ~ITask() {}; | |
virtual void execute() = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T, unsigned int maxSize> | |
class FixedVector : public std::vector<T> | |
{ | |
public: | |
FixedVector() { _maxSize = maxSize; } | |
bool push_back(const T& elem) | |
{ | |
if(_maxSize > size()) | |
{ | |
std::vector<T>::push_back(elem); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string getCmdOption(int argc, char* argv[], const std::string& option) | |
{ | |
std::string cmd; | |
for( int i = 0; i < argc; ++i) | |
{ | |
std::string arg = argv[i]; | |
if(0 == arg.find(option)) | |
{ | |
std::size_t found = arg.find_first_of(option); | |
cmd =arg.substr(found + 1); |