1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Simple&nbsp;C++&nbsp;ODBC&nbsp;Database&nbsp;API: SimpleDB::SimpleDBFactory Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a> | <a class="qindex" href="examples.html">Examples</a></div>
<div class="nav">
<a class="el" href="namespaceSimpleDB.html">SimpleDB</a>::<a class="el" href="classSimpleDB_1_1SimpleDBFactory.html">SimpleDBFactory</a></div>
<h1>SimpleDB::SimpleDBFactory Class Reference</h1>This simple singleton factory produces and creates memory for database handles to be returned to the client.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="SimpleDBFactory_8h-source.html">SimpleDBFactory.h</a>></code>
<p>
Collaboration diagram for SimpleDB::SimpleDBFactory:<p><center><img src="classSimpleDB_1_1SimpleDBFactory__coll__graph.png" border="0" usemap="#SimpleDB_1_1SimpleDBFactory__coll__map" alt="Collaboration graph"></center>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classSimpleDB_1_1SimpleDBFactory-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e0" doxytag="SimpleDB::SimpleDBFactory::Instance"></a>
static <a class="el" href="classSimpleDB_1_1SimpleDBFactory.html">SimpleDBFactory</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1SimpleDBFactory.html#e0">Instance</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the single instance of the <a class="el" href="namespaceSimpleDB.html">SimpleDB</a> Factory. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static std::auto_ptr< <a class="el" href="classSimpleDB_1_1Database.html">Database</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1SimpleDBFactory.html#e1">getDBHandle</a> (const std::string dsn)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Create an auto_ptr and return it, then ownership has to be transferred to the caller. <a href="#e1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e2" doxytag="SimpleDB::SimpleDBFactory::Kill"></a>
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1SimpleDBFactory.html#e2">Kill</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy the factory for normal cleanup. <br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b0" doxytag="SimpleDB::SimpleDBFactory::SimpleDBFactory"></a>
</td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1SimpleDBFactory.html#b0">SimpleDBFactory</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Hidden constructor. <br></td></tr>
<tr><td colspan="2"><br><h2>Static Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classSimpleDB_1_1SimpleDBFactory.html">SimpleDBFactory</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classSimpleDB_1_1SimpleDBFactory.html#t0">_instance</a> = 0</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">From persistent singleton pattern. <a href="#t0"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This simple singleton factory produces and creates memory for database handles to be returned to the client.
<p>
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.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="namespaceSimpleDB.html">SimpleDB</a></em> </td><td>Exceptions (same as those thrown during normal creation) </td></tr>
</table>
</dl>
<dl compact><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>add mutual exclusion with algorithm for intelligent handing out of connection handles (block based on some algorithm to improve efficiency) </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<p>
<a class="el" href="factory_8cpp-example.html#_a11">factory.cpp</a>.</dl>
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e1" doxytag="SimpleDB::SimpleDBFactory::getDBHandle"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">std::auto_ptr< <a class="el" href="classSimpleDB_1_1Database.html">Database</a> > SimpleDBFactory::getDBHandle </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">const std::string </td>
<td class="mdname1" valign="top" nowrap> <em>dsn</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Create an auto_ptr and return it, then ownership has to be transferred to the caller.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>dsn</em> </td><td>The <a class="el" href="classSimpleDB_1_1Database.html">Database</a> source name </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>auto_ptr to <a class="el" href="classSimpleDB_1_1Database.html">Database</a>. </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="factory_8cpp-example.html#a13">factory.cpp</a>.</dl> </td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="t0" doxytag="SimpleDB::SimpleDBFactory::_instance"></a><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"><a class="el" href="classSimpleDB_1_1SimpleDBFactory.html">SimpleDBFactory</a> * <a class="el" href="classSimpleDB_1_1SimpleDBFactory.html#t0">SimpleDBFactory::_instance</a> = 0<code> [static, protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
From persistent singleton pattern.
<p>
Make sure only one instance of the factory will be created. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="SimpleDBFactory_8h-source.html">SimpleDBFactory.h</a><li>SimpleDBFactory.cpp</ul>
<hr>
<div align="right"><small>
Copyright (C) 2005 <a target="top" href="http://www.eminence.com.au">Eminence Technology Pty Ltd</a>.<br>
Documentation pages generated by doxygen.</small><br>
<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=129109&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
</div>
|