SG++-Doxygen-Documentation
python.learner.formatter.GridFormatter.GridFormatter Class Reference

Provides functionality for the runtime serialization of the Grid object. More...

Inheritance diagram for python.learner.formatter.GridFormatter.GridFormatter:

Public Member Functions

def deserialize (self, serializationStream)
 Deserializes the Grid memento object from the stream. More...
 
def deserializeFromFile (self, filename)
 Deserializes the Grid object from the file. More...
 
def serialize (self, memento, serializationStream)
 Serializes grid to the stream. More...
 
def serializeToFile (self, memento, filename)
 Serializes grid to the file. More...
 
def toString (self, memento)
 Returns a string that represents the Grid object. More...
 

Detailed Description

Provides functionality for the runtime serialization of the Grid object.

This design intends to separate the binary object representation and its business logic from the text representation that can be saved into file. The class is a part of Memento design pattern described in details in CheckpointController .

However strict separation of grid object and its representation is not implemented,as Formatter becomes from Grid object not a GridMemento object, but a string serialization of Grid itself. So Grid plays the role of GridMemento. The complete decoupling is a subject for future work.

Member Function Documentation

◆ deserialize()

◆ deserializeFromFile()

◆ serialize()

def python.learner.formatter.GridFormatter.GridFormatter.serialize (   self,
  memento,
  serializationStream 
)

◆ serializeToFile()

def python.learner.formatter.GridFormatter.GridFormatter.serializeToFile (   self,
  memento,
  filename 
)

Serializes grid to the file.

Parameters
mementothe Grid memento object
filenameThe name of file where the Grid object should be serialized to.

References python.utils.GzipSerializer.GzipSerializer.gzOpen(), sgpp::combigrid::AbstractSerializationStrategy< T >.serialize(), sgpp::combigrid::DefaultSerializationStrategy< T >.serialize(), json::ListNode.serialize(), json::Node.serialize(), sgpp::combigrid::FloatSerializationStrategy< T >.serialize(), json::JSON.serialize(), json::DictNode.serialize(), sgpp::base::ModPolyGrid.serialize(), sgpp::base::PolyGrid.serialize(), json::TextNode.serialize(), json::IDNode.serialize(), sgpp::base::PolyBoundaryGrid.serialize(), sgpp::base::LinearClenshawCurtisBoundaryGrid.serialize(), sgpp::base::PolyClenshawCurtisBoundaryGrid.serialize(), sgpp::combigrid::TreeStorageSerializationStrategy< T >.serialize(), sgpp::combigrid::AbstractCombigridStorage.serialize(), python.learner.formatter.GridFormatter.GridFormatter.serialize(), sgpp::base::LinearBoundaryGrid.serialize(), sgpp::combigrid::CombigridTreeStorage.serialize(), sgpp::combigrid::FunctionLookupTable.serialize(), sgpp::base::LinearClenshawCurtisGrid.serialize(), sgpp::base::ModLinearClenshawCurtisGrid.serialize(), sgpp::base::PolyClenshawCurtisGrid.serialize(), sgpp::base::ModPolyClenshawCurtisGrid.serialize(), sgpp::base::ModFundamentalSplineGrid.serialize(), sgpp::base::BsplineGrid.serialize(), sgpp::base::FundamentalSplineGrid.serialize(), sgpp::base::ModBsplineGrid.serialize(), sgpp::base::ModBsplineClenshawCurtisGrid.serialize(), sgpp::base::BsplineClenshawCurtisGrid.serialize(), sgpp::base::NakBsplineBoundaryCombigridGrid.serialize(), sgpp::base::BsplineBoundaryGrid.serialize(), sgpp::base::HashGridPoint.serialize(), sgpp::base::HashGridStorage.serialize(), sgpp::base::BoundingBox.serialize(), sgpp::base::Stretching.serialize(), and sgpp::base::Grid.serialize().

◆ toString()

def python.learner.formatter.GridFormatter.GridFormatter.toString (   self,
  memento 
)

Returns a string that represents the Grid object.

Parameters
mementoThe Grid memento object.
Returns
A string that represents the Grid object.

Referenced by python.uq.learner.Learner.Learner.createMemento(), python.learner.Learner.Learner.createMemento(), and python.learner.formatter.GridFormatter.GridFormatter.serialize().


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