SMACC
Loading...
Searching...
No Matches
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
16namespace smacc
17{
19public:
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
29private:
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}
void addConnection(boost::signals2::connection conn)
std::vector< boost::signals2::connection > connections_