Template Numerical Library version\ main:52827a2
Loading...
Searching...
No Matches
TNL::Object Class Reference

Basic class for majority of TNL objects like matrices, meshes, grids, solvers, etc.. More...

#include <TNL/Object.h>

Inheritance diagram for TNL::Object:

Public Member Functions

virtual ~Object ()=default
 Destructor.
 
virtual std::string getSerializationTypeVirtual () const
 
void load (const String &fileName)
 Method for restoring the object from a file.
 
virtual void load (File &file)
 Method for restoring the object from a file.
 
void save (const String &fileName) const
 Method for saving the object to a file as a binary data.
 
virtual void save (File &file) const
 Method for saving the object to a file as a binary data.
 

Static Public Member Functions

static std::string getSerializationType ()
 Static serialization type getter.
 

Detailed Description

Basic class for majority of TNL objects like matrices, meshes, grids, solvers, etc..

Objects like numerical meshes, matrices large vectors etc. are inherited by this class.

Since the virtual destructor is not defined as __cuda_callable__, objects inherited from Object should not be created in CUDA kernels.

In addition to methods of this class, see the following related functions:

getObjectType

parseObjectType

Constructor & Destructor Documentation

◆ ~Object()

virtual TNL::Object::~Object ( )
virtualdefault

Destructor.

Since it is not defined as __cuda_callable__, objects inherited from Object should not be created in CUDA kernels.

Member Function Documentation

◆ getSerializationType()

std::string TNL::Object::getSerializationType ( )
inlinestaticnodiscard

Static serialization type getter.

Objects in TNL are saved as in a device independent manner. This method is supposed to return the object type but with the device type replaced by Devices::Host. For example Array< double, Devices::Cuda > is saved as Array< double, Devices::Host >.

◆ getSerializationTypeVirtual()

std::string TNL::Object::getSerializationTypeVirtual ( ) const
inlinenodiscardvirtual

◆ load() [1/2]

void TNL::Object::load ( const String & fileName)
inline

Method for restoring the object from a file.

Throws Exceptions::FileDeserializationError if the object cannot be loaded.

Parameters
fileNameString defining the name of a file.

◆ load() [2/2]

◆ save() [1/2]

void TNL::Object::save ( const String & fileName) const
inline

Method for saving the object to a file as a binary data.

Throws Exceptions::FileSerializationError if the object cannot be saved.

Parameters
fileNameString defining the name of a file.

◆ save() [2/2]


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