ALPS Project: alps library

Header file osiris/xdrdump.h

This header contains the classes for object serialization into files using the binary, platform independent XDR format.

Synopsis

namespace alps {
class OXDRDump : public ODump
{
public:
  OXDRDump();   
protected:
  uint32_t getPosition() const;
  void setPosition(uint32_t pos);  
};

class IXDRDump : public IDump
{
public:
  IXDRDump();
protected:
  uint32_t getPosition() const;
  void setPosition(uint32_t pos);
};

class OXDRFileDump: public OXDRDump
{
public:
  OXDRFileDump(const boost::filesystem::path& p);
};

class IXDRFileDump: public IXDRDump
{
public:
  IXDRFileDump(const boost::filesystem::path& p);
#ifdef BOOST_NO_EXCEPTIONS
  bool couldOpen() const;
#endif
};
}

TheOXDRDump class

is the base class for OXDRFileDump. It implements serialization using the XDR format.
uint32_t getPosition() const;
returns the current position in the XDR dump.
void setPosition(uint32_t pos);  
sets the XDR dump to a new position.

TheIXDRDump class

is the base class for IXDRFileDump. It implements deserialization using the XDR format.
uint32_t getPosition() const;
returns the current position in the XDR dump.
void setPosition(uint32_t pos);  
sets the XDR dump to a new position.

TheOXDRFileDump class

implements writing to a file in XDR format using the serialization mechanism.
OXDRFileDump(const boost::filesystem::path& p);
opens a file with the given name for writing using the serialization mechansim.

TheIXDRFileDump class

implements reading from a file in XDR format using the serialization mechanism.
IXDRFileDump(const boost::filesystem::path& p);
opens a file with the given name for reading using the serialization mechansim. If opening fails and exceptions are implemented/enabled a std::runtime_error is thrown. If opening fails and exceptions are disabled, the function couldOpen() returns false.
#ifdef BOOST_NO_EXCEPTIONS
bool couldOpen() const;
#endif
is implemented only when exceptions are disabled. It returns true if the opening of a file succeeded, and false otherwise. A failure to open a file results in a std::runtime_error if exceptions are implemented.

copyright (c) 1994-2010 by Matthias Troyer

Distributed under the Boost Software License, Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt)