![]() |
aGrUM 3.2.0
a C++ library for (probabilistic) graphical models
|
This class read O3PRM files and creates the corresponding gum::prm::PRM. More...
#include <agrum/PRM/o3prm/O3prmReader.h>
Public Member Functions | |
| O3prmReader () | |
| O3prmReader (PRM< GUM_SCALAR > &prm) | |
| O3prmReader (const O3prmReader &src) | |
| O3prmReader (O3prmReader &&src) | |
| ~O3prmReader () | |
| O3prmReader & | operator= (const O3prmReader &src) |
| O3prmReader & | operator= (O3prmReader &&src) |
| Size | readFile (std::string_view file, std::string_view module="") |
| Read file and load its content using a PRMFactory. The package parameter set the file's content package. | |
| Size | readString (const std::string &string) |
| With readString method, you must set the current path to search from import yourself, using addClassPath. | |
| void | parseStream (std::istream &input, std::ostream &output, std::string module="") |
| void | setClassPath (std::string_view class_path) |
| This methods defines the list of paths to look for o3prm files. | |
| void | addClassPath (std::string_view class_path) |
| Add a list of paths to look for o3prm files. | |
| gum::prm::PRM< GUM_SCALAR > * | prm () |
| const gum::prm::PRM< GUM_SCALAR > * | prm () const |
| Size | errors () const |
| publishing Errors API | |
| Size | warnings () const |
| const ErrorsContainer & | errorsContainer () const |
| publishing Errors API | |
| Idx | errLine (Idx i) const |
| line of ith error or warning | |
| Idx | errCol (Idx i) const |
| col of ith error or warning | |
| std::wstring | errFilename (Idx i) const |
| filename of ith error or warning | |
| bool | errIsError (Idx i) const |
| type of ith error or warning | |
| std::string | errMsg (Idx i) const |
| message of ith error or warning | |
| void | showElegantErrors (std::ostream &o=std::cerr) const |
| send on std::cerr the list of errors | |
| void | showElegantErrorsAndWarnings (std::ostream &o=std::cerr) const |
| send on std::cerr the list of errors or warnings | |
| void | showErrorCounts (std::ostream &o=std::cerr) const |
| send on std::cerr the number of errors and the number of warnings | |
Private Member Functions | |
| void | _readStream_ (std::istream &input, const std::string &file, std::string module="") |
| void | _parseImport_ (const O3Import &i, const std::string &module_path) |
| void | _parseStream_ (std::istream &input, const std::string &filename, const std::string &module) |
| std::vector< const O3Import * > | _copyImports_ () |
| std::string | _clean_ (std::string text) const |
| std::string | _print_ (const ParseError &err) const |
| std::string | _readStream_ (std::istream &input) |
Private Attributes | |
| PRM< GUM_SCALAR > * | _prm_ |
| std::unique_ptr< O3PRM > | _o3_prm_ |
| std::vector< std::string > | _class_path_ |
| Set< std::string > | _imported_ |
| ErrorsContainer | _errors_ |
This class read O3PRM files and creates the corresponding gum::prm::PRM.
| GUM_SCALAR | The scalar type to use with the gum::prm::PRM. |
Definition at line 93 of file O3prmReader.h.
| gum::prm::o3prm::O3prmReader< GUM_SCALAR >::O3prmReader | ( | ) |
Definition at line 162 of file O3prmReader_tpl.h.
References O3prmReader(), _o3_prm_, and _prm_.
Referenced by O3prmReader(), O3prmReader(), O3prmReader(), ~O3prmReader(), operator=(), and operator=().
|
explicit |
Definition at line 168 of file O3prmReader_tpl.h.
References O3prmReader(), _o3_prm_, _prm_, and prm().
| gum::prm::o3prm::O3prmReader< GUM_SCALAR >::O3prmReader | ( | const O3prmReader< GUM_SCALAR > & | src | ) |
Definition at line 174 of file O3prmReader_tpl.h.
References O3prmReader(), _class_path_, _errors_, _imported_, _o3_prm_, and _prm_.
| gum::prm::o3prm::O3prmReader< GUM_SCALAR >::O3prmReader | ( | O3prmReader< GUM_SCALAR > && | src | ) |
Definition at line 181 of file O3prmReader_tpl.h.
| gum::prm::o3prm::O3prmReader< GUM_SCALAR >::~O3prmReader | ( | ) |
Definition at line 189 of file O3prmReader_tpl.h.
References O3prmReader().
|
private |
Definition at line 60 of file O3prmReader_tpl.h.
References gum::replace().
Referenced by _print_().
|
private |
Definition at line 417 of file O3prmReader_tpl.h.
References _imported_, and _o3_prm_.
Referenced by _readStream_().
|
private |
Definition at line 374 of file O3prmReader_tpl.h.
References _class_path_, _errors_, _imported_, _parseStream_(), gum::prm::o3prm::O3Import::import(), gum::prm::o3prm::O3Label::label(), and gum::prm::o3prm::O3Label::position().
Referenced by _readStream_().
|
private |
Definition at line 359 of file O3prmReader_tpl.h.
References _errors_, _o3_prm_, and _readStream_().
Referenced by _parseImport_(), and _readStream_().
|
private |
Definition at line 132 of file O3prmReader_tpl.h.
References _clean_(), gum::ParseError::column, gum::ParseError::filename, gum::ParseError::line, and gum::ParseError::msg.
Referenced by showElegantErrors(), and showElegantErrorsAndWarnings().
|
private |
Definition at line 141 of file O3prmReader_tpl.h.
|
private |
Definition at line 426 of file O3prmReader_tpl.h.
References gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::O3ClassFactory(), gum::prm::o3prm::O3InterfaceFactory< GUM_SCALAR >::O3InterfaceFactory(), gum::prm::o3prm::O3NameSolver< GUM_SCALAR >::O3NameSolver(), gum::prm::o3prm::O3SystemFactory< GUM_SCALAR >::O3SystemFactory(), gum::prm::o3prm::O3TypeFactory< GUM_SCALAR >::O3TypeFactory(), _copyImports_(), _errors_, _o3_prm_, _parseImport_(), _parseStream_(), and _prm_.
Referenced by _parseStream_(), parseStream(), readFile(), and readString().
| void gum::prm::o3prm::O3prmReader< GUM_SCALAR >::addClassPath | ( | std::string_view | class_path | ) |
Add a list of paths to look for o3prm files.
Use / for path separator ! Even on Windows !
| class_path | A semicolon separated list of paths. |
Definition at line 236 of file O3prmReader_tpl.h.
References _class_path_, and _errors_.
Referenced by gum::prm::o3prmr::O3prmrInterpreter::interpretFile(), gum::O3prmBNReader< GUM_SCALAR >::proceed(), and setClassPath().
| Idx gum::prm::o3prm::O3prmReader< GUM_SCALAR >::errCol | ( | Idx | i | ) | const |
| std::wstring gum::prm::o3prm::O3prmReader< GUM_SCALAR >::errFilename | ( | Idx | i | ) | const |
| bool gum::prm::o3prm::O3prmReader< GUM_SCALAR >::errIsError | ( | Idx | i | ) | const |
| Idx gum::prm::o3prm::O3prmReader< GUM_SCALAR >::errLine | ( | Idx | i | ) | const |
| std::string gum::prm::o3prm::O3prmReader< GUM_SCALAR >::errMsg | ( | Idx | i | ) | const |
message of ith error or warning
Definition at line 268 of file O3prmReader_tpl.h.
References _errors_.
| Size gum::prm::o3prm::O3prmReader< GUM_SCALAR >::errors | ( | ) | const |
publishing Errors API
Definition at line 294 of file O3prmReader_tpl.h.
References _errors_.
| const ErrorsContainer & gum::prm::o3prm::O3prmReader< GUM_SCALAR >::errorsContainer | ( | ) | const |
publishing Errors API
Definition at line 304 of file O3prmReader_tpl.h.
References _errors_.
Referenced by gum::O3prmBNReader< GUM_SCALAR >::proceed().
| O3prmReader< GUM_SCALAR > & gum::prm::o3prm::O3prmReader< GUM_SCALAR >::operator= | ( | const O3prmReader< GUM_SCALAR > & | src | ) |
Definition at line 194 of file O3prmReader_tpl.h.
References gum::prm::o3prm::O3PRM::O3PRM(), O3prmReader(), _class_path_, _errors_, _imported_, _o3_prm_, and _prm_.
| O3prmReader< GUM_SCALAR > & gum::prm::o3prm::O3prmReader< GUM_SCALAR >::operator= | ( | O3prmReader< GUM_SCALAR > && | src | ) |
Definition at line 205 of file O3prmReader_tpl.h.
References O3prmReader(), _class_path_, _errors_, _imported_, _o3_prm_, and _prm_.
| void gum::prm::o3prm::O3prmReader< GUM_SCALAR >::parseStream | ( | std::istream & | input, |
| std::ostream & | output, | ||
| std::string | module = "" ) |
Definition at line 350 of file O3prmReader_tpl.h.
References _readStream_(), and showElegantErrorsAndWarnings().
| gum::prm::PRM< GUM_SCALAR > * gum::prm::o3prm::O3prmReader< GUM_SCALAR >::prm | ( | ) |
Definition at line 472 of file O3prmReader_tpl.h.
References _prm_.
Referenced by O3prmReader(), gum::prm::o3prmr::O3prmrInterpreter::~O3prmrInterpreter(), gum::prm::o3prmr::O3prmrInterpreter::interpretFile(), gum::prm::o3prmr::O3prmrInterpreter::prm(), and gum::O3prmBNReader< GUM_SCALAR >::proceed().
| const gum::prm::PRM< GUM_SCALAR > * gum::prm::o3prm::O3prmReader< GUM_SCALAR >::prm | ( | ) | const |
| Size gum::prm::o3prm::O3prmReader< GUM_SCALAR >::readFile | ( | std::string_view | file, |
| std::string_view | module = "" ) |
Read file and load its content using a PRMFactory. The package parameter set the file's content package.
Definition at line 316 of file O3prmReader_tpl.h.
References _errors_, _readStream_(), gum::Exception::errorContent(), and GUM_SHOWERROR.
Referenced by gum::O3prmBNReader< GUM_SCALAR >::proceed().
| Size gum::prm::o3prm::O3prmReader< GUM_SCALAR >::readString | ( | const std::string & | string | ) |
With readString method, you must set the current path to search from import yourself, using addClassPath.
Definition at line 309 of file O3prmReader_tpl.h.
References _errors_, and _readStream_().
| void gum::prm::o3prm::O3prmReader< GUM_SCALAR >::setClassPath | ( | std::string_view | class_path | ) |
This methods defines the list of paths to look for o3prm files.
Use / for path separator ! Even on Windows !
| class_path | A semicolon separated list of paths. |
Definition at line 216 of file O3prmReader_tpl.h.
References _class_path_, and addClassPath().
| void gum::prm::o3prm::O3prmReader< GUM_SCALAR >::showElegantErrors | ( | std::ostream & | o = std::cerr | ) | const |
send on std::cerr the list of errors
Definition at line 273 of file O3prmReader_tpl.h.
References _errors_, and _print_().
| void gum::prm::o3prm::O3prmReader< GUM_SCALAR >::showElegantErrorsAndWarnings | ( | std::ostream & | o = std::cerr | ) | const |
send on std::cerr the list of errors or warnings
Definition at line 281 of file O3prmReader_tpl.h.
References _errors_, and _print_().
Referenced by parseStream().
| void gum::prm::o3prm::O3prmReader< GUM_SCALAR >::showErrorCounts | ( | std::ostream & | o = std::cerr | ) | const |
send on std::cerr the number of errors and the number of warnings
Definition at line 289 of file O3prmReader_tpl.h.
References _errors_.
| Size gum::prm::o3prm::O3prmReader< GUM_SCALAR >::warnings | ( | ) | const |
|
private |
Definition at line 171 of file O3prmReader.h.
Referenced by O3prmReader(), _parseImport_(), addClassPath(), operator=(), operator=(), and setClassPath().
|
private |
Definition at line 175 of file O3prmReader.h.
Referenced by O3prmReader(), _parseImport_(), _parseStream_(), _readStream_(), addClassPath(), errCol(), errFilename(), errIsError(), errLine(), errMsg(), errors(), errorsContainer(), operator=(), operator=(), readFile(), readString(), showElegantErrors(), showElegantErrorsAndWarnings(), showErrorCounts(), and warnings().
|
private |
Definition at line 172 of file O3prmReader.h.
Referenced by O3prmReader(), _copyImports_(), _parseImport_(), operator=(), and operator=().
|
private |
Definition at line 170 of file O3prmReader.h.
Referenced by O3prmReader(), O3prmReader(), O3prmReader(), _copyImports_(), _parseStream_(), _readStream_(), operator=(), and operator=().
|
private |
Definition at line 169 of file O3prmReader.h.
Referenced by O3prmReader(), O3prmReader(), O3prmReader(), _readStream_(), operator=(), operator=(), prm(), and prm().