![]() |
aGrUM
0.16.0
|
Pure virtual class for reading a BN from a file. More...
#include <agrum/BN/io/DSL/DSLReader.h>
Public Member Functions | |
DSLReader (BayesNet< GUM_SCALAR > *bn, const std::string &filename) | |
Constructor A reader is defined for reading a defined file. More... | |
~DSLReader () final | |
Default destructor. More... | |
DSL::Scanner & | scanner () |
Direct access to DSL scanner (mandatory for listener connection) More... | |
const std::string & | streamName () const |
name of readen file More... | |
bool | trace () const |
accessor to trace function (just write the number of parser line) More... | |
void | trace (bool b) |
Size | proceed () final |
parse. More... | |
Size | errors () |
publishing Errors API More... | |
Size | warnings () |
of errorsMore... | |
Idx | errLine (Idx i) |
line of ith error or warning More... | |
Idx | errCol (Idx i) |
col of ith error or warning More... | |
bool | errIsError (Idx i) |
type of ith error or warning More... | |
std::string | errMsg (Idx i) |
message of ith error or warning More... | |
void | showElegantErrors (std::ostream &o=std::cerr) |
send on std::cerr the list of errorswith contents More... | |
void | showElegantErrorsAndWarnings (std::ostream &o=std::cerr) |
send on std::cerr the list of errors or warnings with contents More... | |
void | showErrorsAndWarnings (std::ostream &o=std::cerr) |
send on std::cerr the list of errors or warnings More... | |
void | showErrorCounts (std::ostream &o=std::cerr) |
send on std::cerr the number of errors and the number of warnings More... | |
Protected Attributes | |
BayesNet< GUM_SCALAR > * | __bn |
BayesNetFactory< GUM_SCALAR > * | __factory |
DSL::Scanner * | __scanner |
DSL::Parser * | __parser |
std::string | __streamName |
bool | __traceScanning |
bool | __parseDone |
bool | __ioerror |
Pure virtual class for reading a BN from a file.
Every class used to read the content of a Bayesian Network from a stream, or a file must be a subclass of DSLReader.
Definition at line 52 of file DSLReader.h.
gum::DSLReader< GUM_SCALAR >::DSLReader | ( | BayesNet< GUM_SCALAR > * | bn, |
const std::string & | filename | ||
) |
Constructor A reader is defined for reading a defined file.
Hence the 2 args of the constructor. Note that the BN has to be built outside the reader. There is no delegation to create/destroy the BN from inside the reader.
|
final |
Default destructor.
Idx gum::DSLReader< GUM_SCALAR >::errCol | ( | Idx | i | ) |
col of ith error or warning
bool gum::DSLReader< GUM_SCALAR >::errIsError | ( | Idx | i | ) |
type of ith error or warning
Idx gum::DSLReader< GUM_SCALAR >::errLine | ( | Idx | i | ) |
line of ith error or warning
std::string gum::DSLReader< GUM_SCALAR >::errMsg | ( | Idx | i | ) |
message of ith error or warning
Size gum::DSLReader< GUM_SCALAR >::errors | ( | ) |
publishing Errors API
|
finalvirtual |
parse.
IOError | if file not exists |
Implements gum::BNReader< GUM_SCALAR >.
DSL::Scanner& gum::DSLReader< GUM_SCALAR >::scanner | ( | ) |
Direct access to DSL scanner (mandatory for listener connection)
IOError | if file not exists |
void gum::DSLReader< GUM_SCALAR >::showElegantErrors | ( | std::ostream & | o = std::cerr | ) |
send on std::cerr the list of errorswith contents
void gum::DSLReader< GUM_SCALAR >::showElegantErrorsAndWarnings | ( | std::ostream & | o = std::cerr | ) |
send on std::cerr the list of errors or warnings with contents
void gum::DSLReader< GUM_SCALAR >::showErrorCounts | ( | std::ostream & | o = std::cerr | ) |
send on std::cerr the number of errors and the number of warnings
void gum::DSLReader< GUM_SCALAR >::showErrorsAndWarnings | ( | std::ostream & | o = std::cerr | ) |
send on std::cerr the list of errors or warnings
const std::string& gum::DSLReader< GUM_SCALAR >::streamName | ( | ) | const |
name of readen file
bool gum::DSLReader< GUM_SCALAR >::trace | ( | ) | const |
accessor to trace function (just write the number of parser line)
void gum::DSLReader< GUM_SCALAR >::trace | ( | bool | b | ) |
Size gum::DSLReader< GUM_SCALAR >::warnings | ( | ) |
|
protected |
Definition at line 117 of file DSLReader.h.
|
protected |
Definition at line 118 of file DSLReader.h.
|
protected |
Definition at line 128 of file DSLReader.h.
|
protected |
Definition at line 124 of file DSLReader.h.
|
protected |
Definition at line 120 of file DSLReader.h.
|
protected |
Definition at line 119 of file DSLReader.h.
|
protected |
Definition at line 122 of file DSLReader.h.
|
protected |
Definition at line 123 of file DSLReader.h.