Rumba C++ SDK
NodeDelegateRumbaAttributeObserver.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2021
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 
16 #pragma once
17 
19 
21 {
22 public:
23  ObserverRumbaAttribute(std::shared_ptr<maquina::NodeDelegate::Observer> notification_observer,
24  const std::string & attribute_owner, const std::string & attribute_name);
25  std::shared_ptr<maquina::NodeDelegate::AttributeDelegate> attribute();
26 
27  /* Build an Observer on a non-maquina NodeDelegate attribute.
28  * This will create an observer using the first maquina plug found in the parent nodes.
29  * If root_node is provided, the maquina parent node is search starting from root_node.
30  * root_node must be a non-maquina node.
31  */
32  static std::shared_ptr<maquina::NodeDelegate::Observer> create(const std::function<void()> & func,
33  maquina::NodeDelegate::AttributeDelegate& attribute_to_observe, bool in_interactive=true, bool is_value = false,
34  const std::shared_ptr< maquina::NodeDelegate >& root_node = nullptr);
35 
36 private:
37  std::shared_ptr<maquina::NodeDelegate::Observer> _notification_observer;
38  std::string _attribute_owner, _attribute_name;
39 };
Definition: NodeDelegateRumbaAttributeObserver.h:20
virtual std::shared_ptr< AttributeDelegate > attribute()=0
Return the observed attribute.
An object to keep an observer alive.
Definition: NodeDelegate.h:204
#define MAQUINA_EXPORT
Definition: Export.h:31
A node attribute delegate.
Definition: NodeDelegate.h:216