Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
c0be88b9
Commit
c0be88b9
authored
6 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
added few new functionality in buffer
parent
49ba3790
No related branches found
No related tags found
1 merge request
!291
Resolve "New processors workflow"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/processor/processor_base.h
+26
-0
26 additions, 0 deletions
include/core/processor/processor_base.h
with
26 additions
and
0 deletions
include/core/processor/processor_base.h
+
26
−
0
View file @
c0be88b9
...
...
@@ -60,6 +60,10 @@ public:
T
selectFirstBefore
(
const
TimeStamp
&
_time_stamp
,
const
Scalar
&
_time_tolerance
);
T
selectFirst
();
T
selectLast
();
/**\brief Buffer size
*
*/
...
...
@@ -444,6 +448,28 @@ T Buffer<T>::selectFirstBefore(const TimeStamp& _time_stamp, const Scalar& _time
}
template
<
typename
T
>
T
Buffer
<
T
>::
selectFirst
()
{
// There is no element
if
(
container_
.
empty
())
return
nullptr
;
// Returning first map element
return
container_
.
begin
()
->
second
;
}
template
<
typename
T
>
T
Buffer
<
T
>::
selectLast
()
{
// There is no element
if
(
container_
.
empty
())
return
nullptr
;
// Returning last map element
return
container_
.
rbegin
()
->
second
;
}
template
<
typename
T
>
void
Buffer
<
T
>::
add
(
const
TimeStamp
&
_time_stamp
,
const
T
&
_element
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment