[DEBUG] missing return

This commit is contained in:
Edouard DUPIN 2015-01-26 21:47:51 +01:00
parent 51d16858c5
commit f9c3b51f93
2 changed files with 30 additions and 8 deletions

View File

@ -19,17 +19,18 @@ airtalgo::Process::Process() {
}
bool airtalgo::Process::push(std::chrono::system_clock::time_point& _time,
void* _data,
size_t _nbChunk) {
void* _data,
size_t _nbChunk) {
void* out = nullptr;
size_t nbChunkOut;
AIRTALGO_VERBOSE(" Interface DIRECT ");
process(_time, _data, _nbChunk, out, nbChunkOut);
return true;
}
bool airtalgo::Process::pull(std::chrono::system_clock::time_point& _time,
void*& _data,
size_t& _nbChunk) {
void*& _data,
size_t& _nbChunk) {
void* in = nullptr;
size_t nbChunkIn = _nbChunk;
void* out = nullptr;
@ -46,13 +47,14 @@ bool airtalgo::Process::pull(std::chrono::system_clock::time_point& _time,
nbChunkIn = 32;
}
process(_time, in, nbChunkIn, _data, _nbChunk);
return true;
}
bool airtalgo::Process::process(std::chrono::system_clock::time_point& _time,
void* _inData,
size_t _inNbChunk,
void*& _outData,
size_t& _outNbChunk) {
void* _inData,
size_t _inNbChunk,
void*& _outData,
size_t& _outNbChunk) {
if (m_listAlgo.size() == 0) {
_outData = _inData;
_outNbChunk = _inNbChunk;
@ -66,6 +68,7 @@ bool airtalgo::Process::process(std::chrono::system_clock::time_point& _time,
_inNbChunk = _outNbChunk;
}
}
return true;
}
void airtalgo::Process::pushBack(const std::shared_ptr<airtalgo::Algo>& _algo) {

View File

@ -68,6 +68,25 @@ namespace airtalgo{
void clear() {
m_listAlgo.clear();
}
template<typename T> void removeIfFirst() {
if (m_listAlgo.size() > 0) {
std::shared_ptr<T> algoEP = std::dynamic_pointer_cast<T>(m_listAlgo[0]);
if (algoEP != nullptr) {
m_listAlgo.erase(m_listAlgo.begin());
}
}
}
template<typename T> void removeIfLast() {
if (m_listAlgo.size() > 0) {
std::shared_ptr<T> algoEP = std::dynamic_pointer_cast<T>(m_listAlgo[m_listAlgo.size()-1]);
if (algoEP != nullptr) {
m_listAlgo.erase(m_listAlgo.begin()+m_listAlgo.size()-1);
}
}
}
template<typename T> std::shared_ptr<T> get(int32_t _id) {
return std::dynamic_pointer_cast<T>(m_listAlgo[_id]);
}
};
};