Empirical
Public Types | Public Member Functions | Public Attributes | List of all members
emp::FunctionSet< void(ARGS...)> Class Template Reference

A specialized version of FunctionSet for void functions. More...

#include <FunctionSet.h>

Inheritance diagram for emp::FunctionSet< void(ARGS...)>:
emp::vector< std::function< void(ARGS...)> >

Public Types

using base_t = emp::vector< std::function< void(ARGS...)>>
 
using value_type = typename base_t::value_type
 
using return_t = void
 
using iterator = iterator_wrapper< typename stdv_t::iterator >
 
using const_iterator = iterator_wrapper< typename stdv_t::const_iterator >
 
using reverse_iterator = iterator_wrapper< typename stdv_t::reverse_iterator >
 
using const_reverse_iterator = iterator_wrapper< typename stdv_t::const_reverse_iterator >
 
using size_type = typename stdv_t::size_type
 
using reference = typename stdv_t::reference
 
using const_reference = typename stdv_t::const_reference
 

Public Member Functions

 FunctionSet ()
 
 ~FunctionSet ()
 
size_t GetSize () const
 How many functions are in this FunctionSet? More...
 
void Add (const std::function< void(ARGS...)> &in_fun)
 Add a new function to this FunctionSet. More...
 
void Remove (size_t pos)
 Remove the function at the designated position from this FunctionSet. More...
 
void Run (ARGS...args) const
 Run all functions in the FunctionSet. More...
 
size_t size () const
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
void resize (size_t new_size)
 
void resize (size_t new_size, const std::function< void(ARGS...)> &val)
 
std::function< void(ARGS...)> & operator[] (size_t pos)
 
const std::function< void(ARGS...)> & operator[] (size_t pos) const
 
std::function< void(ARGS...)> & back ()
 
const std::function< void(ARGS...)> & back () const
 
std::function< void(ARGS...)> & front ()
 
const std::function< void(ARGS...)> & front () const
 
void push_back (PB_Ts &&...args)
 
void pop_back ()
 
iterator insert (ARGS &&...args)
 
iterator erase (ARGS &&...args)
 
iterator emplace (ARGS &&...args)
 
void emplace_back (ARGS &&...args)
 

Public Attributes

int revision
 Setup a revision number - iterators must match the revision of their vector. More...
 

Detailed Description

template<typename... ARGS>
class emp::FunctionSet< void(ARGS...)>

A specialized version of FunctionSet for void functions.

Member Typedef Documentation

template<typename... ARGS>
using emp::FunctionSet< void(ARGS...)>::base_t = emp::vector<std::function<void(ARGS...)>>
using emp::vector< std::function< void(ARGS...)> , Ts >::const_iterator = iterator_wrapper< typename stdv_t::const_iterator >
inherited
using emp::vector< std::function< void(ARGS...)> , Ts >::const_reference = typename stdv_t::const_reference
inherited
using emp::vector< std::function< void(ARGS...)> , Ts >::const_reverse_iterator = iterator_wrapper< typename stdv_t::const_reverse_iterator >
inherited
using emp::vector< std::function< void(ARGS...)> , Ts >::iterator = iterator_wrapper< typename stdv_t::iterator >
inherited
using emp::vector< std::function< void(ARGS...)> , Ts >::reference = typename stdv_t::reference
inherited
template<typename... ARGS>
using emp::FunctionSet< void(ARGS...)>::return_t = void
using emp::vector< std::function< void(ARGS...)> , Ts >::reverse_iterator = iterator_wrapper< typename stdv_t::reverse_iterator >
inherited
using emp::vector< std::function< void(ARGS...)> , Ts >::size_type = typename stdv_t::size_type
inherited
template<typename... ARGS>
using emp::FunctionSet< void(ARGS...)>::value_type = typename base_t::value_type

Constructor & Destructor Documentation

template<typename... ARGS>
emp::FunctionSet< void(ARGS...)>::FunctionSet ( )
inline
template<typename... ARGS>
emp::FunctionSet< void(ARGS...)>::~FunctionSet ( )
inline

Member Function Documentation

template<typename... ARGS>
void emp::FunctionSet< void(ARGS...)>::Add ( const std::function< void(ARGS...)> &  in_fun)
inline

Add a new function to this FunctionSet.

std::function< void(ARGS...)> & emp::vector< std::function< void(ARGS...)> , Ts >::back ( )
inlineinherited
const std::function< void(ARGS...)> & emp::vector< std::function< void(ARGS...)> , Ts >::back ( ) const
inlineinherited
iterator emp::vector< std::function< void(ARGS...)> , Ts >::begin ( )
inlinenoexceptinherited
const_iterator emp::vector< std::function< void(ARGS...)> , Ts >::begin ( ) const
inlinenoexceptinherited
iterator emp::vector< std::function< void(ARGS...)> , Ts >::emplace ( ARGS &&...  args)
inlineinherited
void emp::vector< std::function< void(ARGS...)> , Ts >::emplace_back ( ARGS &&...  args)
inlineinherited
iterator emp::vector< std::function< void(ARGS...)> , Ts >::end ( )
inlinenoexceptinherited
const_iterator emp::vector< std::function< void(ARGS...)> , Ts >::end ( ) const
inlinenoexceptinherited
iterator emp::vector< std::function< void(ARGS...)> , Ts >::erase ( ARGS &&...  args)
inlineinherited
std::function< void(ARGS...)> & emp::vector< std::function< void(ARGS...)> , Ts >::front ( )
inlineinherited
const std::function< void(ARGS...)> & emp::vector< std::function< void(ARGS...)> , Ts >::front ( ) const
inlineinherited
template<typename... ARGS>
size_t emp::FunctionSet< void(ARGS...)>::GetSize ( ) const
inline

How many functions are in this FunctionSet?

iterator emp::vector< std::function< void(ARGS...)> , Ts >::insert ( ARGS &&...  args)
inlineinherited
std::function< void(ARGS...)> & emp::vector< std::function< void(ARGS...)> , Ts >::operator[] ( size_t  pos)
inlineinherited
const std::function< void(ARGS...)> & emp::vector< std::function< void(ARGS...)> , Ts >::operator[] ( size_t  pos) const
inlineinherited
void emp::vector< std::function< void(ARGS...)> , Ts >::pop_back ( )
inlineinherited
void emp::vector< std::function< void(ARGS...)> , Ts >::push_back ( PB_Ts &&...  args)
inlineinherited
template<typename... ARGS>
void emp::FunctionSet< void(ARGS...)>::Remove ( size_t  pos)
inline

Remove the function at the designated position from this FunctionSet.

void emp::vector< std::function< void(ARGS...)> , Ts >::resize ( size_t  new_size)
inlineinherited
void emp::vector< std::function< void(ARGS...)> , Ts >::resize ( size_t  new_size,
const std::function< void(ARGS...)> &  val 
)
inlineinherited
template<typename... ARGS>
void emp::FunctionSet< void(ARGS...)>::Run ( ARGS...  args) const
inline

Run all functions in the FunctionSet.

size_t emp::vector< std::function< void(ARGS...)> , Ts >::size ( ) const
inlineinherited

Member Data Documentation

int emp::vector< std::function< void(ARGS...)> , Ts >::revision
inherited

Setup a revision number - iterators must match the revision of their vector.


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