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

◆ CallableFunction

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

Definition at line 18 of file signal.h.

◆ Subscriber

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

Definition at line 19 of file signal.h.

Member Function Documentation

◆ notify()

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

Definition at line 21 of file signal.h.

◆ subscribe()

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

Definition at line 37 of file signal.h.

Member Data Documentation

◆ subscribers_

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_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:18