OStream Class Reference
[Public API]

OStream represents Object Stream to Archive. More...

#include <ostream.h>

Inheritance diagram for OStream:

Inheritance graph
[legend]
Collaboration diagram for OStream:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void assignId (Storeable *pObject)=0 throw (Exception)
 Assign object identifier.
virtual void begin ()=0
 Create transaction on stream.
virtual void commit ()=0
 Commit all changes made to stream from point where begin() was called.
virtual void open (const char *pRootTable=NULL)=0
 Prepare stream to put Storeable objects in it.
 OStream ()
 Constructor.
bool put (Storeable *pObject)
 Put object into stream and update all data from binded variables that are binded to rows in database that are affected by putting pObject.
virtual void rollback ()=0
 Cancel all changes to stream from point where begin() was called.
virtual ~OStream ()
 Destructor.

Detailed Description

OStream represents Object Stream to Archive.

You can put any class that inherits from Storeable class into OStream.


Member Function Documentation

virtual void assignId Storeable pObject  )  throw (Exception) [pure virtual]
 

Assign object identifier.

Parameters:
pObject Object which id should be set. This object must not have its id set

virtual void begin  )  [pure virtual]
 

Create transaction on stream.

Changes in database will be all commited only after calling close().

Implemented in CSVOStream, and SQLOStream.

virtual void commit  )  [pure virtual]
 

Commit all changes made to stream from point where begin() was called.

Note:
You should use dba::Transaction object instead of calling this method

Implemented in CSVOStream, and SQLOStream.

virtual void open const char *  pRootTable = NULL  )  [pure virtual]
 

Prepare stream to put Storeable objects in it.

If there is problem with object store then dba::DataException is thrown. If there is problem with database connection then dba::DatabaseExcption is thrown.

Parameters:
pRootTable new root relation name for each Storeable object that is put into stream. If NULL then \ name from store table is used
Returns:
true if at least one object was stored or erased in database, false if no store was performed (all objects are in OK state)

Implemented in CSVOStream, and SQLOStream.

bool put Storeable pObject  ) 
 

Put object into stream and update all data from binded variables that are binded to rows in database that are affected by putting pObject.

Depending on state of pObject store, erase or update is called.

Note:
You should use dba::Transaction object instead of calling this method
Parameters:
pObject object to store

virtual void rollback  )  [pure virtual]
 

Cancel all changes to stream from point where begin() was called.

Note:
You should use dba::Transaction object instead of calling this method

Implemented in CSVOStream, and SQLOStream.


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

Documentation
Quick start
Examples
Search

API Documentation
Class hierarchy
Member index
API Reference
Store filters
Store table macros
Back

Generated by doxygen at Sun Nov 9 02:08:23 2008