Abstract class for handling JSON + File I/O. More...
#include <xmmJson.hpp>
Public Member Functions | |
virtual | ~Writable () |
Json I/O | |
virtual Json::Value | toJson () const =0 |
Write the object to a JSON Structure. More... | |
virtual void | fromJson (Json::Value const &root)=0 |
Read the object from a JSON Structure. More... | |
Python File I/O | |
void | writeFile (char *fileName) const |
write method for python wrapping ('write' keyword forbidden, name has to be different) More... | |
void | readFile (char *fileName) |
read method for python wrapping ('read' keyword forbidden, name has to be different) More... | |
std::string | __str__ () const |
"print" method for python => returns the results of write method More... | |
Abstract class for handling JSON + File I/O.
the JSON I/O methods need to be implemented. writeFile and readFile methods can be used in Python for file I/O. The str() Python method is implemented to use with "print" in Python. It return the pretty-printed JSON String.
|
inlinevirtual |
|
inline |
"print" method for python => returns the results of write method
|
pure virtual |
Read the object from a JSON Structure.
root | JSON value containing the object's information |
JsonException | if the JSON value has a wrong format |
Implemented in xmm::Model< SingleClassModel, ModelType >, xmm::Model< SingleClassHMM, HMM >, xmm::Model< SingleClassGMM, GMM >, xmm::Phrase, xmm::SingleClassProbabilisticModel, xmm::TrainingSet, xmm::GaussianDistribution, xmm::Configuration< ModelType >, xmm::Configuration< xmm::KMeans >, xmm::Configuration< GMM >, xmm::HierarchicalHMM, xmm::SingleClassHMM, xmm::SingleClassGMM, xmm::KMeans, xmm::SharedParameters, xmm::ClassParameters< KMeans >, and xmm::ClassParameters< GMM >.
|
inline |
read method for python wrapping ('read' keyword forbidden, name has to be different)
|
pure virtual |
Write the object to a JSON Structure.
Implemented in xmm::Model< SingleClassModel, ModelType >, xmm::Model< SingleClassHMM, HMM >, xmm::Model< SingleClassGMM, GMM >, xmm::Phrase, xmm::SingleClassProbabilisticModel, xmm::TrainingSet, xmm::GaussianDistribution, xmm::Configuration< ModelType >, xmm::Configuration< xmm::KMeans >, xmm::Configuration< GMM >, xmm::HierarchicalHMM, xmm::SingleClassHMM, xmm::SingleClassGMM, xmm::KMeans, xmm::SharedParameters, xmm::ClassParameters< KMeans >, and xmm::ClassParameters< GMM >.
|
inline |
write method for python wrapping ('write' keyword forbidden, name has to be different)