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

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

#include <agrum/MN/io/MNWriter.h>

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

Public Member Functions

 MNWriter ()
 Default constructor. More...
 
virtual ~MNWriter ()
 Default destructor. More...
 
virtual void write (std::ostream &output, const IMarkovNet< GUM_SCALAR > &MN)=0
 Writes a Markov Network in the ouput stream. More...
 
virtual void write (const std::string &filePath, const IMarkovNet< GUM_SCALAR > &MN)=0
 Writes a Markov Network in the file referenced by filePath. More...
 

Detailed Description

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

Pure virtual class for writting a MN to a file.

Every class used to write the content of a Markov Network in a stream, or a file must be a subclass of MNWriter.

Definition at line 56 of file MNWriter.h.

Constructor & Destructor Documentation

◆ MNWriter()

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

Default constructor.

◆ ~MNWriter()

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

Default destructor.

Member Function Documentation

◆ write() [1/2]

template<typename GUM_SCALAR >
virtual void gum::MNWriter< GUM_SCALAR >::write ( std::ostream &  output,
const IMarkovNet< GUM_SCALAR > &  MN 
)
pure virtual

Writes a Markov Network in the ouput stream.

Parameters
outputThe output stream.
MNThe Markov Network writed in output.
Exceptions
IOErrorRaised if an I/O error occurs.

Implemented in gum::UAIMNWriter< GUM_SCALAR >.

◆ write() [2/2]

template<typename GUM_SCALAR >
virtual void gum::MNWriter< GUM_SCALAR >::write ( const std::string &  filePath,
const IMarkovNet< GUM_SCALAR > &  MN 
)
pure virtual

Writes a Markov 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 Markov Network.
MNThe Markov Network writen in the file.
Exceptions
IOErrorRaised if an I/O error occurs.

Implemented in gum::UAIMNWriter< GUM_SCALAR >.


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