30 #ifndef GUM_PRM_O3PRM_O3PRM_FACTORY_H 31 #define GUM_PRM_O3PRM_O3PRM_FACTORY_H 40 #include <agrum/PRM/PRM.h> 41 #include <agrum/PRM/o3prm/O3ClassFactory.h> 42 #include <agrum/PRM/o3prm/O3InterfaceFactory.h> 43 #include <agrum/PRM/o3prm/O3NameSolver.h> 44 #include <agrum/PRM/o3prm/O3SystemFactory.h> 45 #include <agrum/PRM/o3prm/O3TypeFactory.h> 46 #include <agrum/PRM/o3prm/O3prm.h> 47 #include <agrum/PRM/o3prm/cocoR/Parser.h> 48 #include <agrum/PRM/o3prm/cocoR/Scanner.h> 49 #include <agrum/agrum.h> 50 #include <agrum/tools/core/errorsContainer.h> 51 #include <agrum/tools/core/utils_string.h> 67 template <
typename GUM_SCALAR >
71 explicit O3prmReader(PRM< GUM_SCALAR >& prm);
72 O3prmReader(
const O3prmReader& src);
73 O3prmReader(O3prmReader&& src);
75 O3prmReader& operator=(
const O3prmReader& src);
76 O3prmReader& operator=(O3prmReader&& src);
80 Size readFile(
const std::string& file,
const std::string& module =
"");
84 Size readString(
const std::string& string);
86 void parseStream(std::istream& input, std::ostream& output, std::string module =
"");
95 void setClassPath(
const std::string& class_path);
105 void addClassPath(
const std::string& class_path);
107 gum::prm::PRM< GUM_SCALAR >* prm() {
return _prm_; }
108 const gum::prm::PRM< GUM_SCALAR >* prm()
const {
return _prm_; }
116 Size warnings()
const;
119 const ErrorsContainer& errorsContainer()
const;
122 Idx errLine(Idx i)
const;
124 Idx errCol(Idx i)
const;
126 std::wstring errFilename(Idx i)
const;
128 bool errIsError(Idx i)
const;
130 std::string errMsg(Idx i)
const;
133 void showElegantErrors(std::ostream& o = std::cerr)
const;
136 void showElegantErrorsAndWarnings(std::ostream& o = std::cerr)
const;
139 void showErrorCounts(std::ostream& o = std::cerr)
const;
143 PRM< GUM_SCALAR >* _prm_;
144 std::unique_ptr< O3PRM > _o3_prm_;
145 std::vector< std::string > _class_path_;
146 Set< std::string > _imported_;
149 ErrorsContainer _errors_;
151 void _readStream_(std::istream& input,
const std::string& file, std::string module =
"");
153 void _parseImport_(
const O3Import& i,
const std::string& module_path);
155 void _parseStream_(std::istream& input,
156 const std::string& filename,
157 const std::string& module);
159 std::vector<
const O3Import* > _copyImports_();
161 std::string _clean_(std::string text)
const;
162 std::string _print_(
const ParseError& err)
const;
163 std::string _readStream_(std::istream& input);
171 #include <agrum/PRM/o3prm/O3prmReader_tpl.h> 174 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 175 extern template class gum::prm::o3prm::O3prmReader<
double >;