aGrUM  0.16.0
ITerminalNodePolicy.h
Go to the documentation of this file.
1 
30 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_INTERFACE_TERMINAL_NODE_POLICY_H
31 #define GUM_MULTI_DIM_FUNCTION_GRAPH_INTERFACE_TERMINAL_NODE_POLICY_H
32 
34 
35 namespace gum {
36 
37  // clang-format off
46  template <typename GUM_SCALAR>
48 
49  public:
50  // ============================================================================
52  // ============================================================================
54 
56  virtual void addTerminalNode( const NodeId& n, const GUM_SCALAR& v ) = 0;
57 
59  virtual void eraseTerminalNode( const NodeId& n ) = 0;
60 
62  virtual void clearAllTerminalNodes() = 0;
63 
65  // ============================================================================
67  // ============================================================================
69 
71  virtual bool existsTerminalNodeWithId( const NodeId& n ) const = 0;
72 
74  virtual bool existsTerminalNodeWithValue( const GUM_SCALAR& v ) const = 0;
75 
77  // ============================================================================
79  // ============================================================================
81 
83  virtual const GUM_SCALAR& terminalNodeValue( const NodeId& n ) const = 0;
84 
86  virtual const NodeId& terminalNodeId( const GUM_SCALAR& v ) const = 0;
87 
89  // ============================================================================
91  // ============================================================================
93 
95  virtual void beginValues() const = 0;
96 
98  virtual bool hasValue() const = 0;
99 
101  virtual void nextValue() const = 0;
102 
105  virtual const GUM_SCALAR& value() const = 0;
106 
109  virtual const NodeId& id() const = 0;
110 
112  };
113 
114 } // End of namespace gum
115 
116 #endif /* GUM_MULTI_DIM_FUNCTION_GRAPH_INTERFACE_TERMINAL_NODE_POLICY_H */
Interface specifying the methods to be implemented by any TerminalNodePolicy.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual const GUM_SCALAR & value() const =0
Returns the value of the current terminal nodes pointed by the constant safe iterator.
virtual void clearAllTerminalNodes()=0
Erase all terminal nodes.
virtual bool existsTerminalNodeWithValue(const GUM_SCALAR &v) const =0
Returns true if a terminal node matching this value exists.
virtual void addTerminalNode(const NodeId &n, const GUM_SCALAR &v)=0
Insert a new terminal node with given value.
virtual void beginValues() const =0
Initializes the constant safe iterator on terminal nodes.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
virtual const NodeId & terminalNodeId(const GUM_SCALAR &v) const =0
Returns the id of the terminal node that has the given value.
virtual bool hasValue() const =0
Indicates if constant safe iterator has reach end of terminal nodes list.
virtual bool existsTerminalNodeWithId(const NodeId &n) const =0
Returns true if a terminal node matching this id exists.
virtual const GUM_SCALAR & terminalNodeValue(const NodeId &n) const =0
Returns the value of the terminal node that has the given id.
virtual void nextValue() const =0
Increments the constant safe iterator.
virtual const NodeId & id() const =0
Returns the id of the current terminal nodes pointed by the constant safe iterator.
virtual void eraseTerminalNode(const NodeId &n)=0
Remove node matching given id.
Size NodeId
Type for node ids.
Definition: graphElements.h:98