]> jfr.im git - irc/gameservirc.git/blame - gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/DataAccess.h
Completed some more work on FilePlayerDAO and Created a PlayerGL object which uses...
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / include / GameServ / DataLayer / DataAccess.h
CommitLineData
ce4e8c42 1#ifndef __GS__DATAACCESS_H__\r
2#define __GS__DATAACCESS_H__\r
3\r
4#include <GameServ/DataLayer/IDAOFactory.h>\r
5using GameServ::DataLayer::IDAOFactory;\r
6\r
7#include <boost/shared_ptr.hpp>\r
8using boost::shared_ptr;\r
9\r
10namespace GameServ { namespace DataLayer\r
11{\r
12 //! Main Access into the DataLayer library of objects\r
13 /*!\r
14 To make use of the DataLayer in a generic way use DataAccess to instantiate your\r
15 dataLayer factories. DataAccess requires the use of a Provider string, populated \r
16 by parameter, and depending on that provider specified, builds the appropriate factory\r
17 to use when creating individual data access objects. This way not only can the\r
18 DataAccessObjects be used in a generic way but the factories themselves can be easily\r
19 switched. If you know exactly what data factory you want to use then there is no need\r
20 to request a factory interfacefrom DataAccess\r
21\r
22 The current providers are:\r
23 File: Flat file database system\r
24 MySQL\r
25 */\r
26 class DataAccess\r
27 {\r
28 public:\r
29 \r
30 //! Get's the DAO factory to use for creating factories using a specific factory\r
31 /*!\r
32 Usually the default GetDataAccessFactory() is used without providing the provider name,\r
33 and the provider is picked up from the AppSettings global object. But sometimes you\r
34 just need to have extra control of the data layer. However, It's not recommended that you mix\r
35 data access objects. Ids and resources in one DataAccessObject of one provider can mean completely\r
36 different things in another provider.\r
37 */\r
38 static shared_ptr<IDAOFactory> GetDataAccessFactory(const string &Provider);\r
39\r
40\r
41 };\r
42\r
43}} // GameServ::DataLayer\r
44\r
45#endif // __GS__DATAACCESS_H__\r