aGrUM  0.16.0
completeProjectionRegister4MultiDim.h
Go to the documentation of this file.
1 
31 #ifndef GUM_COMPLETE_PROJECTION_REGISTER_4_MULTI_DIM_H
32 #define GUM_COMPLETE_PROJECTION_REGISTER_4_MULTI_DIM_H
33 
34 #include <iostream>
35 #include <string>
36 #include <utility>
37 
38 #include <agrum/core/hashTable.h>
39 #include <agrum/core/set.h>
42 
43 namespace gum {
44 
45  // the base object used by the projections
46  template < typename GUM_SCALAR >
47  class MultiDimImplementation;
48 
49  // ===========================================================================
50  // === GUM_MULTI_DIM_COMPLETE_PROJECTION_REGISTER ===
51  // ===========================================================================
52 
53  // clang-format off
64  // clang-format on
65  template < typename GUM_SCALAR >
67  public:
69  typedef GUM_SCALAR (*CompleteProjectionPtr)(
71 
72  // =========================================================================
74  // =========================================================================
76 
99  void insert(const std::string& projection_name,
100  const std::string& type_multidim,
101  CompleteProjectionPtr newFunction);
102 
117  void erase(const std::string& projection_name,
118  const std::string& type_multidim);
119 
134  bool exists(const std::string& projection_name,
135  const std::string& type_multidim) const;
136 
153  CompleteProjectionPtr get(const std::string& projection_name,
154  const std::string& type_multidim) const;
155 
157 
158  // =========================================================================
160  // =========================================================================
162 
170 
172 
173  private:
174  // =========================================================================
176  // =========================================================================
178 
181 
185 
188 
190 
193 
204  };
205 
208  template < typename GUM_SCALAR >
209  void registerCompleteProjection(const std::string& projection_name,
210  const std::string& type_multidim,
212  GUM_SCALAR >::CompleteProjectionPtr function);
213 
214 } /* namespace gum */
215 
216 // always include the implementations
218 
219 #endif /* GUM_COMPLETE_PROJECTION_REGISTER_MULTI_DIM_H */
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
static CompleteProjectionRegister4MultiDim & Register()
A named constructor that constructs one and only one Register per data type.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void erase(const std::string &projection_name, const std::string &type_multidim)
Removes a given entry from the register.
bool exists(const std::string &projection_name, const std::string &type_multidim) const
Indicates whether a given entry exists in the register.
HashTable< std::string, CompleteProjectionPtr > CompleteProjectionSet
The set of associations for a given projection type.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
The class for generic Hash Tables.
Definition: hashTable.h:679
void registerCompleteProjection(const std::string &projection_name, const std::string &type_multidim, typename CompleteProjectionRegister4MultiDim< GUM_SCALAR >::CompleteProjectionPtr function)
A function to more easily register new projection functions in MultiDims.
void insert(const std::string &projection_name, const std::string &type_multidim, CompleteProjectionPtr newFunction)
Adds a new entry into the register.
GUM_SCALAR(* CompleteProjectionPtr)(const MultiDimImplementation< GUM_SCALAR > *, Instantiation *instantiation)
the type of functions used by the register
HashTable< std::string, CompleteProjectionSet *> __set
A mapping from the types of MultiDimImplementations to projection operators.
CompleteProjectionRegister4MultiDim()
Default constructor: creates an empty register.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:83
<agrum/multidim/multiDimImplementation.h>
A container for registering complete projection functions on multiDimImplementations, i.e., functions projecting tables over all their variables.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.