Celeritas
0.5.0-56+6b053cd
|
Construct and store metadata about end-of-step actions. More...
#include <ActionRegistry.hh>
Public Types | |
Type aliases | |
using | SPAction = std::shared_ptr< ActionInterface > |
using | SPConstAction = std::shared_ptr< ActionInterface const > |
Public Member Functions | |
ActionRegistry ()=default | |
Construct without any registered actions. | |
ActionId | next_id () const |
Get the next available action ID. | |
template<class T , std::enable_if_t< detail::is_mutable_action_v< T >, bool > = true> | |
void | insert (std::shared_ptr< T > action) |
Register a mutable action. | |
template<class T , std::enable_if_t< detail::is_const_action_v< T >, bool > = true> | |
void | insert (std::shared_ptr< T > action) |
Register a const action. | |
ActionId::size_type | num_actions () const |
Get the number of defined actions. | |
bool | empty () const |
Whether no actions have been registered. | |
SPConstAction const & | action (ActionId id) const |
Access an action. | |
std::string const & | id_to_label (ActionId id) const |
Get the label corresponding to an action. | |
ActionId | find_action (std::string const &label) const |
Find the action corresponding to an label. | |
Span< SPAction const > | mutable_actions () const |
View all actions that are able to change at runtime. | |
Construct and store metadata about end-of-step actions.
The action manager helps create and retain access to "actions" (possible control paths for a track) over the program's lifetime. "Implicit" actions are primarily for debugging, but "explicit" actions indicate that a kernel will change the state of a track on device.
Associated actions use the ActionInterface
class to provide debugging information, and the CoreStepActionInterface
is used to invoke kernels with core data.
New actions should be created with an action ID corresponding to next_id
. Registering an action checks its ID. Actions are always added sequentially and can never be removed from the registry once added.