+#ifndef __GS__FILEMASTERDAO_H__\r
+#define __GS__FILEMASTERDAO_H__\r
+\r
+#include <GameServ/GameLayer/GameObjects/MasterGO.h>\r
+#include <GameServ/DataLayer/IMasterDAO.h>\r
+using GameServ::GameLayer::GameObjects::MasterGO;\r
+using GameServ::DataLayer::DataAccessObjects::IMasterDAO;\r
+\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
+using boost::shared_ptr;\r
+\r
+#include <string>\r
+using std::string;\r
+\r
+#include <vector>\r
+using std::vector;\r
+\r
+#include <map>\r
+using std::map;\r
+\r
+namespace GameServ { namespace DataLayer { namespace File\r
+{\r
+ //! File implementation of IMasterDAO interface\r
+ /*!\r
+ If you're using an File datasource, you will be using this\r
+ DAO to access Masters.\r
+ */\r
+ class FileMasterDAO : public IMasterDAO\r
+ {\r
+ public:\r
+ // Ctors, Dtors ///////////////////////////////////////////////////////\r
+ FileMasterDAO(void);\r
+ FileMasterDAO(const string &filename);\r
+ virtual ~FileMasterDAO();\r
+\r
+ // Methods ////////////////////////////////////////////////////////////\r
+ virtual shared_ptr<MasterGO> GetById(const string &Id) const;\r
+\r
+ virtual bool IdExists(const string &Id) const;\r
+\r
+ void LoadMasterCache(void);\r
+\r
+ private:\r
+ //! Data file\r
+ string mFilename;\r
+\r
+ // Helper Methods /////////////////////////////////////////////////////\r
+\r
+ //! Creates the MasterGO found at iterator position\r
+ shared_ptr<MasterGO> CreateMasterFromLine(const string &line) const;\r
+\r
+ //! Get the Master database file path\r
+ string GetMasterFilePath(void) const;\r
+\r
+ void Initialize(const string &filename);\r
+\r
+ map<string, shared_ptr<MasterGO> > spMasterCache;\r
+ };\r
+} } } // GameServ.DataLayer.DataAccessObjects.File\r
+\r
+#endif // __GS__FileMasterDAO_H__\r