aGrUM  0.16.0
O3TypeFactory.h
Go to the documentation of this file.
1 
31 #include <memory>
32 #include <string>
33 
34 #include <agrum/PRM/PRM.h>
35 #include <agrum/PRM/PRMFactory.h>
37 #include <agrum/PRM/o3prm/O3prm.h>
38 #include <agrum/PRM/o3prm/errors.h>
40 #include <agrum/core/hashTable.h>
41 #include <agrum/core/set.h>
42 
43 #ifndef GUM_PRM_O3PRM_O3TYPE_FACTORY_H
44 # define GUM_PRM_O3PRM_O3TYPE_FACTORY_H
45 
46 namespace gum {
47  namespace prm {
48  namespace o3prm {
49 
60  template < typename GUM_SCALAR >
61  class O3TypeFactory {
62  public:
64  O3PRM& o3_prm,
66  ErrorsContainer& errors);
72 
73  void build();
74 
75  private:
80 
81  bool __build;
82 
88  std::vector< O3Type* > __o3Types;
89  std::vector< O3IntType* > __o3IntTypes;
90  std::vector< O3RealType* > __o3RealTypes;
91 
92  void __buildTypes();
93  void __buildIntTypes();
94  void __buildRealTypes();
95 
96  bool __isPrimitiveType(O3Type& type);
97 
98  bool __checkO3Types();
100  bool __addTypes2Dag();
101  bool __addArcs2Dag();
102  bool __checkLabels(O3Type& type);
103 
105 
106  bool __checkO3IntTypes();
107  bool __checkO3RealTypes();
108  };
109 
110  } // namespace o3prm
111  } // namespace prm
112 } // namespace gum
113 
114 // always include the implementation of the templates
116 
117 
118 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
119 extern template class gum::prm::o3prm::O3TypeFactory< double >;
120 # endif
121 
122 
123 #endif // GUM_PRM_O3PRM_O3TYPE_FACTORY_H
HashTable< std::string, gum::NodeId > __nameMap
Definition: O3TypeFactory.h:84
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Builds gum::prm::PRMType from gum::prm::o3prm::O3Type, gum::prm::o3prm::O3IntType and gum::prm::o3prm...
Definition: O3TypeFactory.h:61
std::vector< O3RealType *> __o3RealTypes
Definition: O3TypeFactory.h:90
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.
PRM< GUM_SCALAR > * __prm
Definition: O3TypeFactory.h:76
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::vector< O3Type *> __o3Types
Definition: O3TypeFactory.h:88
The O3Type is part of the AST of the O3PRM language.
Definition: O3prm.h:204
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
This class is used contain and manipulate gum::ParseError.
HashTable< std::string, O3Type *> __typeMap
Definition: O3TypeFactory.h:85
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
HashTable< NodeId, O3Type *> __nodeMap
Definition: O3TypeFactory.h:86
The class for generic Hash Tables.
Definition: hashTable.h:679
Resolves names for the different O3PRM factories.
Definition: O3NameSolver.h:57
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool __isPrimitiveType(O3Type &type)
O3TypeFactory(PRM< GUM_SCALAR > &prm, O3PRM &o3_prm, O3NameSolver< GUM_SCALAR > &solver, ErrorsContainer &errors)
std::vector< O3IntType *> __o3IntTypes
Definition: O3TypeFactory.h:89
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
Definition: PRM.h:66
O3NameSolver< GUM_SCALAR > * __solver
Definition: O3TypeFactory.h:78
HashTable< std::string, O3Type *> __superMap
Definition: O3TypeFactory.h:83
The O3PRM is part of the AST of the O3PRM language.
Definition: O3prm.h:892
O3TypeFactory & operator=(const O3TypeFactory< GUM_SCALAR > &src)
Base class for dag.
Definition: DAG.h:102
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.