63class Action : 
public std::enable_shared_from_this<Action> {
 
   87                  std::vector<Port> inputs = {},
 
   88                  std::vector<Port> outputs = {});
 
  126      std::string_view name, std::optional<bool> bind_stream = std::nullopt);
 
  142      std::string_view name,
 
  143      const std::optional<bool> bind_stream = std::nullopt) {
 
  144    act::MutexLock lock(&mu_);
 
  145    return GetOutputInternal(name, bind_stream);
 
 
  155  void BindHandler(ActionHandler handler) { handler_ = std::move(handler); }
 
  157  void BindNodeMap(
NodeMap* absl_nullable node_map);
 
  210      std::string_view name, std::string_view action_id = 
"") 
const;
 
  216  [[nodiscard]] std::string 
GetId()
 const { 
return id_; }
 
  218  [[nodiscard]] 
const ActionSchema& GetSchema()
 const { 
return schema_; }
 
  234  absl::Status 
Await(absl::Duration timeout = absl::InfiniteDuration());
 
  292    act::MutexLock lock(&mu_);
 
 
  314  void BindStreamsOnInputsByDefault(
bool bind) {
 
  315    act::MutexLock lock(&mu_);
 
  316    bind_streams_on_inputs_default_ = bind;
 
  319  void BindStreamsOnOutputsByDefault(
bool bind) {
 
  320    act::MutexLock lock(&mu_);
 
  321    bind_streams_on_outputs_default_ = bind;
 
  324  void SetUserData(std::shared_ptr<void> data) {
 
  325    act::MutexLock lock(&mu_);
 
  326    user_data_ = std::move(data);
 
  329  [[nodiscard]] 
void* absl_nullable GetUserData()
 const {
 
  330    act::MutexLock lock(&mu_);
 
  331    return user_data_.get();
 
  335  void CancelInternal() const ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
 
  339  std::
string GetInputId(std::string_view name) const;
 
  343  std::
string GetOutputId(std::string_view name) const;
 
  345  AsyncNode* absl_nonnull GetOutputInternal(
 
  346      std::string_view name, std::optional<
bool> bind_stream = std::nullopt)
 
  347      ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
 
  349  void UnbindStreams() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
 
  351  mutable act::Mutex mu_{};
 
  352  act::CondVar cv_ ABSL_GUARDED_BY(mu_);
 
  354  ActionSchema schema_;
 
  355  absl::flat_hash_map<std::string, std::string> input_name_to_id_;
 
  356  absl::flat_hash_map<std::string, std::string> output_name_to_id_;
 
  358  ActionHandler handler_;
 
  359  bool has_been_called_ ABSL_GUARDED_BY(mu_) = 
false;
 
  360  bool has_been_run_ ABSL_GUARDED_BY(mu_) = 
false;
 
  363  NodeMap* absl_nullable node_map_ ABSL_GUARDED_BY(mu_) = 
nullptr;
 
  364  WireStream* absl_nullable stream_ ABSL_GUARDED_BY(mu_) = 
nullptr;
 
  365  Session* absl_nullable session_ ABSL_GUARDED_BY(mu_) = 
nullptr;
 
  367  absl::flat_hash_set<ChunkStoreReader*> reffed_readers_ ABSL_GUARDED_BY(mu_);
 
  369  bool bind_streams_on_inputs_default_ = 
true;
 
  370  bool bind_streams_on_outputs_default_ = 
false;
 
  371  absl::flat_hash_set<AsyncNode*> nodes_with_bound_streams_
 
  372      ABSL_GUARDED_BY(mu_);
 
  374  std::unique_ptr<thread::PermanentEvent> cancelled_;
 
  376  bool clear_inputs_after_run_ ABSL_GUARDED_BY(mu_) = 
false;
 
  377  bool clear_outputs_after_run_ ABSL_GUARDED_BY(mu_) = 
false;
 
  378  std::optional<absl::Status> run_status_ ABSL_GUARDED_BY(mu_) = std::nullopt;
 
  380  std::shared_ptr<void> user_data_ ABSL_GUARDED_BY(mu_) = 
nullptr;
 
 
Action(ActionSchema schema, std::string_view id="", std::vector< Port > inputs={}, std::vector< Port > outputs={})
Constructor. Creates an action in the context given by node_map, stream, and session.
Definition action.cc:34