]>
jfr.im git - irc/gameservirc.git/blob - gameserv-2.0/libgameservgldl/include/GameServ/DataLayer/File/FilePlayerDAO.h
1 #ifndef __GS__FilePlayerDAO_H__
2 #define __GS__FilePlayerDAO_H__
4 #include <GameServ/GameLayer/GameObjects/PlayerGO.h>
5 #include <GameServ/DataLayer/IPlayerDAO.h>
6 using GameServ::GameLayer::GameObjects::PlayerGO
;
7 using GameServ::DataLayer::DataAccessObjects::IPlayerDAO
;
9 #include <boost/shared_ptr.hpp>
10 using boost::shared_ptr
;
15 namespace GameServ
{ namespace DataLayer
{ namespace File
17 //! File implementation of IPlayerDAO interface
19 If you're using an File datasource, you will be using this
20 DAO to access Players.
22 class FilePlayerDAO
: public IPlayerDAO
25 // Ctors, Dtors ///////////////////////////////////////////////////////
27 FilePlayerDAO(const string
&filename
);
28 virtual ~FilePlayerDAO();
30 // Methods ////////////////////////////////////////////////////////////
31 virtual shared_ptr
<PlayerGO
> GetById(const string
&Id
) const;
33 virtual list
<string
> GetIdsByName(const string
&Name
) const;
35 virtual bool IdExists(const string
&Id
) const;
37 virtual void Insert(shared_ptr
<PlayerGO
> spPlayer
);
38 virtual void Update(shared_ptr
<PlayerGO
> spPlayer
);
40 virtual void SetFlags(shared_ptr
<PlayerGO
> spPlayer
, const int &flags
) const;
46 // Constants //////////////////////////////////////////////////////////
48 // Helper Methods /////////////////////////////////////////////////////
49 //! Get control sector information
50 void GetControlInfo(void);
52 //! Creates the PlayerGO found at iterator position
53 shared_ptr
<PlayerGO
> CreatePlayerFromLine(const string
&line
) const;
55 //! Get the Player database file path
56 string
GetPlayerFilePath(void) const;
58 void Initialize(const string
&filename
);
61 } } } // GameServ.DataLayer.DataAccessObjects.File
63 #endif // __GS__FilePlayerDAO_H__