Move PeerRole to its own file

This commit is contained in:
Vinnie Falco
2013-08-10 12:16:46 -07:00
parent 60935368a3
commit 26bb91a873
21 changed files with 139 additions and 71 deletions

View File

@@ -17,32 +17,6 @@
*/
//==============================================================================
TestPeerBasics::Role::Role (role_t role)
: m_role (role)
{
}
String TestPeerBasics::Role::name () const noexcept
{
if (m_role == server)
return "server";
return "client";
}
bool TestPeerBasics::Role::operator== (role_t role) const noexcept
{
return m_role == role;
}
TestPeerBasics::Role::operator Socket::handshake_type () const noexcept
{
if (m_role == server)
return Socket::server;
return Socket::client;
}
//------------------------------------------------------------------------------
TestPeerBasics::Model::Model (model_t model)
: m_model (model)
{
@@ -60,6 +34,14 @@ bool TestPeerBasics::Model::operator== (model_t model) const noexcept
return m_model == model;
}
boost::asio::ssl::stream_base::handshake_type
TestPeerBasics::to_handshake_type (PeerRole const& role)
{
if (role == PeerRole::client)
return boost::asio::ssl::stream_base::client;
return boost::asio::ssl::stream_base::server;
}
//------------------------------------------------------------------------------
boost::system::error_category const& TestPeerBasics::test_category () noexcept