Signals Library
sig::Slot_base Class Reference

Base class for Slot, handles tracked objects. More...

#include <slot_base.hpp>

Inheritance diagram for sig::Slot_base:
sig::Slot< R(Args...), FunctionType >

Public Types

using Locked_container_t = std::vector< std::shared_ptr< void > >
 
using Tracked_container_t = std::vector< std::weak_ptr< void > >
 

Public Member Functions

 Slot_base (Slot_base const &)=default
 
Slot_baseoperator= (Slot_base const &)=default
 
 Slot_base (Slot_base &&)=default
 
Slot_baseoperator= (Slot_base &&)=default
 
auto expired () const -> bool
 
auto lock () const -> Locked_container_t
 Locks the tracked objects so they cannot be destroyed. More...
 
auto get_tracked_container () const -> Tracked_container_t const &
 

Protected Attributes

Tracked_container_t tracked_ptrs_
 

Detailed Description

Base class for Slot, handles tracked objects.

Member Function Documentation

◆ expired()

auto sig::Slot_base::expired ( ) const -> bool
inline
Returns
True if any tracked object has been destroyed.

◆ get_tracked_container()

auto sig::Slot_base::get_tracked_container ( ) const -> Tracked_container_t const&
inline
Returns
The internally held container of tracked objects.

◆ lock()

auto sig::Slot_base::lock ( ) const -> Locked_container_t
inline

Locks the tracked objects so they cannot be destroyed.

Returns
Container of locked objects, as long as this container is alive all of the tracked objects will be alive, as long as they have not already expired.

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