SignalControl.hpp

The SignalControl class manages all of the signals and actions, linking them together upon request (by name, base class, or derived class).

Developer notes:

  • Right now SignalControl can only link to signals that it creates. Ideally, external signals should also be able to be added to it. The question is, how should this be done?

    • They could be copied. But should we copy existing actions? How do we provide keys?

    • They could use a smart pointer style, so only deleted with final version (slow down?)

class SignalControl : public internal::SignalControl_Base
#include <SignalControl.hpp>

Public Functions

inline SignalControl()
inline ~SignalControl()
inline size_t GetNumActions() const
inline size_t GetNumSignals() const
inline const ActionBase &GetAction(const std::string &name) const
inline const SignalBase &GetSignal(const std::string &name) const
inline ActionManager &GetActionManager()
inline SignalManager &GetSignalManager() override
template<typename ...Ts>
inline auto &AddAction(Ts&&... act)
template<typename ...ARGS>
inline auto &AddSignal(const std::string &name = "")
template<typename ...ARGS>
inline auto &AddSignal(Signal<void(ARGS...)> &signal)
template<typename ...ARGS>
inline auto Link(SignalBase &s, const std::function<void(ARGS...)> &f)
template<typename A>
inline auto Link(const std::string &s, A &&a)
inline auto Link(SignalBase &s, const std::string &a)
inline auto Link(SignalBase &s, ActionBase &a)
template<typename ...ARGS>
inline void Trigger(const std::string &name, ARGS&&... args)
inline void NotifyConstruct(SignalBase *sig_ptr) override
inline void PrintNames(std::ostream &os = std::cout)

Private Members

ActionManager action_m
SignalManager signal_m
std::unordered_map<uint32_t, SignalBase*> id_to_signal