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

#include <Action.h>

Inheritance diagram for emp::Action< void(ARGS...)>:
emp::ActionSize< sizeof...(ARGS)> emp::ActionBase

Public Types

using this_t = Action< void(ARGS...)>
 
using parent_t = ActionSize< sizeof...(ARGS)>
 

Public Member Functions

 Action (const std::function< void(ARGS...)> &in_fun, const std::string &in_name="")
 
template<typename RETURN >
 Action (const std::function< RETURN(ARGS...)> &in_fun, const std::string &in_name="")
 
 Action (const this_t &)=default
 
 Action (this_t &&)=default
 
this_toperator= (const this_t &)=default
 
this_toperator= (this_t &&)=default
 
const std::function< void(ARGS...)> & GetFun () const
 
void Call (ARGS &&...args)
 Call the function associated with this action. More...
 
this_tClone () const
 Build a copy of this Action. More...
 
size_t GetArgCount () const
 Get number of arguments this action takes. More...
 
const std::string & GetName () const
 Get the name of this action. More...
 

Protected Attributes

std::function< void(ARGS...)> fun
 The specific function associated with this action. More...
 
std::string name
 A unique name for this action so it can be called at runtime. More...
 

Detailed Description

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

This Action class specialization takes a function with a void return tyime and builds it off of the action base classes.

Member Typedef Documentation

template<typename... ARGS>
using emp::Action< void(ARGS...)>::parent_t = ActionSize<sizeof...(ARGS)>
template<typename... ARGS>
using emp::Action< void(ARGS...)>::this_t = Action<void(ARGS...)>

Constructor & Destructor Documentation

template<typename... ARGS>
emp::Action< void(ARGS...)>::Action ( const std::function< void(ARGS...)> &  in_fun,
const std::string &  in_name = "" 
)
inline
template<typename... ARGS>
template<typename RETURN >
emp::Action< void(ARGS...)>::Action ( const std::function< RETURN(ARGS...)> &  in_fun,
const std::string &  in_name = "" 
)
inline
template<typename... ARGS>
emp::Action< void(ARGS...)>::Action ( const this_t )
default
template<typename... ARGS>
emp::Action< void(ARGS...)>::Action ( this_t &&  )
default

Member Function Documentation

template<typename... ARGS>
void emp::Action< void(ARGS...)>::Call ( ARGS &&...  args)
inline

Call the function associated with this action.

template<typename... ARGS>
this_t* emp::Action< void(ARGS...)>::Clone ( ) const
inlinevirtual

Build a copy of this Action.

Implements emp::ActionBase.

size_t emp::ActionSize< ARG_COUNT >::GetArgCount ( ) const
inlinevirtualinherited

Get number of arguments this action takes.

Implements emp::ActionBase.

template<typename... ARGS>
const std::function<void(ARGS...)>& emp::Action< void(ARGS...)>::GetFun ( ) const
inline
const std::string& emp::ActionBase::GetName ( ) const
inlineinherited

Get the name of this action.

template<typename... ARGS>
this_t& emp::Action< void(ARGS...)>::operator= ( const this_t )
default
template<typename... ARGS>
this_t& emp::Action< void(ARGS...)>::operator= ( this_t &&  )
default

Member Data Documentation

template<typename... ARGS>
std::function<void(ARGS...)> emp::Action< void(ARGS...)>::fun
protected

The specific function associated with this action.

std::string emp::ActionBase::name
protectedinherited

A unique name for this action so it can be called at runtime.


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