aGrUM  0.14.2
ITerminalNodePolicy.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_INTERFACE_TERMINAL_NODE_POLICY_H
28 #define GUM_MULTI_DIM_FUNCTION_GRAPH_INTERFACE_TERMINAL_NODE_POLICY_H
29 
31 
32 namespace gum {
33 
34  // clang-format off
43  template <typename GUM_SCALAR>
45 
46  public:
47  // ============================================================================
49  // ============================================================================
51 
53  virtual void addTerminalNode( const NodeId& n, const GUM_SCALAR& v ) = 0;
54 
56  virtual void eraseTerminalNode( const NodeId& n ) = 0;
57 
59  virtual void clearAllTerminalNodes() = 0;
60 
62  // ============================================================================
64  // ============================================================================
66 
68  virtual bool existsTerminalNodeWithId( const NodeId& n ) const = 0;
69 
71  virtual bool existsTerminalNodeWithValue( const GUM_SCALAR& v ) const = 0;
72 
74  // ============================================================================
76  // ============================================================================
78 
80  virtual const GUM_SCALAR& terminalNodeValue( const NodeId& n ) const = 0;
81 
83  virtual const NodeId& terminalNodeId( const GUM_SCALAR& v ) const = 0;
84 
86  // ============================================================================
88  // ============================================================================
90 
92  virtual void beginValues() const = 0;
93 
95  virtual bool hasValue() const = 0;
96 
98  virtual void nextValue() const = 0;
99 
102  virtual const GUM_SCALAR& value() const = 0;
103 
106  virtual const NodeId& id() const = 0;
107 
109  };
110 
111 } // End of namespace gum
112 
113 #endif /* GUM_MULTI_DIM_FUNCTION_GRAPH_INTERFACE_TERMINAL_NODE_POLICY_H */
Interface specifying the methods to be implemented by any TerminalNodePolicy.
Base node set class for graphs.
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.
gum is the global namespace for all aGrUM entities
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:97