Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages | Examples

SimpleDB::SimpleDBFactory Class Reference

This simple singleton factory produces and creates memory for database handles to be returned to the client. More...

#include <SimpleDBFactory.h>

Collaboration diagram for SimpleDB::SimpleDBFactory:

Collaboration graph
[legend]
List of all members.

Static Public Member Functions

static SimpleDBFactoryInstance ()
 Return the single instance of the SimpleDB Factory.
static std::auto_ptr< DatabasegetDBHandle (const std::string dsn)
 Create an auto_ptr and return it, then ownership has to be transferred to the caller.
static void Kill ()
 Destroy the factory for normal cleanup.

Protected Member Functions

 SimpleDBFactory ()
 Hidden constructor.

Static Protected Attributes

static SimpleDBFactory_instance = 0
 From persistent singleton pattern.

Detailed Description

This simple singleton factory produces and creates memory for database handles to be returned to the client.

Currently this factory is not useful. It will be used in future for connection pooling. Work needs to be done to make it thread safe and exception safe.

Exceptions:
SimpleDB Exceptions (same as those thrown during normal creation)
Todo:
add mutual exclusion with algorithm for intelligent handing out of connection handles (block based on some algorithm to improve efficiency)
Examples:

factory.cpp.


Member Function Documentation

std::auto_ptr< Database > SimpleDBFactory::getDBHandle const std::string  dsn  )  [static]
 

Create an auto_ptr and return it, then ownership has to be transferred to the caller.

Parameters:
dsn The Database source name
Returns:
auto_ptr to Database.
Examples:
factory.cpp.


Member Data Documentation

SimpleDBFactory * SimpleDBFactory::_instance = 0 [static, protected]
 

From persistent singleton pattern.

Make sure only one instance of the factory will be created.


The documentation for this class was generated from the following files:
Copyright (C) 2005 Eminence Technology Pty Ltd.
Documentation pages generated by doxygen.

SourceForge.net Logo