Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
db171626
authored
9 years ago
by
lucapegolotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
containers_cpp: fix cpplint warnings
parent
e59cccfc
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
33 deletions
+29
-33
containers_cpp/include/embb/containers/blocking_map.h
+2
-3
containers_cpp/include/embb/containers/blocking_priority_queue.h
+5
-4
containers_cpp/include/embb/containers/blocking_queue.h
+1
-2
containers_cpp/include/embb/containers/blocking_set.h
+2
-3
containers_cpp/include/embb/containers/blocking_stack.h
+1
-2
containers_cpp/include/embb/containers/internal/blocking_map-inl.h
+5
-3
containers_cpp/include/embb/containers/internal/blocking_priority_queue-inl.h
+4
-3
containers_cpp/include/embb/containers/internal/blocking_push_and_pop_container.h
+4
-8
containers_cpp/include/embb/containers/internal/blocking_set-inl.h
+5
-5
No files found.
containers_cpp/include/embb/containers/blocking_map.h
View file @
db171626
...
@@ -104,11 +104,10 @@ class BlockingMap {
...
@@ -104,11 +104,10 @@ class BlockingMap {
Value
&
operator
[](
Value
&
operator
[](
const
Key
&
key
const
Key
&
key
/**< [IN] Constant reference to key of the element to access*/
);
/**< [IN] Constant reference to key of the element to access*/
);
};
};
}
}
// namespace containers
}
}
// namespace embb
#include <embb/containers/internal/blocking_map-inl.h>
#include <embb/containers/internal/blocking_map-inl.h>
...
...
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/blocking_priority_queue.h
View file @
db171626
...
@@ -27,8 +27,10 @@
...
@@ -27,8 +27,10 @@
#ifndef EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE_H_
#ifndef EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE_H_
#define 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 <embb/containers/internal/blocking_push_and_pop_container.h>
#include <functional>
#include <vector>
#include <queue>
namespace
embb
{
namespace
embb
{
namespace
containers
{
namespace
containers
{
...
@@ -56,7 +58,7 @@ class BlockingPriorityQueue : public BlockingPushAndPopContainer<Type> {
...
@@ -56,7 +58,7 @@ class BlockingPriorityQueue : public BlockingPushAndPopContainer<Type> {
/**
/**
* Internal priority_queue from the standard library.
* 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.
* Wrapper for the push method in the standard priority_queue.
...
@@ -97,4 +99,4 @@ class BlockingPriorityQueue : public BlockingPushAndPopContainer<Type> {
...
@@ -97,4 +99,4 @@ class BlockingPriorityQueue : public BlockingPushAndPopContainer<Type> {
#include <embb/containers/internal/blocking_priority_queue-inl.h>
#include <embb/containers/internal/blocking_priority_queue-inl.h>
#endif // EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE
#endif // EMBB_CONTAINERS_BLOCKING_PRIORITY_QUEUE_H_
\ No newline at end of file
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/blocking_queue.h
View file @
db171626
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
#ifndef EMBB_CONTAINERS_BLOCKING_QUEUE_H_
#ifndef EMBB_CONTAINERS_BLOCKING_QUEUE_H_
#define EMBB_CONTAINERS_BLOCKING_QUEUE_H_
#define EMBB_CONTAINERS_BLOCKING_QUEUE_H_
#include <queue>
#include <embb/containers/internal/blocking_push_and_pop_container.h>
#include <embb/containers/internal/blocking_push_and_pop_container.h>
#include <queue>
namespace
embb
{
namespace
embb
{
namespace
containers
{
namespace
containers
{
...
@@ -90,7 +90,6 @@ class BlockingQueue : public BlockingPushAndPopContainer<Type> {
...
@@ -90,7 +90,6 @@ class BlockingQueue : public BlockingPushAndPopContainer<Type> {
void
Dequeue
(
void
Dequeue
(
Type
&
element
Type
&
element
/**< [IN, OUT] Reference to dequeued element*/
);
/**< [IN, OUT] Reference to dequeued element*/
);
};
};
}
// namespace containers
}
// namespace containers
...
...
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/blocking_set.h
View file @
db171626
...
@@ -92,11 +92,10 @@ class BlockingSet {
...
@@ -92,11 +92,10 @@ class BlockingSet {
bool
Contains
(
bool
Contains
(
const
Type
&
element
const
Type
&
element
/**< [IN] Reference to the element to search for. */
);
/**< [IN] Reference to the element to search for. */
);
};
};
}
}
// namespace containers
}
}
// namespace embb
#include <embb/containers/internal/blocking_set-inl.h>
#include <embb/containers/internal/blocking_set-inl.h>
...
...
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/blocking_stack.h
View file @
db171626
...
@@ -27,8 +27,8 @@
...
@@ -27,8 +27,8 @@
#ifndef EMBB_CONTAINERS_BLOCKING_STACK_H_
#ifndef EMBB_CONTAINERS_BLOCKING_STACK_H_
#define EMBB_CONTAINERS_BLOCKING_STACK_H_
#define EMBB_CONTAINERS_BLOCKING_STACK_H_
#include <stack>
#include <embb/containers/internal/blocking_push_and_pop_container.h>
#include <embb/containers/internal/blocking_push_and_pop_container.h>
#include <stack>
namespace
embb
{
namespace
embb
{
namespace
containers
{
namespace
containers
{
...
@@ -86,7 +86,6 @@ class BlockingStack : public BlockingPushAndPopContainer<Type> {
...
@@ -86,7 +86,6 @@ class BlockingStack : public BlockingPushAndPopContainer<Type> {
void
Pop
(
void
Pop
(
Type
&
element
Type
&
element
/**< [IN, OUT] Reference to popped element*/
);
/**< [IN, OUT] Reference to popped element*/
);
};
};
}
// namespace containers
}
// namespace containers
...
...
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/internal/blocking_map-inl.h
View file @
db171626
...
@@ -25,7 +25,9 @@
...
@@ -25,7 +25,9 @@
*/
*/
#ifndef EMBB_CONTAINERS_INTERNAL_BLOCKING_MAP_INL_H_
#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
embb
{
namespace
containers
{
namespace
containers
{
...
@@ -58,7 +60,7 @@ V& BlockingMap<K, V>::operator[](const K& key) {
...
@@ -58,7 +60,7 @@ V& BlockingMap<K, V>::operator[](const K& key) {
return
internalMap
[
key
];
return
internalMap
[
key
];
}
}
}
}
// namespace containers
}
}
// namespace embb
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_MAP_INL_H_
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_MAP_INL_H_
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/internal/blocking_priority_queue-inl.h
View file @
db171626
...
@@ -31,7 +31,8 @@ namespace embb {
...
@@ -31,7 +31,8 @@ namespace embb {
namespace
containers
{
namespace
containers
{
template
<
typename
T
,
class
Container
,
class
Compare
>
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
);
internalQueue
.
push
(
element
);
}
}
...
@@ -56,7 +57,7 @@ bool BlockingPriorityQueue<T, Container, Compare>::IsEmpty() {
...
@@ -56,7 +57,7 @@ bool BlockingPriorityQueue<T, Container, Compare>::IsEmpty() {
return
internalQueue
.
empty
();
return
internalQueue
.
empty
();
}
}
}
}
// namespace containers
}
}
// namespace embb
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_PRIORITY_QUEUE_INL_H_
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_PRIORITY_QUEUE_INL_H_
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/internal/blocking_push_and_pop_container.h
View file @
db171626
...
@@ -37,11 +37,9 @@ namespace containers {
...
@@ -37,11 +37,9 @@ namespace containers {
// data structures that support push/pop-like methods (e.g. stacks, queues)
// data structures that support push/pop-like methods (e.g. stacks, queues)
template
<
typename
Type
>
template
<
typename
Type
>
class
BlockingPushAndPopContainer
{
class
BlockingPushAndPopContainer
{
typedef
embb
::
base
::
Mutex
Mutex
;
typedef
embb
::
base
::
Mutex
Mutex
;
protected
:
protected
:
Mutex
mutex
;
Mutex
mutex
;
embb
::
base
::
ConditionVariable
condition
;
embb
::
base
::
ConditionVariable
condition
;
...
@@ -60,7 +58,7 @@ class BlockingPushAndPopContainer {
...
@@ -60,7 +58,7 @@ class BlockingPushAndPopContainer {
condition
.
NotifyOne
();
condition
.
NotifyOne
();
}
}
void
BlockingPop
(
Type
&
element
)
{
void
BlockingPop
(
Type
&
element
)
{
embb
::
base
::
UniqueLock
<
Mutex
>
lock
(
mutex
);
embb
::
base
::
UniqueLock
<
Mutex
>
lock
(
mutex
);
while
(
IsEmpty
())
{
while
(
IsEmpty
())
{
...
@@ -69,10 +67,9 @@ class BlockingPushAndPopContainer {
...
@@ -69,10 +67,9 @@ class BlockingPushAndPopContainer {
SpecializedPop
(
element
);
SpecializedPop
(
element
);
}
}
};
};
}
}
// namespace containers
}
}
// namespace embb
#endif // EMBB_CONTAINERS_BLOCKING_PUSH_AND_POP_CONTAINER_
#endif // EMBB_CONTAINERS_BLOCKING_PUSH_AND_POP_CONTAINER_H_
\ No newline at end of file
This diff is collapsed.
Click to expand it.
containers_cpp/include/embb/containers/internal/blocking_set-inl.h
View file @
db171626
...
@@ -35,24 +35,24 @@ BlockingSet<T>::BlockingSet() :
...
@@ -35,24 +35,24 @@ BlockingSet<T>::BlockingSet() :
internalSet
()
{}
internalSet
()
{}
template
<
typename
T
>
template
<
typename
T
>
bool
BlockingSet
<
T
>::
Insert
(
const
T
&
element
){
bool
BlockingSet
<
T
>::
Insert
(
const
T
&
element
)
{
LockGuard
lock
(
mutex
);
LockGuard
lock
(
mutex
);
return
internalSet
.
insert
(
element
).
second
;
return
internalSet
.
insert
(
element
).
second
;
}
}
template
<
typename
T
>
template
<
typename
T
>
bool
BlockingSet
<
T
>::
Erase
(
const
T
&
element
){
bool
BlockingSet
<
T
>::
Erase
(
const
T
&
element
)
{
LockGuard
lock
(
mutex
);
LockGuard
lock
(
mutex
);
return
internalSet
.
erase
(
element
)
>
0
;
return
internalSet
.
erase
(
element
)
>
0
;
}
}
template
<
typename
T
>
template
<
typename
T
>
bool
BlockingSet
<
T
>::
Contains
(
const
T
&
element
){
bool
BlockingSet
<
T
>::
Contains
(
const
T
&
element
)
{
LockGuard
lock
(
mutex
);
LockGuard
lock
(
mutex
);
return
internalSet
.
find
(
element
)
!=
internalSet
.
end
();
return
internalSet
.
find
(
element
)
!=
internalSet
.
end
();
}
}
}
}
// namespace containers
}
}
// namespace embb
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_SET_INL_H_
#endif // EMBB_CONTAINERS_INTERNAL_BLOCKING_SET_INL_H_
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment