Commit db171626 by lucapegolotti

containers_cpp: fix cpplint warnings

parent e59cccfc
......@@ -104,11 +104,10 @@ class BlockingMap {
Value& operator[](
const Key& key
/**< [IN] Constant reference to key of the element to access*/);
};
}
}
} // namespace containers
} // namespace embb
#include <embb/containers/internal/blocking_map-inl.h>
......
......@@ -27,8 +27,10 @@
#ifndef EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE_H_
#define EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE_H_
#include <queue>
#include <embb/containers/internal/blocking_push_and_pop_container.h>
#include <functional>
#include <vector>
#include <queue>
namespace embb {
namespace containers {
......@@ -56,7 +58,7 @@ class BlockingPriorityQueue : public BlockingPushAndPopContainer<Type> {
/**
* Internal priority_queue from the standard library.
*/
std::priority_queue<Type, Container,Compare> internalQueue;
std::priority_queue<Type, Container, Compare> internalQueue;
/**
* Wrapper for the push method in the standard priority_queue.
......@@ -97,4 +99,4 @@ class BlockingPriorityQueue : public BlockingPushAndPopContainer<Type> {
#include <embb/containers/internal/blocking_priority_queue-inl.h>
#endif // EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE
\ No newline at end of file
#endif // EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE_H_
......@@ -27,8 +27,8 @@
#ifndef EMBB_CONTAINERS_BLOCKING_QUEUE_H_
#define EMBB_CONTAINERS_BLOCKING_QUEUE_H_
#include <queue>
#include <embb/containers/internal/blocking_push_and_pop_container.h>
#include <queue>
namespace embb {
namespace containers {
......@@ -90,7 +90,6 @@ class BlockingQueue : public BlockingPushAndPopContainer<Type> {
void Dequeue(
Type& element
/**< [IN, OUT] Reference to dequeued element*/);
};
} // namespace containers
......
......@@ -92,11 +92,10 @@ class BlockingSet {
bool Contains(
const Type& element
/**< [IN] Reference to the element to search for. */);
};
}
}
} // namespace containers
} // namespace embb
#include <embb/containers/internal/blocking_set-inl.h>
......
......@@ -27,8 +27,8 @@
#ifndef EMBB_CONTAINERS_BLOCKING_STACK_H_
#define EMBB_CONTAINERS_BLOCKING_STACK_H_
#include <stack>
#include <embb/containers/internal/blocking_push_and_pop_container.h>
#include <stack>
namespace embb {
namespace containers {
......@@ -86,7 +86,6 @@ class BlockingStack : public BlockingPushAndPopContainer<Type> {
void Pop(
Type& element
/**< [IN, OUT] Reference to popped element*/);
};
} // namespace containers
......
......@@ -25,7 +25,9 @@
*/
#ifndef EMBB_CONTAINERS_INTERNAL_BLOCKING_MAP_INL_H_
#define EMBB_CONTAINERS_INTERNAL_BLOCKING_SET_INL_H_
#define EMBB_CONTAINERS_INTERNAL_BLOCKING_MAP_INL_H_
#include <map>
namespace embb {
namespace containers {
......@@ -58,7 +60,7 @@ V& BlockingMap<K, V>::operator[](const K& key) {
return internalMap[key];
}
}
}
} // namespace containers
} // namespace embb
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_MAP_INL_H_
......@@ -31,7 +31,8 @@ namespace embb {
namespace containers {
template<typename T, class Container, class Compare>
void BlockingPriorityQueue<T, Container, Compare>::SpecializedPush(const T& element) {
void BlockingPriorityQueue<T, Container, Compare>::SpecializedPush(
const T& element) {
internalQueue.push(element);
}
......@@ -56,7 +57,7 @@ bool BlockingPriorityQueue<T, Container, Compare>::IsEmpty() {
return internalQueue.empty();
}
}
}
} // namespace containers
} // namespace embb
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_PRIORITY_QUEUE_INL_H_
......@@ -37,11 +37,9 @@ namespace containers {
// data structures that support push/pop-like methods (e.g. stacks, queues)
template < typename Type >
class BlockingPushAndPopContainer {
typedef embb::base::Mutex Mutex;
protected:
Mutex mutex;
embb::base::ConditionVariable condition;
......@@ -60,7 +58,7 @@ class BlockingPushAndPopContainer {
condition.NotifyOne();
}
void BlockingPop( Type & element) {
void BlockingPop(Type & element) {
embb::base::UniqueLock<Mutex> lock(mutex);
while (IsEmpty()) {
......@@ -69,10 +67,9 @@ class BlockingPushAndPopContainer {
SpecializedPop(element);
}
};
}
}
} // namespace containers
} // namespace embb
#endif // EMBB_CONTAINERS_BLOCKING_PUSH_AND_POP_CONTAINER_
\ No newline at end of file
#endif // EMBB_CONTAINERS_BLOCKING_PUSH_AND_POP_CONTAINER_H_
......@@ -35,24 +35,24 @@ BlockingSet<T>::BlockingSet() :
internalSet() {}
template<typename T>
bool BlockingSet<T>::Insert(const T& element){
bool BlockingSet<T>::Insert(const T& element) {
LockGuard lock(mutex);
return internalSet.insert(element).second;
}
template<typename T>
bool BlockingSet<T>::Erase(const T& element){
bool BlockingSet<T>::Erase(const T& element) {
LockGuard lock(mutex);
return internalSet.erase(element) > 0;
}
template<typename T>
bool BlockingSet<T>::Contains(const T& element){
bool BlockingSet<T>::Contains(const T& element) {
LockGuard lock(mutex);
return internalSet.find(element) != internalSet.end();
}
}
}
} // namespace containers
} // namespace embb
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_SET_INL_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment