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_;
void clear_flow_outputs()
Definition: node_interface.cpp:244
node_interface & operator=(const node_interface &)=delete
No copy assignment.
const std::string & flow_output_port_name(int64 port_index)
Definition: node_interface.cpp:232
int64 message_input_port_count()
Definition: node_interface.cpp:101
void print_message_input(int64 port_index)
Definition: node_interface.cpp:311
void assign_flow_output(int64 port_index, const pointer &val)
Definition: node_interface.cpp:250
int64 add_message_input_port(const std::string &port_name)
Definition: node_interface.cpp:92
void clear_message_input()
Definition: node_interface.cpp:125
tostring_function message_output_tostring_func(int64 port_index)
Definition: node_interface.cpp:205
int64 missing_flow_input()
Definition: node_interface.cpp:268
int64 node_index()
Definition: node_interface.h:151
const std::string & message_output_port_name(int64 port_index)
Definition: node_interface.cpp:167
bool print_on_event_flag()
Definition: node_interface.cpp:350
std::function< std::string(const pointer &)> tostring_function
Definition: qualified_type.h:19
data_mode
Indicates the relevant data communication paradigm: dataflow (flow) or message-passing (message)...
Definition: data_mode.h:16
A base class for all nodes from which systems models are constructed.
Definition: system_node.h:41
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 print_elapsed_duration(duration elapsed_dt)
Definition: node_interface.cpp:382
void print_flow_input(int64 port_index)
Definition: node_interface.cpp:300
void print_command_text(const std::string &command, const std::string &text)
Definition: node_interface.cpp:344
const std::string & full_name()
Definition: node_interface.h:145
tostring_function flow_input_tostring_func(int64 port_index)
Definition: node_interface.cpp:80
void print_message_output(int64 list_index, int64 port_index)
Definition: node_interface.cpp:322
void set_flow_input_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:86
void clear_message_outputs()
Definition: node_interface.cpp:191
const std::string & flow_input_port_name(int64 port_index)
Definition: node_interface.cpp:56
data_goal dgoal() const
Definition: node_interface.h:189
void deactivate()
Definition: node_interface.h:171
node_context & external_context()
Definition: node_interface.h:157
virtual ~node_interface()=default
Destructor.
int64 add_message_output_port(const std::string &port_name)
Definition: node_interface.cpp:153
void print_flow_output(int64 port_index)
Definition: node_interface.cpp:333
int64 message_input_port_index()
Definition: node_interface.cpp:119
int64 message_output_port_count()
Definition: node_interface.cpp:161
void print_on_planned_duration(bool flag)
Definition: node_interface.cpp:396
bool print_on_elapsed_duration_flag()
Definition: node_interface.cpp:370
const std::string & node_name()
Definition: node_interface.h:139
bool print_on_planned_duration_flag()
Definition: node_interface.cpp:390
int64 message_output_list_size()
Definition: node_interface.cpp:173
void print_port_value(const std::string &port_name, const std::string &val_string)
Definition: node_interface.cpp:294
int64 flow_output_port_count()
Definition: node_interface.cpp:226
data_goal
Indicates whether data is meant to serve as input or output.
Definition: data_goal.h:15
node_interface(const std::string &node_name, system_node *node_ptr, const node_context &external_context)
Definition: node_interface.cpp:8
int64 flow_input_port_count()
Definition: node_interface.cpp:50
tostring_function flow_output_tostring_func(int64 port_index)
Definition: node_interface.cpp:256
void set_message_output_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:211
void set_flow_output_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:262
Definition: node_context.h:16
Definition: node_interface.h:16
void clear_flow_inputs()
Definition: node_interface.cpp:68
void activate(data_mode dmode, data_goal dgoal)
Definition: node_interface.h:163
void print_event(const std::string &text)
Definition: node_interface.cpp:362
int64 add_flow_output_port(const std::string &port_name)
Definition: node_interface.cpp:217
bool active() const
Definition: node_interface.h:177
void print_planned_duration(duration planned_dt)
Definition: node_interface.cpp:402
int64 add_flow_input_port(const std::string &port_name)
Definition: node_interface.cpp:41
void set_message_input(int64 port_index, const pointer &val)
Definition: node_interface.cpp:134
int64 message_output_index(int64 list_index)
Definition: node_interface.cpp:179
void print_on_elapsed_duration(bool flag)
Definition: node_interface.cpp:376
tostring_function message_input_tostring_func(int64 port_index)
Definition: node_interface.cpp:141
void append_message_output(int64 port_index, const pointer &val)
Definition: node_interface.cpp:198
const pointer & flow_input_port_value(int64 port_index)
Definition: node_interface.cpp:62
void set_message_input_printable(int64 port_index, tostring_function tostring_func)
Definition: node_interface.cpp:147
void assign_flow_input(int64 port_index, const pointer &val)
Definition: node_interface.cpp:74
const pointer & message_input_port_value(int64 port_index)
Definition: node_interface.cpp:113
int64 missing_flow_output()
Definition: node_interface.cpp:281
const std::string & message_input_port_name(int64 port_index)
Definition: node_interface.cpp:107
const pointer & flow_output_port_value(int64 port_index)
Definition: node_interface.cpp:238
data_mode dmode() const
Definition: node_interface.h:183
A data type which represents a pointer to anything.
Definition: pointer.h:27