SG++
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, streamserializationStream)
 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

def python.learner.formatter.GridFormatter.GridFormatter.serialize (   self,
  memento,
  streamserializationStream 
)
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(), json::DictNode.serialize(), json::JSON.serialize(), sgpp::combigrid::FloatSerializationStrategy< T >.serialize(), sgpp::base::PolyGrid.serialize(), sgpp::base::ModPolyGrid.serialize(), json::TextNode.serialize(), json::IDNode.serialize(), sgpp::base::PolyBoundaryGrid.serialize(), sgpp::base::LinearClenshawCurtisGrid.serialize(), python.learner.formatter.GridFormatter.GridFormatter.serialize(), sgpp::combigrid::TreeStorageSerializationStrategy< T >.serialize(), sgpp::combigrid::AbstractCombigridStorage.serialize(), sgpp::base::LinearBoundaryGrid.serialize(), sgpp::combigrid::CombigridTreeStorage.serialize(), sgpp::combigrid::FunctionLookupTable.serialize(), sgpp::base::ModBsplineGrid.serialize(), sgpp::base::BsplineGrid.serialize(), sgpp::base::FundamentalSplineGrid.serialize(), sgpp::base::ModBsplineClenshawCurtisGrid.serialize(), sgpp::base::ModFundamentalSplineGrid.serialize(), sgpp::base::NakBsplineBoundaryCombigridGrid.serialize(), sgpp::base::BsplineClenshawCurtisGrid.serialize(), sgpp::base::HashGridPoint.serialize(), sgpp::base::BsplineBoundaryGrid.serialize(), sgpp::base::HashGridStorage.serialize(), sgpp::base::BoundingBox.serialize(), sgpp::base::Stretching.serialize(), and sgpp::base::Grid.serialize().

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: