OOFEM 3.0
Loading...
Searching...
No Matches
oofem::DataStream Class Referenceabstract

#include <datastream.h>

Inheritance diagram for oofem::DataStream:

Public Member Functions

virtual ~DataStream ()
 Destructor.
Data Stream reading methods.

These methods read "count" values from data stream into array passed as the first argument. All functions return nonzero if successful.

virtual int read (int *data, std::size_t count)=0
 Reads count integer values into array pointed by data.
int read (int &data)
virtual int read (unsigned long *data, std::size_t count)=0
 Reads count unsigned long values into array pointed by data.
int read (unsigned long &data)
virtual int read (long *data, std::size_t count)=0
 Reads count long values into array pointed by data.
int read (long &data)
virtual int read (double *data, std::size_t count)=0
 Reads count double values into array pointed by data.
int read (double &data)
virtual int read (char *data, std::size_t count)=0
 Reads count char values into array pointed by data.
int read (char &data)
virtual int read (bool &data)=0
 Reads a bool value from data.
int read (std ::string &data)
 Reads a string (stored as an int for the length followed by char*).
Data Stream writing methods.

These methods write "count" values of data into stream. All functions return nonzero if successful.

virtual int write (const int *data, std::size_t count)=0
 Writes count integer values from array pointed by data.
int write (int data)
virtual int write (const unsigned long *data, std::size_t count)=0
 Writes count unsigned long values from array pointed by data.
int write (unsigned long data)
virtual int write (const long *data, std::size_t count)=0
 Writes count long values from array pointed by data.
int write (long data)
virtual int write (const double *data, std::size_t count)=0
 Writes count double values from array pointed by data.
int write (double data)
virtual int write (const char *data, std::size_t count)=0
 Writes count char values from array pointed by data.
int write (char data)
virtual int write (bool data)=0
 Writes a bool value.
int write (const std ::string &data)
 Reads a string (stored as an int for the length followed by char*).
int write (const char *data)
 Writes a string (wrapper needed, otherwise write(bool) is called ).
Sizing functions.

These methods compute the stored size (in bytes) of an array containing "count" elements.

virtual int givePackSizeOfInt (std::size_t count)=0
virtual int givePackSizeOfDouble (std::size_t count)=0
virtual int givePackSizeOfChar (std::size_t count)=0
virtual int givePackSizeOfBool (std::size_t count)=0
virtual int givePackSizeOfLong (std::size_t count)=0
virtual int givePackSizeOfSizet (std::size_t count)=0

Detailed Description

The purpose of DataStream abstract class is to allow to store/restore context to different streams, including file, communication buffers, etc., using the same routine. This will facilitate many algorithms relying on saving/moving state of components (such as load balancing), without writing new (and very similar) routines. This will lead to a better consistency of code.

Todo
Are the "long" and "unsigned long" functions really necessary?

Definition at line 54 of file datastream.h.

Constructor & Destructor Documentation

◆ ~DataStream()

virtual oofem::DataStream::~DataStream ( )
inlinevirtual

Destructor.

Definition at line 58 of file datastream.h.

Member Function Documentation

◆ givePackSizeOfBool()

virtual int oofem::DataStream::givePackSizeOfBool ( std::size_t count)
pure virtual

◆ givePackSizeOfChar()

virtual int oofem::DataStream::givePackSizeOfChar ( std::size_t count)
pure virtual

◆ givePackSizeOfDouble()

◆ givePackSizeOfInt()

virtual int oofem::DataStream::givePackSizeOfInt ( std::size_t count)
pure virtual

◆ givePackSizeOfLong()

virtual int oofem::DataStream::givePackSizeOfLong ( std::size_t count)
pure virtual

◆ givePackSizeOfSizet()

virtual int oofem::DataStream::givePackSizeOfSizet ( std::size_t count)
pure virtual

◆ read() [1/12]

virtual int oofem::DataStream::read ( bool & data)
pure virtual

◆ read() [2/12]

int oofem::DataStream::read ( char & data)
inline

Definition at line 85 of file datastream.h.

References read().

Referenced by read().

◆ read() [3/12]

virtual int oofem::DataStream::read ( char * data,
std::size_t count )
pure virtual

◆ read() [4/12]

int oofem::DataStream::read ( double & data)
inline

Definition at line 82 of file datastream.h.

References read().

Referenced by read().

◆ read() [5/12]

virtual int oofem::DataStream::read ( double * data,
std::size_t count )
pure virtual

◆ read() [6/12]

int oofem::DataStream::read ( int & data)
inline

Definition at line 68 of file datastream.h.

References read().

Referenced by read().

◆ read() [7/12]

virtual int oofem::DataStream::read ( int * data,
std::size_t count )
pure virtual

Reads count integer values into array pointed by data.

Implemented in oofem::CommunicationBuffer, oofem::DynamicCommunicationBuffer, oofem::FileDataStream, oofem::ProcessCommunicatorBuff, and oofem::StaticCommunicationBuffer.

Referenced by oofem::CommunicationBuffer::initForUnpacking(), read(), read(), oofem::restore_components(), oofem::AnisotropicDamageMaterialStatus::restoreContext(), oofem::B3SolidMaterialStatus::restoreContext(), oofem::BinghamFluidMaterial2Status::restoreContext(), oofem::BondCEBMaterialStatus::restoreContext(), oofem::BoundaryLoad::restoreContext(), oofem::CebFipSlip90MaterialStatus::restoreContext(), oofem::Concrete2MaterialStatus::restoreContext(), oofem::ConcreteDPM2::restoreContext(), oofem::ConcreteDPM2Status::restoreContext(), oofem::ConcreteDPM::restoreContext(), oofem::ConcreteDPMStatus::restoreContext(), oofem::ConstantFunction::restoreContext(), oofem::CrossSection::restoreContext(), oofem::CylindricalALM::restoreContext(), oofem::Dictionary::restoreContext(), oofem::Dof::restoreContext(), oofem::DofManager::restoreContext(), oofem::Domain::restoreContext(), oofem::DruckerPragerPlasticitySMStatus::restoreContext(), oofem::Element::restoreContext(), oofem::EngngModel::restoreContext(), oofem::Eurocode2CreepMaterialStatus::restoreContext(), oofem::FEMComponent::restoreContext(), oofem::FRCFCMStatus::restoreContext(), oofem::Function::restoreContext(), oofem::GeneralBoundaryCondition::restoreContext(), oofem::HeMoTransportMaterialStatus::restoreContext(), oofem::HuertaErrorEstimator::restoreContext(), oofem::HydrationModelStatus::restoreContext(), oofem::IntegrationRule::restoreContext(), oofem::IntMatIsoDamageStatus::restoreContext(), oofem::IsoInterfaceDamageMaterialStatus::restoreContext(), oofem::IsoInterfaceDamageMaterialStatus_2::restoreContext(), oofem::IsotropicAsymmetric1DMaterial::restoreContext(), oofem::IsotropicDamageMaterial1::restoreContext(), oofem::IsotropicDamageMaterialStatus::restoreContext(), oofem::IsotropicLinearElasticMaterial::restoreContext(), oofem::Lattice2d::restoreContext(), oofem::Lattice2dBoundary::restoreContext(), oofem::Lattice3d::restoreContext(), oofem::LatticeBondPlasticityStatus::restoreContext(), oofem::LatticeDamageStatus::restoreContext(), oofem::LatticeMaterialStatus::restoreContext(), oofem::LatticePlasticityDamageStatus::restoreContext(), oofem::LEPlicElementInterface::restoreContext(), oofem::LevelSetPCS::restoreContext(), oofem::LinearConstraintBC::restoreContext(), oofem::LinkSlipStatus::restoreContext(), oofem::Load::restoreContext(), oofem::MasterDof::restoreContext(), oofem::Material::restoreContext(), oofem::MazarsMaterialStatus::restoreContext(), oofem::MisesMatStatus::restoreContext(), oofem::MPlasticMaterial2Status::restoreContext(), oofem::MPlasticMaterialStatus::restoreContext(), oofem::MPSDamMaterialStatus::restoreContext(), oofem::MPSMaterialStatus::restoreContext(), oofem::NlDEIDynamic::restoreContext(), oofem::NodalLoad::restoreContext(), oofem::Node::restoreContext(), oofem::NonLinearStatic::restoreContext(), oofem::PatchIntegrationRule::restoreContext(), oofem::PerfectlyPlasticMaterialStatus::restoreContext(), oofem::PlasticMaterialStatus::restoreContext(), oofem::PrimaryField::restoreContext(), oofem::ProblemSequence::restoreContext(), oofem::RankineMatStatus::restoreContext(), oofem::RCSDEMaterialStatus::restoreContext(), oofem::RCSDMaterialStatus::restoreContext(), oofem::SimpleCrossSection::restoreContext(), oofem::SimpleSlaveDof::restoreContext(), oofem::SlaveDof::restoreContext(), oofem::SteelRelaxMatStatus::restoreContext(), oofem::TimeStep::restoreContext(), oofem::TrabBone3DStatus::restoreContext(), oofem::TransportMaterialStatus::restoreContext(), oofem::UsrDefBoundaryLoad::restoreContext(), oofem::XfemManager::restoreContext(), oofem::FloatArray::restoreYourself(), oofem::FloatArrayF< N >::restoreYourself(), oofem::FloatMatrix::restoreYourself(), oofem::FloatMatrixF< N, M >::restoreYourself(), oofem::IntArray::restoreYourself(), oofem::StressStrainBaseVector::restoreYourself(), oofem::HeMoTransportMaterialStatus::saveContext(), oofem::TransportMaterialStatus::saveContext(), oofem::IDNLMaterial::unpackAndUpdateUnknowns(), oofem::MazarsNLMaterial::unpackAndUpdateUnknowns(), oofem::MisesMatNl::unpackAndUpdateUnknowns(), oofem::RankineMatNl::unpackAndUpdateUnknowns(), and oofem::TrabBoneNL3D::unpackAndUpdateUnknowns().

◆ read() [8/12]

int oofem::DataStream::read ( long & data)
inline

Definition at line 79 of file datastream.h.

References read().

Referenced by read().

◆ read() [9/12]

virtual int oofem::DataStream::read ( long * data,
std::size_t count )
pure virtual

◆ read() [10/12]

int oofem::DataStream::read ( std ::string & data)

Reads a string (stored as an int for the length followed by char*).

Definition at line 41 of file datastream.C.

References read().

◆ read() [11/12]

int oofem::DataStream::read ( unsigned long & data)
inline

Definition at line 71 of file datastream.h.

References read().

Referenced by read().

◆ read() [12/12]

virtual int oofem::DataStream::read ( unsigned long * data,
std::size_t count )
pure virtual

◆ write() [1/13]

virtual int oofem::DataStream::write ( bool data)
pure virtual

◆ write() [2/13]

int oofem::DataStream::write ( char data)
inline

Definition at line 117 of file datastream.h.

References write().

Referenced by write().

◆ write() [3/13]

int oofem::DataStream::write ( const char * data)
inline

Writes a string (wrapper needed, otherwise write(bool) is called ).

Definition at line 123 of file datastream.h.

References write().

Referenced by write().

◆ write() [4/13]

virtual int oofem::DataStream::write ( const char * data,
std::size_t count )
pure virtual

◆ write() [5/13]

virtual int oofem::DataStream::write ( const double * data,
std::size_t count )
pure virtual

◆ write() [6/13]

virtual int oofem::DataStream::write ( const int * data,
std::size_t count )
pure virtual

Writes count integer values from array pointed by data.

Implemented in oofem::CommunicationBuffer, oofem::DynamicCommunicationBuffer, oofem::FileDataStream, oofem::ProcessCommunicatorBuff, and oofem::StaticCommunicationBuffer.

Referenced by oofem::CommunicationBuffer::initForUnpacking(), oofem::IDNLMaterial::packUnknowns(), oofem::MazarsNLMaterial::packUnknowns(), oofem::MisesMatNl::packUnknowns(), oofem::RankineMatNl::packUnknowns(), oofem::TrabBoneNL3D::packUnknowns(), oofem::save_components(), oofem::AnisotropicDamageMaterialStatus::saveContext(), oofem::B3SolidMaterialStatus::saveContext(), oofem::BinghamFluidMaterial2Status::saveContext(), oofem::BondCEBMaterialStatus::saveContext(), oofem::BoundaryLoad::saveContext(), oofem::CebFipSlip90MaterialStatus::saveContext(), oofem::Concrete2MaterialStatus::saveContext(), oofem::ConcreteDPM2::saveContext(), oofem::ConcreteDPM2Status::saveContext(), oofem::ConcreteDPM::saveContext(), oofem::ConcreteDPMStatus::saveContext(), oofem::ConstantFunction::saveContext(), oofem::CrossSection::saveContext(), oofem::CylindricalALM::saveContext(), oofem::Dictionary::saveContext(), oofem::Dof::saveContext(), oofem::DofManager::saveContext(), oofem::Domain::saveContext(), oofem::DruckerPragerPlasticitySMStatus::saveContext(), oofem::Element::saveContext(), oofem::EngngModel::saveContext(), oofem::Eurocode2CreepMaterialStatus::saveContext(), oofem::FEMComponent::saveContext(), oofem::FRCFCMStatus::saveContext(), oofem::Function::saveContext(), oofem::GeneralBoundaryCondition::saveContext(), oofem::HuertaErrorEstimator::saveContext(), oofem::HydrationModelStatus::saveContext(), oofem::IntegrationRule::saveContext(), oofem::IntMatIsoDamageStatus::saveContext(), oofem::IsoInterfaceDamageMaterialStatus::saveContext(), oofem::IsoInterfaceDamageMaterialStatus_2::saveContext(), oofem::IsotropicAsymmetric1DMaterial::saveContext(), oofem::IsotropicDamageMaterial1::saveContext(), oofem::IsotropicDamageMaterialStatus::saveContext(), oofem::IsotropicLinearElasticMaterial::saveContext(), oofem::Lattice2d::saveContext(), oofem::Lattice2dBoundary::saveContext(), oofem::Lattice3d::saveContext(), oofem::LatticeBondPlasticityStatus::saveContext(), oofem::LatticeDamageStatus::saveContext(), oofem::LatticeMaterialStatus::saveContext(), oofem::LatticePlasticityDamageStatus::saveContext(), oofem::LEPlicElementInterface::saveContext(), oofem::LevelSetPCS::saveContext(), oofem::LinearConstraintBC::saveContext(), oofem::LinkSlipStatus::saveContext(), oofem::Load::saveContext(), oofem::MasterDof::saveContext(), oofem::Material::saveContext(), oofem::MazarsMaterialStatus::saveContext(), oofem::MisesMatStatus::saveContext(), oofem::MPlasticMaterial2Status::saveContext(), oofem::MPlasticMaterialStatus::saveContext(), oofem::MPSDamMaterialStatus::saveContext(), oofem::MPSMaterialStatus::saveContext(), oofem::NlDEIDynamic::saveContext(), oofem::NodalLoad::saveContext(), oofem::Node::saveContext(), oofem::NonLinearStatic::saveContext(), oofem::PatchIntegrationRule::saveContext(), oofem::PerfectlyPlasticMaterialStatus::saveContext(), oofem::PlasticMaterialStatus::saveContext(), oofem::PrimaryField::saveContext(), oofem::ProblemSequence::saveContext(), oofem::RankineMatStatus::saveContext(), oofem::RCSDEMaterialStatus::saveContext(), oofem::RCSDMaterialStatus::saveContext(), oofem::SimpleCrossSection::saveContext(), oofem::SimpleSlaveDof::saveContext(), oofem::SlaveDof::saveContext(), oofem::SteelRelaxMatStatus::saveContext(), oofem::TimeStep::saveContext(), oofem::TrabBone3DStatus::saveContext(), oofem::UsrDefBoundaryLoad::saveContext(), oofem::XfemManager::saveContext(), oofem::FloatArrayF< N >::storeYourself(), oofem::FloatMatrixF< N, M >::storeYourself(), oofem::IntArray::storeYourself(), oofem::StressStrainBaseVector::storeYourself(), write(), and write().

◆ write() [7/13]

virtual int oofem::DataStream::write ( const long * data,
std::size_t count )
pure virtual

◆ write() [8/13]

int oofem::DataStream::write ( const std ::string & data)

Reads a string (stored as an int for the length followed by char*).

Definition at line 58 of file datastream.C.

References write().

◆ write() [9/13]

virtual int oofem::DataStream::write ( const unsigned long * data,
std::size_t count )
pure virtual

◆ write() [10/13]

int oofem::DataStream::write ( double data)
inline

Definition at line 114 of file datastream.h.

References write().

Referenced by write().

◆ write() [11/13]

int oofem::DataStream::write ( int data)
inline

Definition at line 100 of file datastream.h.

References write().

Referenced by write().

◆ write() [12/13]

int oofem::DataStream::write ( long data)
inline

Definition at line 111 of file datastream.h.

References write().

Referenced by write().

◆ write() [13/13]

int oofem::DataStream::write ( unsigned long data)
inline

Definition at line 103 of file datastream.h.

References write().

Referenced by write().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011