2 #ifndef SYDEVS_SYSTEMS_FUNCTION_NODE_H_
3 #define SYDEVS_SYSTEMS_FUNCTION_NODE_H_
47 void adopt_component_print_flags(
const system_node& node)
const;
49 virtual void flow_event() = 0;
82 throw std::logic_error(
"Unexpected unplanned event invoked for function node");
89 throw std::logic_error(
"Unexpected planned event invoked for function node");
96 throw std::logic_error(
"Unexpected finalization event invoked for function node");
100 inline void function_node::adopt_component_print_flags(
const system_node& node)
const
const std::string & node_name() const
Returns the name of the node.
Definition: system_node.h:135
void handle_finalization_event(duration elapsed_dt)
Never invoked for function nodes.
Definition: function_node.h:94
data_mode
Indicates the relevant data communication paradigm: dataflow (flow) or message-passing (message)...
Definition: data_mode.h:16
duration stop()
Stops the timer and returns the measured interval of wallclock time.
Definition: timer.h:93
A base class for all nodes from which systems models are constructed.
Definition: system_node.h:41
constexpr scale no_scale
Definition: scale.h:153
virtual ~function_node()=default
Destructor.
duration handle_initialization_event()
Invoked when all flow input ports have values; calls flow_event.
Definition: function_node.h:71
A data type which represents the general concept of scale as a dimensionless power of 1000...
Definition: scale.h:70
static constexpr quantity inf()
duration handle_unplanned_event(duration elapsed_dt)
Never invoked for function nodes.
Definition: function_node.h:80
Definition: node_context.h:16
void start()
Starts the timer.
Definition: timer.h:84
A base class for indivisible nodes in which function behavior is procedurally encoded.
Definition: function_node.h:21
scale time_precision() const
Returns no_scale for all function nodes.
Definition: function_node.h:65
data_mode node_dmode() const
Returns message for all atomic nodes.
Definition: function_node.h:59
function_node(const std::string &node_name, const node_context &external_context)
Constructs a function_node.
Definition: function_node.h:53
timer & ET() const
Returns a non-const reference to the node's event timer.
Definition: system_node.h:294
duration handle_planned_event(duration elapsed_dt)
Never invoked for function nodes.
Definition: function_node.h:87