Archive Class Reference
[Public API]

Archive class represents database that has relational or object-oriented structure and can contain object of classes derived from storeable class. More...

#include <archive.h>

Inheritance diagram for Archive:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Archive ()
 Constructor.
virtual IStreamgetInputStream ()=0
 Create input stream.
virtual OStreamgetOutputStream ()=0
 Create output stream.
virtual bool isOpen () const =0
 Check if archive is open.
virtual void open (const char *pOpenStr)=0
 Opens archive.
virtual ~Archive ()
 Destructor.

Detailed Description

Archive class represents database that has relational or object-oriented structure and can contain object of classes derived from storeable class.

To store object in database you must do following steps:

  1. derive from Storeable class
  2. define store table for object
  3. get stream from archive
  4. bind additional variables to stream (optional)
  5. open stream
  6. get or put objects into stream.

There are two types of streams. Output stream is for storing objects into database and Input stream is for getting stream from database.

You can bind C++ variable to database column and when retrieving query results values that are binded will autmaticaly updated. Binded variables can be created from input stream or output stream

If you bind variable to input stream then every time you get an object from database binded variable will be updated. If you bind variable to output stream then every time object is inserted into database values from binded variable are inserted into database too.

There is one limitation when using binded variables and output streams - alhtoungh you can bind to any table and any column in database, but only columns from tables that are currently updated by storing object would be updated. In other words, when SQL update is constructed to store particular object this query will be extended to update binded variables _if_ they are binded to table that is used by object being updated.

Streams represents connections to database. This means that if get two streams from Archive you open two connections to database. Connections are reusable and currently they are never closed by archive. Call to Archive::open opens initial connection. Every next connection that is internally open by archive is open with the same connect string that initial connection.


Member Function Documentation

virtual IStream* getInputStream  )  [pure virtual]
 

Create input stream.

Returned value must be deleted

Returns:
IStream

Implemented in CSVArchive, and SQLArchive.

virtual OStream* getOutputStream  )  [pure virtual]
 

Create output stream.

Returned value must be deleted

Returns:
IStream

Implemented in CSVArchive, and SQLArchive.

virtual bool isOpen  )  const [pure virtual]
 

Check if archive is open.

Returns:
true if archive is open, false otherwise

Implemented in CSVArchive, MemArchive, and SQLArchive.

virtual void open const char *  pOpenStr  )  [pure virtual]
 

Opens archive.

Parameters:
pOpenStr connect string passed to internal Database object

Implemented in CSVArchive, MemArchive, and SQLArchive.


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:16 2008