2 #ifndef SYDEVS_SYSTEMS_NODE_INTERFACE_H_
3 #define SYDEVS_SYSTEMS_NODE_INTERFACE_H_
82 void print_port_value(
const std::string& port_name,
const std::string& val_string);
103 void print(
const std::string& text);
105 std::string node_name_;
106 std::string full_name_;
111 std::vector<std::string> flow_input_port_names_;
112 std::vector<tostring_function> flow_input_port_tostring_funcs_;
113 std::vector<pointer> flow_input_port_vals_;
115 std::vector<std::string> message_input_port_names_;
116 std::vector<tostring_function> message_input_port_tostring_funcs_;
117 std::vector<pointer> message_input_port_vals_;
118 int64 message_input_port_index_;
120 std::vector<std::string> message_output_port_names_;
121 std::vector<tostring_function> message_output_port_tostring_funcs_;
122 std::vector<int64> message_output_indices_;
123 std::vector<pointer> message_output_vals_;
125 std::vector<std::string> flow_output_port_names_;
126 std::vector<tostring_function> flow_output_port_tostring_funcs_;
127 std::vector<pointer> flow_output_port_vals_;
133 bool print_on_event_;
134 bool print_on_elapsed_duration_;
135 bool print_on_planned_duration_;
159 return external_context_;
A data type which represents a pointer to anything.
Definition: pointer.h:29
Definition: node_context.h:17
Definition: node_interface.h:17
int64 flow_output_port_count()
Definition: node_interface.cpp:226
void clear_flow_outputs()
Definition: node_interface.cpp:244
void print_port_value(const std::string &port_name, const std::string &val_string)
Definition: node_interface.cpp:294
void print_planned_duration(duration planned_dt)
Definition: node_interface.cpp:402
const std::string & full_name()
Definition: node_interface.h:145
node_interface & operator=(node_interface &&)=delete
No move assignment.
int64 missing_flow_output()
Definition: node_interface.cpp:281
int64 add_message_output_port(const std::string &port_name)
Definition: node_interface.cpp:153
void print_elapsed_duration(duration elapsed_dt)
Definition: node_interface.cpp:382
int64 add_flow_output_port(const std::string &port_name)
Definition: node_interface.cpp:217
const pointer & flow_input_port_value(int64 port_index)
Definition: node_interface.cpp:62
int64 message_input_port_index()
Definition: node_interface.cpp:119
void assign_flow_input(int64 port_index, const pointer &val)
Definition: node_interface.cpp:74
node_interface(const std::string &node_name, system_node *node_ptr, const node_context &external_context)
Definition: node_interface.cpp:8
node_interface(const node_interface &)=delete
No copy constructor.
int64 missing_flow_input()
Definition: node_interface.cpp:268
void set_flow_output_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:262
int64 message_input_port_count()
Definition: node_interface.cpp:101
void print_on_planned_duration(bool flag)
Definition: node_interface.cpp:396
void print_message_input(int64 port_index)
Definition: node_interface.cpp:311
int64 message_output_port_count()
Definition: node_interface.cpp:161
node_interface & operator=(const node_interface &)=delete
No copy assignment.
void clear_message_input()
Definition: node_interface.cpp:125
node_context & external_context()
Definition: node_interface.h:157
void set_message_input(int64 port_index, const pointer &val)
Definition: node_interface.cpp:134
const pointer & message_output_value(int64 list_index)
Definition: node_interface.cpp:185
void print_on_event(bool flag=true)
Definition: node_interface.cpp:356
void set_flow_input_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:86
data_goal dgoal() const
Definition: node_interface.h:189
tostring_function message_input_tostring_func(int64 port_index)
Definition: node_interface.cpp:141
void activate(data_mode dmode, data_goal dgoal)
Definition: node_interface.h:163
void print_flow_output(int64 port_index)
Definition: node_interface.cpp:333
tostring_function message_output_tostring_func(int64 port_index)
Definition: node_interface.cpp:205
tostring_function flow_output_tostring_func(int64 port_index)
Definition: node_interface.cpp:256
void assign_flow_output(int64 port_index, const pointer &val)
Definition: node_interface.cpp:250
node_interface(node_interface &&)=delete
No move constructor.
const std::string & flow_input_port_name(int64 port_index)
Definition: node_interface.cpp:56
void clear_flow_inputs()
Definition: node_interface.cpp:68
bool active() const
Definition: node_interface.h:177
int64 message_output_index(int64 list_index)
Definition: node_interface.cpp:179
const pointer & flow_output_port_value(int64 port_index)
Definition: node_interface.cpp:238
int64 add_message_input_port(const std::string &port_name)
Definition: node_interface.cpp:92
const pointer & message_input_port_value(int64 port_index)
Definition: node_interface.cpp:113
int64 message_output_list_size()
Definition: node_interface.cpp:173
void set_message_input_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:147
void print_flow_input(int64 port_index)
Definition: node_interface.cpp:300
void print_on_elapsed_duration(bool flag)
Definition: node_interface.cpp:376
void set_message_output_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:211
bool print_on_elapsed_duration_flag()
Definition: node_interface.cpp:370
bool print_on_planned_duration_flag()
Definition: node_interface.cpp:390
void print_command_text(const std::string &command, const std::string &text)
Definition: node_interface.cpp:344
const std::string & message_output_port_name(int64 port_index)
Definition: node_interface.cpp:167
const std::string & flow_output_port_name(int64 port_index)
Definition: node_interface.cpp:232
tostring_function flow_input_tostring_func(int64 port_index)
Definition: node_interface.cpp:80
const std::string & message_input_port_name(int64 port_index)
Definition: node_interface.cpp:107
void print_event(const std::string &text)
Definition: node_interface.cpp:362
data_mode dmode() const
Definition: node_interface.h:183
int64 node_index()
Definition: node_interface.h:151
virtual ~node_interface()=default
Destructor.
int64 flow_input_port_count()
Definition: node_interface.cpp:50
void deactivate()
Definition: node_interface.h:171
void clear_message_outputs()
Definition: node_interface.cpp:191
void print_message_output(int64 list_index, int64 port_index)
Definition: node_interface.cpp:322
void append_message_output(int64 port_index, const pointer &val)
Definition: node_interface.cpp:198
int64 add_flow_input_port(const std::string &port_name)
Definition: node_interface.cpp:41
const std::string & node_name()
Definition: node_interface.h:139
bool print_on_event_flag()
Definition: node_interface.cpp:350
A base class for all nodes from which systems models are constructed.
Definition: system_node.h:42
data_mode
Indicates the relevant data communication paradigm: dataflow (flow) or message-passing (message).
Definition: data_mode.h:16
data_goal
Indicates whether data is meant to serve as input or output.
Definition: data_goal.h:15
std::function< std::string(const pointer &)> tostring_function
Definition: qualified_type.h:19
int64_t int64
Definition: number_types.h:15