Public Types | Public Member Functions | Private Attributes | List of all members
BT::Signal< CallableArgs > Class Template Reference

#include <signal.h>

Public Types

using CallableFunction = std::function< void(CallableArgs...)>
 
using Subscriber = std::shared_ptr< CallableFunction >
 

Public Member Functions

void notify (CallableArgs...args)
 
Subscriber subscribe (CallableFunction func)
 

Private Attributes

std::vector< std::weak_ptr< CallableFunction > > subscribers_
 

Detailed Description

template<typename... CallableArgs>
class BT::Signal< CallableArgs >

Super simple Signal/Slop implementation, AKA "Observable pattern". The subscriber is active until it goes out of scope or Subscriber::reset() is called.

Definition at line 15 of file signal.h.

Member Typedef Documentation

template<typename... CallableArgs>
using BT::Signal< CallableArgs >::CallableFunction = std::function<void(CallableArgs...)>

Definition at line 18 of file signal.h.

template<typename... CallableArgs>
using BT::Signal< CallableArgs >::Subscriber = std::shared_ptr<CallableFunction>

Definition at line 19 of file signal.h.

Member Function Documentation

template<typename... CallableArgs>
void BT::Signal< CallableArgs >::notify ( CallableArgs...  args)
inline

Definition at line 21 of file signal.h.

template<typename... CallableArgs>
Subscriber BT::Signal< CallableArgs >::subscribe ( CallableFunction  func)
inline

Definition at line 37 of file signal.h.

Member Data Documentation

template<typename... CallableArgs>
std::vector<std::weak_ptr<CallableFunction> > BT::Signal< CallableArgs >::subscribers_
private

Definition at line 45 of file signal.h.


The documentation for this class was generated from the following file:


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 18:04:06