ABLATE Source Documentation  0.12.34
ablate::io::Serializable Class Referenceabstract

#include <serializable.hpp>

+ Inheritance diagram for ablate::io::Serializable:

Public Types

enum class  SerializerType { none , collective , serial }
 

Public Member Functions

virtual SerializerType Serialize () const
 
virtual const std::string & GetId () const =0
 
virtual PetscErrorCode Save (PetscViewer viewer, PetscInt sequenceNumber, PetscReal time)=0
 
virtual PetscErrorCode Restore (PetscViewer viewer, PetscInt sequenceNumber, PetscReal time)=0
 

Static Protected Member Functions

static PetscErrorCode SaveKeyValue (PetscViewer viewer, const char *name, PetscScalar value)
 
static PetscErrorCode RestoreKeyValue (PetscViewer viewer, const char *name, PetscScalar &value)
 
template<class T >
static PetscErrorCode SaveKeyValue (PetscViewer viewer, const char *name, T value)
 
template<class T >
static PetscErrorCode RestoreKeyValue (PetscViewer viewer, const char *name, T &value)
 
template<class T >
static SerializerType DetermineSerializerType (const T &types)
 

Detailed Description

This class gives the option to serialize/save restore. A bool is used at startup to determine if it should be save/restored

Member Enumeration Documentation

◆ SerializerType

Allow the Serializable object to determine what kind of serialization is needed

Member Function Documentation

◆ DetermineSerializerType()

template<class T >
static SerializerType ablate::io::Serializable::DetermineSerializerType ( const T &  types)
inlinestaticprotected

Provide a helper function to determine the type for a vector or map of objects

◆ GetId()

◆ Restore()

◆ RestoreKeyValue() [1/2]

PetscErrorCode ablate::io::Serializable::RestoreKeyValue ( PetscViewer  viewer,
const char *  name,
PetscScalar &  value 
)
staticprotected

helper function to restore PetscScalar to a PetscViewer. The same value is returned on all mpi ranks

Parameters
viewer
name
value

◆ RestoreKeyValue() [2/2]

template<class T >
static PetscErrorCode ablate::io::Serializable::RestoreKeyValue ( PetscViewer  viewer,
const char *  name,
T &  value 
)
inlinestaticprotected

Helper function to save a restore key/value pair to the PetscViewer. It is assumed to be the same value across all mpi ranks

Template Parameters
T
Parameters
viewer
name
value

◆ Save()

◆ SaveKeyValue() [1/2]

PetscErrorCode ablate::io::Serializable::SaveKeyValue ( PetscViewer  viewer,
const char *  name,
PetscScalar  value 
)
staticprotected

helper function to save PetscScalar to a PetscViewer. It is assumed to be the same value across all mpi ranks

Parameters
viewer
name
value

◆ SaveKeyValue() [2/2]

template<class T >
static PetscErrorCode ablate::io::Serializable::SaveKeyValue ( PetscViewer  viewer,
const char *  name,
value 
)
inlinestaticprotected

Helper function to save a single key/value pair to the PetscViewer. It is assumed to be the same value across all mpi ranks

Template Parameters
T
Parameters
viewer
name
value

◆ Serialize()


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