CatapultServer  v0.5.0.1 (Elephant)
catapult::ionet::ServerPacketHandlerContext Struct Reference

Context passed to a server packet handler function. More...

Inheritance diagram for catapult::ionet::ServerPacketHandlerContext:
Collaboration diagram for catapult::ionet::ServerPacketHandlerContext:

Public Member Functions

 ServerPacketHandlerContext (const Key &key, const std::string &host)
 Creates a context around key and \ host. More...
 
const Keykey () const
 Gets the public key associated with the client. More...
 
const std::string & host () const
 Gets the host associated with the client. More...
 
bool hasResponse () const
 Returns true if a response has been associated with this context. More...
 
const PacketPayloadresponse () const
 Gets the response associated with this context. More...
 
void response (PacketPayload &&payload)
 Sets payload as the response associated with this context. More...
 
- Public Member Functions inherited from catapult::utils::MoveOnly
constexpr MoveOnly ()=default
 Default constructor. More...
 
 ~MoveOnly ()=default
 Default destructor. More...
 
 MoveOnly (const NonCopyable &)=delete
 Disabled copy constructor. More...
 
 MoveOnly (MoveOnly &&)=default
 Default move constructor. More...
 
MoveOnlyoperator= (const MoveOnly &)=delete
 Disabled assignment operator. More...
 
MoveOnlyoperator= (MoveOnly &&)=default
 Default move assignment operator. More...
 

Private Attributes

const Keym_key
 
const std::string & m_host
 
bool m_hasResponse
 
PacketPayload m_payload
 

Detailed Description

Context passed to a server packet handler function.

Constructor & Destructor Documentation

◆ ServerPacketHandlerContext()

catapult::ionet::ServerPacketHandlerContext::ServerPacketHandlerContext ( const Key key,
const std::string &  host 
)
explicit

Creates a context around key and \ host.

Member Function Documentation

◆ hasResponse()

bool catapult::ionet::ServerPacketHandlerContext::hasResponse ( ) const

Returns true if a response has been associated with this context.

Here is the caller graph for this function:

◆ host()

const std::string & catapult::ionet::ServerPacketHandlerContext::host ( ) const

Gets the host associated with the client.

◆ key()

const Key & catapult::ionet::ServerPacketHandlerContext::key ( ) const

Gets the public key associated with the client.

◆ response() [1/2]

const PacketPayload & catapult::ionet::ServerPacketHandlerContext::response ( ) const

Gets the response associated with this context.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ response() [2/2]

void catapult::ionet::ServerPacketHandlerContext::response ( PacketPayload &&  payload)

Sets payload as the response associated with this context.

Here is the call graph for this function:

Member Data Documentation

◆ m_hasResponse

bool catapult::ionet::ServerPacketHandlerContext::m_hasResponse
private

◆ m_host

const std::string& catapult::ionet::ServerPacketHandlerContext::m_host
private

◆ m_key

const Key& catapult::ionet::ServerPacketHandlerContext::m_key
private

◆ m_payload

PacketPayload catapult::ionet::ServerPacketHandlerContext::m_payload
private

The documentation for this struct was generated from the following files: