15#ifndef ACTIONENGINE_ACTIONS_SCHEMA_H_ 
   16#define ACTIONENGINE_ACTIONS_SCHEMA_H_ 
   25#include <absl/container/flat_hash_map.h> 
   26#include <absl/status/status.h> 
   27#include <absl/strings/str_cat.h> 
   28#include <absl/strings/str_format.h> 
   29#include <absl/strings/str_join.h> 
   51    std::function<absl::Status(
const std::shared_ptr<Action>&)>;
 
   54using VoidActionHandler = std::function<void(
const std::shared_ptr<Action>&)>;
 
   56using NameAndMimetype = std::pair<std::string, std::string>;
 
   57using NameToMimetype = absl::flat_hash_map<std::string, std::string>;
 
   82      std::string_view action_id) 
const;
 
 
  105template <
typename Sink>
 
  106void AbslStringify(Sink& sink, 
const ActionSchema& schema) {
 
  107  std::vector<std::string> input_reprs;
 
  108  input_reprs.reserve(schema.
inputs.size());
 
  109  for (
const auto& [name, type] : schema.
inputs) {
 
  110    input_reprs.push_back(absl::StrCat(name, 
":", type));
 
  113  std::vector<std::string> output_reprs;
 
  114  output_reprs.reserve(schema.
outputs.size());
 
  115  for (
const auto& [name, type] : schema.
outputs) {
 
  116    output_reprs.push_back(absl::StrCat(name, 
":", type));
 
  119  absl::Format(&sink, 
"ActionSchema{name: %s, inputs: %s, outputs: %s}",
 
  120               schema.
name, absl::StrJoin(input_reprs, 
", "),
 
  121               absl::StrJoin(output_reprs, 
", "));
 
NameToMimetype inputs
Definition schema.h:93
std::string name
Definition schema.h:85
NameToMimetype outputs
Definition schema.h:101
ActionMessage GetActionMessage(std::string_view action_id) const
Creates an ActionMessage to create an action instance with the given ID.
Definition schema.cc:23
ActionEngine data structures used to implement actions and nodes (data streams).