-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Administrator
committed
Oct 15, 2013
1 parent
d3466c3
commit 57b1594
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "LoginMsg.h" | ||
|
||
BOOST_CLASS_EXPORT(LoginMsg) | ||
|
||
LoginMsg::LoginMsg() | ||
{ | ||
} | ||
LoginMsg::LoginMsg(const std::string &strUserID, const std::string &strUserPwd) | ||
:m_strUserID(strUserID) | ||
,m_strUserPwd(strUserPwd) | ||
{ | ||
} | ||
LoginMsg::~LoginMsg() | ||
{ | ||
} | ||
std::string LoginMsg::ClassName() const | ||
{ | ||
return "LoginMsg"; | ||
} | ||
IMsg* LoginMsg::Clone() const | ||
{ | ||
return new LoginMsg(*this); | ||
} | ||
const std::string& LoginMsg::UserID() const | ||
{ | ||
return m_strUserID; | ||
} | ||
void LoginMsg::UserID(const std::string &strUserID) | ||
{ | ||
m_strUserID = strUserID; | ||
} | ||
const std::string& LoginMsg::UserPwd() const | ||
{ | ||
return m_strUserPwd; | ||
} | ||
void LoginMsg::UserPwd(const std::string &strUserPwd) | ||
{ | ||
m_strUserPwd = strUserPwd; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "LoginRstMsg.h" | ||
|
||
BOOST_CLASS_EXPORT(LoginRstMsg) | ||
|
||
LoginRstMsg::LoginRstMsg() | ||
{ | ||
} | ||
LoginRstMsg::~LoginRstMsg() | ||
{ | ||
} | ||
std::string LoginRstMsg::ClassName() const | ||
{ | ||
return "LoginRstMsg"; | ||
} | ||
IMsg* LoginRstMsg::Clone() const | ||
{ | ||
return new LoginMsg(*this); | ||
} | ||
bool LoginRstMsg::Success() const | ||
{ | ||
return m_bSuccess; | ||
} | ||
void LoginRstMsg::Success(bool bSuccess) | ||
{ | ||
m_bSuccess = bSuccess; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef _LOGINRSTMSG_H_ | ||
#define _LOGINRSTMSG_H_ | ||
|
||
class LoginRstMsg | ||
:public INetMsg | ||
{ | ||
public: | ||
LoginRstMsg(); | ||
virtual ~LoginRstMsg(); | ||
LoginRstMsg(const LoginRstMsg &) = default; | ||
LoginRstMsg& operator=(const LoginRstMsg &) = default; | ||
public: | ||
virtual std::string ClassName() const; | ||
virtual IMsg* Clone() const; | ||
public: | ||
bool Success() const; | ||
void Success(bool); | ||
private: | ||
bool m_bSuccess; | ||
private: | ||
friend class boost::serialization::access; | ||
template<typename Archive> | ||
void serialize(Archive &ar, const unsigned version); | ||
}; | ||
|
||
template<typename Archive> | ||
void LoginRstMsg::serialize(Archive &ar, const unsigned version) | ||
{ | ||
ar & boost::serialization::base_object<INetMsg>(*this); | ||
ar & m_bSuccess; | ||
} | ||
|
||
#endif |