aGrUM  0.16.0
completeProjectionPattern4MultiDimImplementation.h
Go to the documentation of this file.
1 
30 // check if we allowed these patterns to be used
31 #ifndef GUM_COMPLETE_PROJECTION_PATTERN_ALLOWED
32 
33 // #warning To use completeProjectionPattern4MultiDimImplementation.h, you must
34 // define GUM_COMPLETE_PROJECTION_PATTERN_ALLOWED
35 
36 #else
37 namespace gum {
38 
39 # ifdef GUM_MULTI_DIM_COMPLETE_PROJECTION_NAME
40  template < typename GUM_SCALAR >
41  GUM_SCALAR GUM_MULTI_DIM_COMPLETE_PROJECTION_NAME(
42  const MultiDimImplementation< GUM_SCALAR >& ttable,
43  Instantiation* instantiation) {
44 # endif
45 
46  typename CompleteProjectionRegister4MultiDim<
47  GUM_SCALAR >::CompleteProjectionPtr func;
48 
49  // get the appropriate function to perform the operation
50  try {
51  // try to find func(ttable,del_vars) in the register
53  GUM_MULTI_DIM_COMPLETE_PROJECTION_FUNC_NAME, ttable.name());
54  } catch (NotFound&) {
56  GUM_MULTI_DIM_COMPLETE_PROJECTION_FUNC_NAME, ttable.basename());
57  }
58 
59  // perform the projection
60  return func(&ttable, instantiation);
61  }
62 
63 } /* End of namespace gum */
64 #endif /* GUM_COMPLETE_PROJECTION_PATTERN_ALLOWED */
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.
Definition: agrum.h:25
CompleteProjectionPtr get(const std::string &projection_name, const std::string &type_multidim) const
returns the specialized projection operator assigned to a given type of MultiDimImplementation ...