![]() |
aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
|
Writes an InfluenceDiagram in the GUM json format. More...
#include <agrum/ID/io/GUM/GumIDWriter.h>
Public Member Functions | |
| std::string | toString (const InfluenceDiagram< GUM_SCALAR > &id) |
| Serializes an InfluenceDiagram to a string in GUM json format. | |
| void | write (std::ostream &output, const InfluenceDiagram< GUM_SCALAR > &id) override |
| Writes an InfluenceDiagram to the output stream. | |
| void | write (std::string_view filePath, InfluenceDiagram< GUM_SCALAR > &id) override |
| Writes an InfluenceDiagram to the file at filePath, updating metadata first. | |
| void | write (std::string_view filePath, const InfluenceDiagram< GUM_SCALAR > &id) override |
| Writes an InfluenceDiagram to the file at filePath (const variant, no metadata update). | |
Constructor & destructor | |
| GumIDWriter (bool binary=false) | |
| Default constructor. | |
| GumIDWriter (bool binary, int indent) | |
| Constructor with an explicit indentation (the configuration is not used). | |
| ~GumIDWriter () override | |
| Default constructor. | |
| GumIDWriter (const GumIDWriter &)=delete | |
| Default constructor. | |
| GumIDWriter (GumIDWriter &&) noexcept=delete | |
| Default constructor. | |
| GumIDWriter & | operator= (const GumIDWriter &)=delete |
| Default constructor. | |
| GumIDWriter & | operator= (GumIDWriter &&) noexcept=delete |
| Default constructor. | |
Private Attributes | |
| bool | _binary_ |
| int | _indent_ |
Writes an InfluenceDiagram in the GUM json format.
Supports both text (.jgum) and binary msgpack (.bgum) output.
Definition at line 72 of file GumIDWriter.h.
| gum::GumIDWriter< GUM_SCALAR >::GumIDWriter | ( | bool | binary = false | ) |
Default constructor.
The indentation is the one of the configuration (key jgumIndent of section core, see gum::Configuration).
| binary | If true, output uses the msgpack binary format; otherwise JSON text. |
Referenced by GumIDWriter(), GumIDWriter(), operator=(), and operator=().
| gum::GumIDWriter< GUM_SCALAR >::GumIDWriter | ( | bool | binary, |
| int | indent ) |
Constructor with an explicit indentation (the configuration is not used).
| binary | If true, output uses the msgpack binary format; otherwise JSON text. |
| indent | Indentation level for text output. -1 produces compact output. |
|
override |
Default constructor.
The indentation is the one of the configuration (key jgumIndent of section core, see gum::Configuration).
| binary | If true, output uses the msgpack binary format; otherwise JSON text. |
|
delete |
Default constructor.
The indentation is the one of the configuration (key jgumIndent of section core, see gum::Configuration).
| binary | If true, output uses the msgpack binary format; otherwise JSON text. |
References GumIDWriter().
|
deletenoexcept |
Default constructor.
The indentation is the one of the configuration (key jgumIndent of section core, see gum::Configuration).
| binary | If true, output uses the msgpack binary format; otherwise JSON text. |
References GumIDWriter().
|
delete |
Default constructor.
The indentation is the one of the configuration (key jgumIndent of section core, see gum::Configuration).
| binary | If true, output uses the msgpack binary format; otherwise JSON text. |
References GumIDWriter().
|
deletenoexcept |
Default constructor.
The indentation is the one of the configuration (key jgumIndent of section core, see gum::Configuration).
| binary | If true, output uses the msgpack binary format; otherwise JSON text. |
References GumIDWriter().
| std::string gum::GumIDWriter< GUM_SCALAR >::toString | ( | const InfluenceDiagram< GUM_SCALAR > & | id | ) |
Serializes an InfluenceDiagram to a string in GUM json format.
References toString().
Referenced by toString().
|
overridevirtual |
Writes an InfluenceDiagram to the output stream.
| output | The output stream. |
| id | The InfluenceDiagram to write. |
| IOError | if the stream is not writable. |
Implements gum::IDWriter< GUM_SCALAR >.
References write().
Referenced by write(), write(), and write().
|
overridevirtual |
Writes an InfluenceDiagram to the file at filePath (const variant, no metadata update).
| filePath | Path to the output file (created or overwritten). |
| id | The InfluenceDiagram to write. |
| IOError | if an I/O error occurs. |
Implements gum::IDWriter< GUM_SCALAR >.
References write().
|
overridevirtual |
Writes an InfluenceDiagram to the file at filePath, updating metadata first.
| filePath | Path to the output file (created or overwritten). |
| id | The InfluenceDiagram to write (non-const to allow metadata update). |
| IOError | if an I/O error occurs. |
Reimplemented from gum::IDWriter< GUM_SCALAR >.
References write().
|
private |
Definition at line 137 of file GumIDWriter.h.
|
private |
Definition at line 138 of file GumIDWriter.h.