Skip to content

Commit

Permalink
add loginrstmsg
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Oct 15, 2013
1 parent d3466c3 commit 57b1594
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/msg/LoginMsg.cpp
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;
}
26 changes: 26 additions & 0 deletions src/msg/LoginRstMsg.cpp
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;
}
33 changes: 33 additions & 0 deletions src/msg/LoginRstMsg.h
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

0 comments on commit 57b1594

Please sign in to comment.