15#ifndef ACTIONENGINE_ACTIONS_REGISTRY_H_ 
   16#define ACTIONENGINE_ACTIONS_REGISTRY_H_ 
   23#include <absl/container/flat_hash_map.h> 
   63                const ActionHandler& handler);
 
   78  [[nodiscard]] 
bool IsRegistered(std::string_view name) 
const;
 
   97                                                std::string_view 
id) 
const;
 
  120  [[nodiscard]] std::unique_ptr<Action> 
MakeAction(
 
  121      std::string_view name, std::string_view action_id = 
"",
 
  122      std::vector<Port> inputs = {}, std::vector<Port> outputs = {}) 
const;
 
  148  [[nodiscard]] 
const ActionHandler& 
GetHandler(std::string_view name) 
const;
 
  150  [[nodiscard]] std::vector<std::string> ListRegisteredActions()
 const {
 
  151    std::vector<std::string> names;
 
  152    names.reserve(schemas_.size());
 
  153    for (
const auto& [name, _] : schemas_) {
 
  154      names.push_back(name);
 
  159  absl::flat_hash_map<std::string, ActionSchema> schemas_;
 
  160  absl::flat_hash_map<std::string, ActionHandler> handlers_;
 
 
std::unique_ptr< Action > MakeAction(std::string_view name, std::string_view action_id="", std::vector< Port > inputs={}, std::vector< Port > outputs={}) const
Creates an action instance based on the registered schema and handler.
Definition registry.cc:41
const ActionSchema & GetSchema(std::string_view name) const
Gets the schema of the action with the given name.
Definition registry.cc:53
const ActionHandler & GetHandler(std::string_view name) const
Gets the handler of the action with the given name.
Definition registry.cc:57
ActionMessage MakeActionMessage(std::string_view name, std::string_view id) const
Creates an ActionMessage for the action with the given name and ID.
Definition registry.cc:36
bool IsRegistered(std::string_view name) const
Checks if an action with the given name is registered.
Definition registry.cc:32
void Register(std::string_view name, const ActionSchema &schema, const ActionHandler &handler)
Registers an action with the given name, schema, and handler.
Definition registry.cc:26
A type that represents schemas for ActionEngine actions.
ActionEngine data structures used to implement actions and nodes (data streams).