OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::DataStream Class Referenceabstract

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. More...

#include <datastream.h>

+ Inheritance diagram for oofem::DataStream:

Public Member Functions

virtual ~DataStream ()
 Destructor. More...
 
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, int count)=0
 Reads count integer values into array pointed by data. More...
 
int read (int &data)
 
virtual int read (unsigned long *data, int count)=0
 Reads count unsigned long values into array pointed by data. More...
 
int read (unsigned long &data)
 
virtual int read (long *data, int count)=0
 Reads count long values into array pointed by data. More...
 
int read (long &data)
 
virtual int read (double *data, int count)=0
 Reads count double values into array pointed by data. More...
 
int read (double &data)
 
virtual int read (char *data, int count)=0
 Reads count char values into array pointed by data. More...
 
int read (char &data)
 
virtual int read (bool &data)=0
 Reads a bool value from data. More...
 
int read (std::string &data)
 Reads a string (stored as an int for the length followed by char*). More...
 
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, int count)=0
 Writes count integer values from array pointed by data. More...
 
int write (int data)
 
virtual int write (const unsigned long *data, int count)=0
 Writes count unsigned long values from array pointed by data. More...
 
int write (unsigned long data)
 
virtual int write (const long *data, int count)=0
 Writes count long values from array pointed by data. More...
 
int write (long data)
 
virtual int write (const double *data, int count)=0
 Writes count double values from array pointed by data. More...
 
int write (double data)
 
virtual int write (const char *data, int count)=0
 Writes count char values from array pointed by data. More...
 
int write (char data)
 
virtual int write (bool data)=0
 Writes a bool value. More...
 
int write (const std::string &data)
 Reads a string (stored as an int for the length followed by char*). More...
 
int write (const char *data)
 Writes a string (wrapper needed, otherwise write(bool) is called ) More...
 
Sizing functions.

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

virtual int givePackSizeOfInt (int count)=0
 
virtual int givePackSizeOfDouble (int count)=0
 
virtual int givePackSizeOfChar (int count)=0
 
virtual int givePackSizeOfBool (int count)=0
 
virtual int givePackSizeOfLong (int 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

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

Destructor.

Definition at line 58 of file datastream.h.

Member Function Documentation

virtual int oofem::DataStream::givePackSizeOfBool ( int  count)
pure virtual
virtual int oofem::DataStream::givePackSizeOfChar ( int  count)
pure virtual
virtual int oofem::DataStream::givePackSizeOfInt ( int  count)
pure virtual
virtual int oofem::DataStream::givePackSizeOfLong ( int  count)
pure virtual
virtual int oofem::DataStream::read ( int *  data,
int  count 
)
pure virtual

Reads count integer values into array pointed by data.

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

Referenced by read(), oofem::restore_components(), oofem::B3SolidMaterialStatus::restoreContext(), oofem::Eurocode2CreepMaterialStatus::restoreContext(), oofem::PatchIntegrationRule::restoreContext(), oofem::PlasticMaterialStatus::restoreContext(), oofem::PerfectlyPlasticMaterialStatus::restoreContext(), oofem::MazarsMaterialStatus::restoreContext(), oofem::BinghamFluidMaterial2Status::restoreContext(), oofem::CebFipSlip90MaterialStatus::restoreContext(), oofem::ProblemSequence::restoreContext(), oofem::BondCEBMaterialStatus::restoreContext(), oofem::IsoInterfaceDamageMaterialStatus::restoreContext(), oofem::MPlasticMaterialStatus::restoreContext(), oofem::IntMatIsoDamageStatus::restoreContext(), oofem::IsoInterfaceDamageMaterialStatus_2::restoreContext(), oofem::DruckerPragerPlasticitySMStatus::restoreContext(), oofem::FRCFCMStatus::restoreContext(), oofem::MPlasticMaterial2Status::restoreContext(), oofem::RCSDEMaterialStatus::restoreContext(), oofem::RCSDMaterialStatus::restoreContext(), oofem::Dictionary::restoreContext(), oofem::LinearConstraintBC::restoreContext(), oofem::IDGMaterialStatus::restoreContext(), oofem::SimpleSlaveDof::restoreContext(), oofem::Lattice2d::restoreContext(), oofem::MPSMaterialStatus::restoreContext(), oofem::HydrationModelStatus::restoreContext(), oofem::Concrete2MaterialStatus::restoreContext(), oofem::SlaveDof::restoreContext(), oofem::LEPlicElementInterface::restoreContext(), oofem::NlDEIDynamic::restoreContext(), oofem::MasterDof::restoreContext(), oofem::ConcreteDPMStatus::restoreContext(), oofem::MPSDamMaterialStatus::restoreContext(), oofem::IsotropicDamageMaterialStatus::restoreContext(), oofem::FEMComponent::restoreContext(), oofem::TrabBone3DStatus::restoreContext(), oofem::NonLinearStatic::restoreContext(), oofem::AnisotropicDamageMaterialStatus::restoreContext(), oofem::GeneralBoundaryCondition::restoreContext(), oofem::LevelSetPCS::restoreContext(), oofem::HuertaErrorEstimator::restoreContext(), oofem::ConcreteDPM2Status::restoreContext(), oofem::Node::restoreContext(), oofem::TimeStep::restoreContext(), oofem::SteelRelaxMatStatus::restoreContext(), oofem::XfemManager::restoreContext(), oofem::CylindricalALM::restoreContext(), oofem::MisesMatStatus::restoreContext(), oofem::PrimaryField::restoreContext(), oofem::IntegrationRule::restoreContext(), oofem::LatticeDamage2dStatus::restoreContext(), oofem::RankineMatStatus::restoreContext(), oofem::Dof::restoreContext(), oofem::DofManager::restoreContext(), oofem::Domain::restoreContext(), oofem::EngngModel::restoreContext(), oofem::Element::restoreContext(), oofem::StressStrainBaseVector::restoreYourself(), oofem::IntArray::restoreYourself(), oofem::FloatArray::restoreYourself(), oofem::FloatMatrix::restoreYourself(), oofem::MazarsNLMaterial::unpackAndUpdateUnknowns(), oofem::TrabBoneNL3D::unpackAndUpdateUnknowns(), oofem::MisesMatNl::unpackAndUpdateUnknowns(), oofem::RankineMatNl::unpackAndUpdateUnknowns(), oofem::IDNLMaterial::unpackAndUpdateUnknowns(), oofem::ExpCZMaterialStatus::updateYourself(), oofem::ProcessCommunicatorBuff::write(), and oofem::CommunicationBuffer::~CommunicationBuffer().

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

Definition at line 68 of file datastream.h.

References read().

Referenced by read().

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

Reads count unsigned long values into array pointed by data.

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

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

Definition at line 71 of file datastream.h.

References read().

Referenced by read().

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

Reads count long values into array pointed by data.

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

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

Definition at line 74 of file datastream.h.

References read().

Referenced by read().

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

Reads count double values into array pointed by data.

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

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

Definition at line 77 of file datastream.h.

References read().

Referenced by read().

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

Reads count char values into array pointed by data.

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

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

Definition at line 80 of file datastream.h.

References read().

Referenced by read().

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

Reads a bool value from data.

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

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().

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

Writes count integer values from array pointed by data.

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

Referenced by oofem::ProcessCommunicatorBuff::givePackSizeOfLong(), oofem::MazarsNLMaterial::packUnknowns(), oofem::TrabBoneNL3D::packUnknowns(), oofem::MisesMatNl::packUnknowns(), oofem::RankineMatNl::packUnknowns(), oofem::IDNLMaterial::packUnknowns(), oofem::save_components(), oofem::B3SolidMaterialStatus::saveContext(), oofem::Eurocode2CreepMaterialStatus::saveContext(), oofem::PlasticMaterialStatus::saveContext(), oofem::PerfectlyPlasticMaterialStatus::saveContext(), oofem::MazarsMaterialStatus::saveContext(), oofem::BinghamFluidMaterial2Status::saveContext(), oofem::CebFipSlip90MaterialStatus::saveContext(), oofem::ProblemSequence::saveContext(), oofem::BondCEBMaterialStatus::saveContext(), oofem::IsoInterfaceDamageMaterialStatus::saveContext(), oofem::MPlasticMaterialStatus::saveContext(), oofem::IntMatIsoDamageStatus::saveContext(), oofem::IsoInterfaceDamageMaterialStatus_2::saveContext(), oofem::DruckerPragerPlasticitySMStatus::saveContext(), oofem::FRCFCMStatus::saveContext(), oofem::MPlasticMaterial2Status::saveContext(), oofem::Dictionary::saveContext(), oofem::RCSDEMaterialStatus::saveContext(), oofem::RCSDMaterialStatus::saveContext(), oofem::LinearConstraintBC::saveContext(), oofem::IDGMaterialStatus::saveContext(), oofem::SimpleSlaveDof::saveContext(), oofem::Lattice2d::saveContext(), oofem::MPSMaterialStatus::saveContext(), oofem::LEPlicElementInterface::saveContext(), oofem::HydrationModelStatus::saveContext(), oofem::Concrete2MaterialStatus::saveContext(), oofem::SlaveDof::saveContext(), oofem::NlDEIDynamic::saveContext(), oofem::FEMComponent::saveContext(), oofem::MasterDof::saveContext(), oofem::ConcreteDPMStatus::saveContext(), oofem::MPSDamMaterialStatus::saveContext(), oofem::IsotropicDamageMaterialStatus::saveContext(), oofem::TrabBone3DStatus::saveContext(), oofem::NonLinearStatic::saveContext(), oofem::AnisotropicDamageMaterialStatus::saveContext(), oofem::GeneralBoundaryCondition::saveContext(), oofem::LevelSetPCS::saveContext(), oofem::HuertaErrorEstimator::saveContext(), oofem::ConcreteDPM2Status::saveContext(), oofem::Node::saveContext(), oofem::TimeStep::saveContext(), oofem::XfemManager::saveContext(), oofem::SteelRelaxMatStatus::saveContext(), oofem::CylindricalALM::saveContext(), oofem::IntegrationRule::saveContext(), oofem::MisesMatStatus::saveContext(), oofem::PrimaryField::saveContext(), oofem::LatticeDamage2dStatus::saveContext(), oofem::RankineMatStatus::saveContext(), oofem::Dof::saveContext(), oofem::DofManager::saveContext(), oofem::Domain::saveContext(), oofem::EngngModel::saveContext(), oofem::Element::saveContext(), oofem::StressStrainBaseVector::storeYourself(), oofem::IntArray::storeYourself(), oofem::ExpCZMaterialStatus::updateYourself(), write(), and oofem::CommunicationBuffer::~CommunicationBuffer().

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

Definition at line 95 of file datastream.h.

References write().

Referenced by write().

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

Writes count unsigned long values from array pointed by data.

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

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

Definition at line 98 of file datastream.h.

References write().

Referenced by write().

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

Writes count long values from array pointed by data.

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

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

Definition at line 101 of file datastream.h.

References write().

Referenced by write().

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

Writes count double values from array pointed by data.

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

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

Definition at line 104 of file datastream.h.

References write().

Referenced by write().

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

Writes count char values from array pointed by data.

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

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

Definition at line 107 of file datastream.h.

References write().

Referenced by write().

virtual int oofem::DataStream::write ( bool  data)
pure virtual
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().

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

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

Definition at line 113 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 documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:34 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011