]> jfr.im git - irc/gameservirc.git/blobdiff - 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
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6b3905ca7ddf0a01984df47ea024571da615a304 100644 (file)
@@ -0,0 +1,52 @@
+#ifndef __GS__IMASTERDAO_H__\r
+#define __GS__IMASTERDAO_H__\r
+\r
+#include <GameServ/GameLayer/GameObjects/MasterGO.h>\r
+using GameServ::GameLayer::GameObjects::MasterGO;\r
+\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
+using boost::shared_ptr;\r
+\r
+#include <list>\r
+using std::list;\r
+#include <string>\r
+using std::string;\r
+\r
+namespace GameServ { namespace DataLayer { namespace DataAccessObjects\r
+{\r
+       //! Interface for Master Data Access Objects \r
+       /*! \r
+               This is the interface for all Master DAOs.  Each specific datasource\r
+               will need to inherit this common interface.\r
+       */\r
+       class IMasterDAO\r
+       {\r
+       public:\r
+               // Ctors, Dtors ///////////////////////////////////////////////////////\r
+               IMasterDAO(void);\r
+               virtual ~IMasterDAO(void);      // Needs to be virtual \r
+\r
+               //! Get the Master using a unique data/object Id\r
+               /*!\r
+                       \param Id Unique identifier\r
+                       \return A boost shared pointer to a Master game object if found\r
+                       otherwise the list is empty.\r
+               */\r
+               virtual shared_ptr<MasterGO> GetById(const string &Id) const = 0;\r
+\r
+               //! Function to quickly search to see if an Id exists or not\r
+               /*!\r
+               \param Id The Id of the game object to search for\r
+               \return true if the Id is valid and exists in the data, false otherwise\r
+               */\r
+               virtual bool IdExists(const string &Id) const = 0;\r
+\r
+               virtual void Update(shared_ptr<MasterGO> spMaster) = 0;\r
+               virtual void Insert(shared_ptr<MasterGO> spMaster) = 0;\r
+\r
+       private:\r
+               \r
+               \r
+       };\r
+} } }\r
+#endif // __GS__IMasterDAO_H__\r