Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hochautomatisiertes-Fahren
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Philipp Badenhoop
Hochautomatisiertes-Fahren
Commits
47a03f2a
Commit
47a03f2a
authored
7 years ago
by
Hoop77
Browse files
Options
Downloads
Patches
Plain Diff
removed unneccessary functions in Timer.h
parent
ad236380
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NetworkingLib/include/Timer.h
+0
-4
0 additions, 4 deletions
NetworkingLib/include/Timer.h
NetworkingLib/src/Timer.cpp
+25
-49
25 additions, 49 deletions
NetworkingLib/src/Timer.cpp
PlatoonProtocol/src/FollowerVehicle.cpp
+1
-1
1 addition, 1 deletion
PlatoonProtocol/src/FollowerVehicle.cpp
with
26 additions
and
54 deletions
NetworkingLib/include/Timer.h
+
0
−
4
View file @
47a03f2a
...
@@ -37,10 +37,6 @@ public:
...
@@ -37,10 +37,6 @@ public:
void
stop
();
void
stop
();
void
enable
()
noexcept
;
bool
isEnabled
()
const
noexcept
;
private
:
private
:
boost
::
asio
::
basic_waitable_timer
<
time
::
Clock
>
timer
;
boost
::
asio
::
basic_waitable_timer
<
time
::
Clock
>
timer
;
std
::
atomic
<
bool
>
enabled
{
true
};
std
::
atomic
<
bool
>
enabled
{
true
};
...
...
This diff is collapsed.
Click to expand it.
NetworkingLib/src/Timer.cpp
+
25
−
49
View file @
47a03f2a
...
@@ -21,49 +21,35 @@ Timer::Ptr Timer::create(Networking & net)
...
@@ -21,49 +21,35 @@ Timer::Ptr Timer::create(Networking & net)
void
Timer
::
startTimeout
(
const
time
::
Duration
&
duration
,
TimeoutHandler
handler
)
void
Timer
::
startTimeout
(
const
time
::
Duration
&
duration
,
TimeoutHandler
handler
)
{
{
try
enabled
=
true
;
{
enabled
=
true
;
auto
self
=
shared_from_this
();
timer
.
expires_from_now
(
duration
);
auto
self
=
shared_from_this
();
timer
.
async_wait
(
timer
.
expires_from_now
(
duration
);
[
self
,
handler
](
const
boost
::
system
::
error_code
&
error
)
timer
.
async_wait
(
{
[
self
,
handler
](
const
boost
::
system
::
error_code
&
error
)
if
(
error
||
!
self
->
enabled
)
{
return
;
if
(
error
||
!
self
->
enabled
)
return
;
handler
();
});
handler
();
});
}
catch
(...)
{
throw
error
::
FailedOperation
{};
}
}
}
void
Timer
::
startPeriodicTimeout
(
const
time
::
Duration
&
interval
,
Timer
::
TimeoutHandler
handler
)
void
Timer
::
startPeriodicTimeout
(
const
time
::
Duration
&
interval
,
Timer
::
TimeoutHandler
handler
)
{
{
try
enabled
=
true
;
{
enabled
=
true
;
auto
self
=
shared_from_this
();
timer
.
expires_from_now
(
interval
);
auto
self
=
shared_from_this
();
timer
.
async_wait
(
timer
.
expires_from_now
(
interval
);
[
self
,
interval
,
handler
](
const
boost
::
system
::
error_code
&
error
)
timer
.
async_wait
(
{
[
self
,
interval
,
handler
](
const
boost
::
system
::
error_code
&
error
)
if
(
error
||
!
self
->
enabled
)
{
return
;
if
(
error
||
!
self
->
enabled
)
return
;
handler
();
self
->
nextPeriod
(
interval
,
handler
);
handler
();
});
self
->
nextPeriod
(
interval
,
handler
);
});
}
catch
(...)
{
throw
error
::
FailedOperation
{};
}
}
}
void
Timer
::
stop
()
void
Timer
::
stop
()
...
@@ -76,16 +62,6 @@ void Timer::stop()
...
@@ -76,16 +62,6 @@ void Timer::stop()
timer
.
cancel
(
ignoredError
);
timer
.
cancel
(
ignoredError
);
}
}
void
Timer
::
enable
()
noexcept
{
enabled
=
true
;
}
bool
Timer
::
isEnabled
()
const
noexcept
{
return
enabled
;
}
void
Timer
::
nextPeriod
(
const
time
::
Duration
&
interval
,
Timer
::
TimeoutHandler
handler
)
void
Timer
::
nextPeriod
(
const
time
::
Duration
&
interval
,
Timer
::
TimeoutHandler
handler
)
{
{
if
(
!
enabled
)
if
(
!
enabled
)
...
...
This diff is collapsed.
Click to expand it.
PlatoonProtocol/src/FollowerVehicle.cpp
+
1
−
1
View file @
47a03f2a
...
@@ -114,7 +114,7 @@ void FollowerVehicle::makePlatoonCreateResponse(const networking::Resolver::Endp
...
@@ -114,7 +114,7 @@ void FollowerVehicle::makePlatoonCreateResponse(const networking::Resolver::Endp
{
{
if
(
state
!=
State
::
CREATING_PLATOON
)
if
(
state
!=
State
::
CREATING_PLATOON
)
{
{
response
=
PlatoonMessage
::
rejectResponse
(
getOwnEndpoint
().
getVehicleId
());
response
=
PlatoonMessage
::
rejectResponse
(
getOwnEndpoint
().
getVehicleId
());
return
;
return
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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