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

Pure virtual class for exporting an ID. More...

#include <IDWriter.h>

Inheritance diagram for gum::IDWriter< GUM_SCALAR >:

Public Member Functions

 IDWriter ()
 Default constructor.
virtual ~IDWriter ()
 Default destructor.
virtual void write (std::ostream &output, const InfluenceDiagram< GUM_SCALAR > &infdiag)=0
 Writes an influence diagram in the given output stream.
virtual void write (std::string_view filePath, const InfluenceDiagram< GUM_SCALAR > &infdiag)=0
 Writes an Influence Diagram in the file referenced by filePath.
virtual void write (std::string_view filePath, InfluenceDiagram< GUM_SCALAR > &infdiag)
 Writes an Influence Diagram in the file referenced by filePath, updating metadata (software, creation, lastModification) before writing.

Detailed Description

template<GUM_Numeric GUM_SCALAR>
class gum::IDWriter< GUM_SCALAR >

Pure virtual class for exporting an ID.

All classes used to write an influence diagram in a stream or a file must inherit from this class

Definition at line 76 of file IDWriter.h.

Constructor & Destructor Documentation

◆ IDWriter()

template<GUM_Numeric GUM_SCALAR>
gum::IDWriter< GUM_SCALAR >::IDWriter ( )

Default constructor.

◆ ~IDWriter()

template<GUM_Numeric GUM_SCALAR>
virtual gum::IDWriter< GUM_SCALAR >::~IDWriter ( )
virtual

Default destructor.

Member Function Documentation

◆ write() [1/3]

template<GUM_Numeric GUM_SCALAR>
virtual void gum::IDWriter< GUM_SCALAR >::write ( std::ostream & output,
const InfluenceDiagram< GUM_SCALAR > & infdiag )
pure virtual

Writes an influence diagram in the given output stream.

Parameters
outputThe output stream.
infdiagThe influence diagram written to the stream.
Exceptions
IOErrorRaised if an I/O error occurs.

Implemented in gum::BIFXMLIDWriter< GUM_SCALAR >, and gum::GumIDWriter< GUM_SCALAR >.

◆ write() [2/3]

template<GUM_Numeric GUM_SCALAR>
virtual void gum::IDWriter< GUM_SCALAR >::write ( std::string_view filePath,
const InfluenceDiagram< GUM_SCALAR > & infdiag )
pure virtual

Writes an Influence Diagram 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 Influence Diagram.
infdiagThe Influence Diagram written to the file.
Exceptions
IOErrorRaised if an I/O error occurs.

Implemented in gum::BIFXMLIDWriter< GUM_SCALAR >, and gum::GumIDWriter< GUM_SCALAR >.

◆ write() [3/3]

template<GUM_Numeric GUM_SCALAR>
virtual void gum::IDWriter< GUM_SCALAR >::write ( std::string_view filePath,
InfluenceDiagram< GUM_SCALAR > & infdiag )
virtual

Writes an Influence Diagram in the file referenced by filePath, updating metadata (software, creation, lastModification) before writing.

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

Default implementation delegates to the const overload.

Parameters
filePathThe path to the file used to write the Influence Diagram.
infdiagThe Influence Diagram written to the file (non-const to allow metadata update).
Exceptions
IOErrorRaised if an I/O error occurs.

Reimplemented in gum::GumIDWriter< GUM_SCALAR >.


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