]> jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/IMasterDAO.h
Wrote some initial MySQLDAO objects, but they're not complete
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / include / GameServ / DataLayer / IMasterDAO.h
1 #ifndef __GS__IMASTERDAO_H__
2 #define __GS__IMASTERDAO_H__
3
4 #include <GameServ/GameLayer/GameObjects/MasterGO.h>
5 using GameServ::GameLayer::GameObjects::MasterGO;
6
7 #include <boost/smart_ptr/shared_ptr.hpp>
8 using boost::shared_ptr;
9
10 #include <list>
11 using std::list;
12 #include <string>
13 using std::string;
14
15 namespace GameServ { namespace DataLayer { namespace DataAccessObjects
16 {
17 //! Interface for Master Data Access Objects
18 /*!
19 This is the interface for all Master DAOs. Each specific datasource
20 will need to inherit this common interface.
21 */
22 class IMasterDAO
23 {
24 public:
25 // Ctors, Dtors ///////////////////////////////////////////////////////
26 IMasterDAO(void);
27 virtual ~IMasterDAO(void); // Needs to be virtual
28
29 //! Get the Master using a unique data/object Id
30 /*!
31 \param Id Unique identifier
32 \return A boost shared pointer to a Master game object if found
33 otherwise the list is empty.
34 */
35 virtual shared_ptr<MasterGO> GetById(const string &Id) const = 0;
36
37 //! Function to quickly search to see if an Id exists or not
38 /*!
39 \param Id The Id of the game object to search for
40 \return true if the Id is valid and exists in the data, false otherwise
41 */
42 virtual bool IdExists(const string &Id) const = 0;
43
44 virtual void Update(shared_ptr<MasterGO> spMaster) = 0;
45 virtual void Insert(shared_ptr<MasterGO> spMaster) = 0;
46
47 private:
48
49
50 };
51 } } }
52 #endif // __GS__IMasterDAO_H__