SMACC
Loading...
Searching...
No Matches
smacc
include
smacc
callback_counter_semaphore.h
Go to the documentation of this file.
1
/*****************************************************************************************************************
2
* ReelRobotix Inc. - Software License Agreement Copyright (c) 2018
3
* Authors: Pablo Inigo Blasco, Brett Aldrich
4
*
5
******************************************************************************************************************/
6
7
#pragma once
8
#include <iostream>
9
#include <boost/signals2.hpp>
10
#include <thread>
11
#include <condition_variable>
12
#include <mutex>
13
#include <boost/signals2.hpp>
14
#include <ros/ros.h>
15
16
namespace
smacc
17
{
18
class
CallbackCounterSemaphore
{
19
public
:
20
CallbackCounterSemaphore
(std::string name,
int
count = 0);
21
bool
acquire
();
22
23
void
release
();
24
25
void
finalize
();
26
27
void
addConnection
(boost::signals2::connection conn);
28
29
private
:
30
int
count_
;
31
std::mutex
mutex_
;
32
std::condition_variable
cv_
;
33
std::vector<boost::signals2::connection>
connections_
;
34
bool
finalized
=
false
;
35
std::string
name_
;
36
};
37
}
smacc::CallbackCounterSemaphore
Definition:
callback_counter_semaphore.h:18
smacc::CallbackCounterSemaphore::acquire
bool acquire()
Definition:
callback_counter_semaphore.cpp:19
smacc::CallbackCounterSemaphore::addConnection
void addConnection(boost::signals2::connection conn)
Definition:
callback_counter_semaphore.cpp:61
smacc::CallbackCounterSemaphore::mutex_
std::mutex mutex_
Definition:
callback_counter_semaphore.h:31
smacc::CallbackCounterSemaphore::finalize
void finalize()
Definition:
callback_counter_semaphore.cpp:44
smacc::CallbackCounterSemaphore::connections_
std::vector< boost::signals2::connection > connections_
Definition:
callback_counter_semaphore.h:33
smacc::CallbackCounterSemaphore::cv_
std::condition_variable cv_
Definition:
callback_counter_semaphore.h:32
smacc::CallbackCounterSemaphore::count_
int count_
Definition:
callback_counter_semaphore.h:30
smacc::CallbackCounterSemaphore::finalized
bool finalized
Definition:
callback_counter_semaphore.h:34
smacc::CallbackCounterSemaphore::name_
std::string name_
Definition:
callback_counter_semaphore.h:35
smacc::CallbackCounterSemaphore::release
void release()
Definition:
callback_counter_semaphore.cpp:36
smacc
Definition:
callback_counter_semaphore.h:17
Generated by
1.9.5