aGrUM  0.16.0
projectionRegister4MultiDim.h
Go to the documentation of this file.
1 
31 #ifndef GUM_PROJECTION_REGISTER_4_MULTI_DIM_H
32 #define GUM_PROJECTION_REGISTER_4_MULTI_DIM_H
33 
34 #include <agrum/core/hashTable.h>
35 #include <agrum/core/set.h>
37 #include <iostream>
38 #include <string>
39 #include <utility>
40 
41 namespace gum {
42 
43  // the base object used by the projections
44  template < typename GUM_SCALAR >
45  class MultiDimImplementation;
46 
47  // ===========================================================================
48  // === GUM_MULTI_DIM_PROJECTION_REGISTER ===
49  // ===========================================================================
50  // clang-format off
60  // clang-format on
61  template < typename GUM_SCALAR >
63  public:
65  typedef MultiDimImplementation< GUM_SCALAR >* (*ProjectionPtr)(
68 
69  // ========================================================================
71  // ========================================================================
73 
97  void insert(const std::string& projection_name,
98  const std::string& type_multidim,
99  ProjectionPtr newFunction);
100 
115  void erase(const std::string& projection_name,
116  const std::string& type_multidim);
117 
132  bool exists(const std::string& projection_name,
133  const std::string& type_multidim) const;
134 
153  ProjectionPtr get(const std::string& projection_name,
154  const std::string& type_multidim) const;
155 
157  // ========================================================================
159  // ========================================================================
161 
169 
171 
172  private:
173  // ========================================================================
175  // ========================================================================
177 
180 
183 
186 
188 
191 
202  };
203 
205  template < typename GUM_SCALAR >
206  void registerProjection(
207  const std::string& projection_name,
208  const std::string& type_multidim,
210 
211  // a display operator for ProjectionPtrs
212 
213 } /* namespace gum */
214 
215 // always include the implementations
217 
218 #endif /* GUM_PROJECTION_REGISTER_MULTI_DIM_H */
static ProjectionRegister4MultiDim & Register()
a named constructor that constructs one and only one Register per data type
MultiDimImplementation< GUM_SCALAR > *(* ProjectionPtr)(const MultiDimImplementation< GUM_SCALAR > *, const Set< const DiscreteVariable * > &)
the type of functions used by the 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.
HashTable< std::string, ProjectionPtr > ProjectionSet
The set of associations for a given projection type.
void erase(const std::string &projection_name, const std::string &type_multidim)
removes a given entry from the register
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
bool exists(const std::string &projection_name, const std::string &type_multidim) const
indicates whether a given entry exists in the register
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
void registerProjection(const std::string &projection_name, const std::string &type_multidim, typename ProjectionRegister4MultiDim< GUM_SCALAR >::ProjectionPtr function)
A function to more easily register new projection functions in MultiDims.
HashTable< std::string, ProjectionSet *> __set
A mapping from the types of MultiDimImplementations to projection operators.
A container for registering projection functions on multiDimImplementations, i.e., functions projecting tables over a subset of their variables.
void insert(const std::string &projection_name, const std::string &type_multidim, ProjectionPtr newFunction)
adds a new entry into the register
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
~ProjectionRegister4MultiDim()
Destructor.
ProjectionRegister4MultiDim()
Default constructor: creates an empty register.
<agrum/multidim/multiDimImplementation.h>
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.