5#include <ossia/detail/mutex.hpp> 
    7#include <ossia/detail/string_view.hpp> 
    8#include <ossia/network/base/name_validation.hpp> 
    9#include <ossia/network/common/parameter_properties.hpp> 
   11#include <nano_signal_slot.hpp> 
   50  using children_t = std::vector<std::unique_ptr<node_base>>;
 
   70  const std::string& 
get_name()
 const { 
return m_name; }
 
   71  virtual node_base& set_name(std::string) = 0;
 
   76  virtual void set_parameter(std::unique_ptr<ossia::net::parameter_base>);
 
   77  virtual bool remove_parameter() = 0;
 
   84  const extended_attributes& get_extended_attributes() 
const;
 
   85  void set_extended_attributes(
const extended_attributes&);
 
  101  template <
typename T>
 
  102  void set(std::string_view str, 
const T& val);
 
  103  template <
typename T>
 
  104  void set(std::string_view str, T&& val);
 
  106  template <
typename T>
 
  107  void set(std::string_view str, 
const std::optional<T>& val);
 
  108  template <
typename T>
 
  109  void set(std::string_view str, std::optional<T>&& val);
 
  111  void set(std::string_view str, 
bool value);
 
  113  template <
typename Attribute, 
typename T>
 
  114  void set(Attribute a, 
const T& 
value);
 
  115  template <
typename Attribute, 
typename T>
 
  116  void set(Attribute a, T& 
value);
 
  117  template <
typename Attribute, 
typename T>
 
  118  void set(Attribute a, T&& 
value);
 
  132  node_base* create_child(std::string name);
 
  140  node_base* add_child(std::unique_ptr<node_base>);
 
  150  node_base* find_child(std::string_view name);
 
  152  node_base* find_child(
const QString& name);
 
  158  bool remove_child(
const std::string& name);
 
  159  bool remove_child(
const node_base& name);
 
  162  void clear_children();
 
  164  operator const extended_attributes&() 
const 
  168  operator extended_attributes&()
 
  175    return {m_children, m_mutex};
 
  183  mutable shared_mutex_t m_mutex;
 
  186  std::vector<node_base*> children_copy() 
const;
 
  189  std::vector<std::string> children_names() 
const;
 
  192  int children_count() 
const;
 
  197  const std::string& osc_address()
 const 
  199    return m_oscAddressCache;
 
  201  virtual void on_address_change();
 
  208  virtual std::unique_ptr<node_base> 
make_child(
const std::string& name) = 0;
 
  214  children_t m_children TS_GUARDED_BY(m_mutex);
 
  215  extended_attributes m_extended{0};
 
  216  std::string m_oscAddressCache;
 
 
Thread-safe read-only reference to a container.
Definition locked_container.hpp:15
Root of a device tree.
Definition ossia/network/base/device.hpp:58
The node_base class.
Definition node.hpp:48
virtual void removing_child(node_base &node_base)=0
Reimplement for a specific removal action.
const auto & unsafe_children() const TS_REQUIRES(m_mutex)
Non mutex-protected version. With great powers, yada yada etc etc.
Definition node.hpp:179
virtual node_base * get_parent() const =0
Parent of this node. May be null if it is the device (i.e. root).
virtual parameter_base * create_parameter(val_type=val_type::IMPULSE)=0
Allows a node to carry a value.
virtual device_base & get_device() const =0
The device in which this node is.
Nano::Signal< void(const node_base &)> about_to_be_deleted
The node subclasses must call this in their destructor.
Definition node.hpp:204
virtual std::unique_ptr< node_base > make_child(const std::string &name)=0
Should return nullptr if no child is to be added.
const std::string & get_name() const
The name of this node, e.g. "foo".
Definition node.hpp:70
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The value class.
Definition value.hpp:173
val_type
Enum to represent the types that a value can take.
Definition parameter_properties.hpp:16
auto get_attribute(const any_map &e, std::string_view name)
get_attribute Get an attribute of an any_map.
Definition any_map.hpp:29