Class InputSocket#
Defined in File socket.h
Inheritance Relationships#
Base Type#
public ng::Socket(Class Socket)
Class Documentation#
-
class InputSocket : public ng::Socket#
Public Functions
-
InputSocket(const std::string &name = "", const socket_id_t &id = null_socket, socket_t type = null_socket_type, bool active = true, const std::string &value = "", bool linkable = true, const std::set<std::string> &allowed_values = {}, const std::set<qualifier_t> &on_added_link_callbacks = {}, const std::set<qualifier_t> &on_broken_link_callbacks = {}, const std::set<qualifier_t> &on_value_changed_callbacks = {})#
-
bool set_value(const std::string &value)#
Sets the value if it is allowed (see is_allowed_value). Validators are not checked here (see check_validity).
- Returns:
true if the value was accepted.
-
inline void set_allowed_values(const std::set<std::string> &values)#
-
inline void set_linkable(bool linkable)#
-
inline const std::string &get_value() const#
-
inline const std::set<std::string> &get_allowed_values() const#
-
inline bool is_linkable() const#
-
inline bool is_enum() const#
-
inline const std::set<qualifier_t> &get_on_value_changed_callbacks() const#
-
inline void register_on_value_changed_callback(const qualifier_t &cb)#
-
bool is_allowed_value(const std::string &value) const#
A value is allowed if the socket has no whitelist, or if the value is in the whitelist.
-
bool check_validity(const std::string &value) const#
Checks the value against the validators registered (ValidatorsRegistry) for the types of this socket. The value is valid if no validator is registered for any of the socket’s types, or if at least one of the registered validators accepts it.
-
void trigger_on_added_link_callbacks(Graph &graph, Node &node_from, OutputSocket &from, Node &node_to)#
-
void trigger_on_broken_link_callbacks(Graph &graph, Node &node_from, OutputSocket &from, Node &node_to, LinkBreakReason reason)#
-
InputSocket(const std::string &name = "", const socket_id_t &id = null_socket, socket_t type = null_socket_type, bool active = true, const std::string &value = "", bool linkable = true, const std::set<std::string> &allowed_values = {}, const std::set<qualifier_t> &on_added_link_callbacks = {}, const std::set<qualifier_t> &on_broken_link_callbacks = {}, const std::set<qualifier_t> &on_value_changed_callbacks = {})#