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