Made to Order Software Corporation Logo

libsswf: sswf::Data::DataLimit Class Reference

#include <libsswf.h>

List of all members.


Public Member Functions

 DataLimit (const Data &data, unsigned long limit, bool offset=true)
 Initializes a DataLimit object.
void Restore ()
 Restore the limit.
 ~DataLimit ()
 Restore the limit and clean up the data limit object.

Private Attributes

const Data *const f_data
const unsigned long f_old_limit
bool f_restored

Constructor & Destructor Documentation

Data::DataLimit::DataLimit ( const Data data,
unsigned long  limit,
bool  offset = true 
)

This class is used to create RAII objects allowing you to ensure that the limit of a Data object is always restored as required.

Exceptions:
OutOfBoundsErrorException is raised if the limit is more than the current size of the Data buffer.
Parameters:
[in] data The data that receives the new limit.
[in] limit The new data limit.
[in] offset If true, the limit is considered to be an offset from the current file position.

Data::DataLimit::~DataLimit (  ) 

This function calls the Restore() function and returns.

References Restore().


Member Function Documentation

void Data::DataLimit::Restore ( void   ) 

This function restores the limit of the data to what it was at the time you created this DataLimit object.

It is expected that all DataLimit will be created on your stack to automatically enforce the order in which the creations and destructions should occur.

References f_data, f_old_limit, f_restored, and sswf::Data::Limit().

Referenced by ~DataLimit().


Member Data Documentation

const Data* const sswf::Data::DataLimit::f_data [private]

Referenced by Restore().

const unsigned long sswf::Data::DataLimit::f_old_limit [private]

Referenced by Restore().

Referenced by Restore().


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


Generated on Wed Mar 18 15:13:57 2009 for libsswf by  doxygen 1.5.5