Empirical
Public Member Functions | List of all members
emp::ActionManager Class Reference

#include <ActionManager.h>

Public Member Functions

 ActionManager ()
 
 ActionManager (ActionManager &&)=default
 
 ActionManager (const ActionManager &in)
 
 ~ActionManager ()
 
int GetNextID () const
 Get the ID to be used for the next new function. More...
 
size_t GetSize () const
 How many actions are in this manager? More...
 
ActionBaseoperator[] (const std::string &name)
 Look up an action with the specified name. More...
 
const ActionBaseoperator[] (const std::string &name) const
 Look up an action with the specified name (const version) More...
 
template<typename RETURN , typename... ARGS>
auto & Add (const std::function< RETURN(ARGS...)> &in_fun, const std::string &name)
 Add a functon to this manager with a pre-specified name. More...
 
template<typename RETURN , typename... ARGS>
auto & Add (const std::function< RETURN(ARGS...)> &in_fun)
 Add a function to this manager with an auto-generated name. More...
 
auto & Add (const ActionBase &action)
 Add an action to this manager. More...
 
void PrintNames (std::ostream &os=std::cout)
 Print out the name of all actions maintained by this manager. More...
 

Constructor & Destructor Documentation

emp::ActionManager::ActionManager ( )
inline
emp::ActionManager::ActionManager ( ActionManager &&  )
default
emp::ActionManager::ActionManager ( const ActionManager in)
inline
emp::ActionManager::~ActionManager ( )
inline

Member Function Documentation

template<typename RETURN , typename... ARGS>
auto& emp::ActionManager::Add ( const std::function< RETURN(ARGS...)> &  in_fun,
const std::string &  name 
)
inline

Add a functon to this manager with a pre-specified name.

template<typename RETURN , typename... ARGS>
auto& emp::ActionManager::Add ( const std::function< RETURN(ARGS...)> &  in_fun)
inline

Add a function to this manager with an auto-generated name.

auto& emp::ActionManager::Add ( const ActionBase action)
inline

Add an action to this manager.

int emp::ActionManager::GetNextID ( ) const
inline

Get the ID to be used for the next new function.

size_t emp::ActionManager::GetSize ( ) const
inline

How many actions are in this manager?

ActionBase& emp::ActionManager::operator[] ( const std::string &  name)
inline

Look up an action with the specified name.

const ActionBase& emp::ActionManager::operator[] ( const std::string &  name) const
inline

Look up an action with the specified name (const version)

void emp::ActionManager::PrintNames ( std::ostream &  os = std::cout)
inline

Print out the name of all actions maintained by this manager.


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