aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::BNWriter< GUM_SCALAR > Class Template Referenceabstract

Pure virtual class for writting a BN to a file. More...

#include <agrum/BN/io/BNWriter.h>

+ Inheritance diagram for gum::BNWriter< GUM_SCALAR >:

Public Member Functions

 BNWriter ()
 Default constructor. More...
 
virtual ~BNWriter ()
 Default destructor. More...
 
virtual void write (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn)=0
 Writes a Bayesian network in the ouput stream. More...
 
virtual void write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn)=0
 Writes a Bayesian network in the file referenced by filePath. More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::BNWriter< GUM_SCALAR >

Pure virtual class for writting a BN to a file.

Every class used to write the content of a Bayesian network in a stream, or a file must be a subclass of BNWriter.

Definition at line 56 of file BNWriter.h.

Constructor & Destructor Documentation

◆ BNWriter()

template<typename GUM_SCALAR >
gum::BNWriter< GUM_SCALAR >::BNWriter ( )

Default constructor.

◆ ~BNWriter()

template<typename GUM_SCALAR >
virtual gum::BNWriter< GUM_SCALAR >::~BNWriter ( )
virtual

Default destructor.

Member Function Documentation

◆ write() [1/2]

template<typename GUM_SCALAR >
virtual void gum::BNWriter< GUM_SCALAR >::write ( std::ostream &  output,
const IBayesNet< GUM_SCALAR > &  bn 
)
pure virtual

◆ write() [2/2]

template<typename GUM_SCALAR >
virtual void gum::BNWriter< GUM_SCALAR >::write ( const std::string &  filePath,
const IBayesNet< GUM_SCALAR > &  bn 
)
pure virtual

Writes a Bayesian network in the file referenced by filePath.

If the file doesn't exists, it is created. If the file exists, it's content will be erased.

Parameters
filePathThe path to the file used to write the Bayesian network.
bnThe Bayesian network writen in the file.
Exceptions
IOErrorRaised if an I/O error occurs.

Implemented in gum::CNFWriter< GUM_SCALAR, IApproximationPolicy >, gum::BIFXMLBNWriter< GUM_SCALAR >, gum::ContextualDependenciesCNFWriter< GUM_SCALAR, IApproximationPolicy >, gum::BIFWriter< GUM_SCALAR >, gum::FactorisedValuesCNFWriter< GUM_SCALAR, IApproximationPolicy >, gum::NetWriter< GUM_SCALAR >, gum::O3prmBNWriter< GUM_SCALAR >, gum::UAIBNWriter< GUM_SCALAR >, gum::GeneralizedCNFWriter< GUM_SCALAR, IApproximationPolicy >, and gum::DSLWriter< GUM_SCALAR >.


The documentation for this class was generated from the following file: