dodo  0.0.1
A C++ library to create containerized Linux services
dodo::network::protocol::stomp::Connect Class Reference

A STOMP CONNECT frame. More...

#include <stomp.hpp>

Inheritance diagram for dodo::network::protocol::stomp::Connect:
Collaboration diagram for dodo::network::protocol::stomp::Connect:

Public Member Functions

 Connect (const Version &version=Version::v1_2)
 Constructor. More...
 
virtual void generate (common::Bytes &frame) const
 Generate a STOMP (CONNECT) frame. More...
 
size_t getHeartbeatOut () const
 Return the outgoing heartbeat in milliseconds. More...
 
std::string getHost () const
 Return the STOMP host. More...
 
std::string getLogin () const
 Return the login. More...
 
std::string getPasscode () const
 Return the passcode. More...
 
virtual FrameMatch match (const common::Bytes &frame, std::list< std::string > &errors) const
 Checks how the data matches a frame specification. More...
 
void setHeartbeat (size_t out, size_t in)
 Set the heartbeat. More...
 
void setHost (const std::string &host)
 Set the STOMP host. More...
 
void setLogin (const std::string &login)
 Set the login. More...
 
void setPasscode (const std::string &passcode)
 Set the login. More...
 

Protected Attributes

size_t heartbeat_in_ms_
 Desired incoming heartbeat delay in milliseconds. More...
 
size_t heartbeat_out_ms_
 Offered outgoing heartbeat delay in milliseconds. More...
 
std::string host_
 STOMP host to CONNECT. More...
 
std::string login_
 Optional login. More...
 
std::string passcode_
 Optional passcode (required if login is not empty) More...
 
Version version_
 STOMP protocol version required in CONNECT handshake. More...
 

Additional Inherited Members

- Public Types inherited from dodo::network::protocol::stomp::Frame
enum  FrameMatch { FrameMatch::NoMatch, FrameMatch::IncompleteMatch, FrameMatch::FullMatch }
 The manner in which frames match the STOMP protocol. More...
 
enum  Version { Version::v1_2 }
 STOMP versions. More...
 
- Data Fields inherited from dodo::network::protocol::stomp::Frame
const common::Bytes command_connect { "STOMP" }
 CONNECT command. More...
 
const common::Bytes command_connected { "CONNECTED" }
 CONNECTED command. More...
 
const common::Bytes eol { "\n" }
 EOL sequence - use only
as the protocl allows it and the extra
serves no purpose. More...
 
const common::Bytes header_accept_version_1_2 { "accept-version:1.2" }
 STOMP 1.2 accept header. More...
 
- Protected Member Functions inherited from dodo::network::protocol::stomp::Frame
FrameMatch readCommand (const common::Bytes &frame, size_t &index, const common::Bytes &command) const
 Read a command from a frame. More...
 

Detailed Description

A STOMP CONNECT frame.

Definition at line 99 of file stomp.hpp.

Constructor & Destructor Documentation

◆ Connect()

dodo::network::protocol::stomp::Connect::Connect ( const Version version = Version::v1_2)
inline

Constructor.

Parameters
versionThe STOMP protocol version.

Definition at line 106 of file stomp.hpp.

Member Function Documentation

◆ generate()

void dodo::network::protocol::stomp::Connect::generate ( common::Bytes frame) const
virtual

Generate a STOMP (CONNECT) frame.

Parameters
frameThe generation destination, which is overwritten.

Implements dodo::network::protocol::stomp::Frame.

Definition at line 68 of file stomp.cpp.

References dodo::common::Bytes::append(), dodo::network::protocol::stomp::Frame::command_connect, dodo::network::protocol::stomp::Frame::eol, dodo::common::Bytes::free(), dodo::network::protocol::stomp::Frame::header_accept_version_1_2, heartbeat_in_ms_, heartbeat_out_ms_, host_, login_, and passcode_.

Here is the call graph for this function:

◆ getHeartbeatOut()

size_t dodo::network::protocol::stomp::Connect::getHeartbeatOut ( ) const
inline

Return the outgoing heartbeat in milliseconds.

Returns
the outgoing heartbeat interval in milliseconds.

Definition at line 171 of file stomp.hpp.

References heartbeat_out_ms_.

◆ getHost()

std::string dodo::network::protocol::stomp::Connect::getHost ( ) const
inline

Return the STOMP host.

Returns
The host.

Definition at line 134 of file stomp.hpp.

References host_.

◆ getLogin()

std::string dodo::network::protocol::stomp::Connect::getLogin ( ) const
inline

Return the login.

Returns
The login.

Definition at line 146 of file stomp.hpp.

References login_.

◆ getPasscode()

std::string dodo::network::protocol::stomp::Connect::getPasscode ( ) const
inline

Return the passcode.

Returns
The passcode.

Definition at line 158 of file stomp.hpp.

References passcode_.

◆ match()

Frame::FrameMatch dodo::network::protocol::stomp::Connect::match ( const common::Bytes frame,
std::list< std::string > &  errors 
) const
virtual

Checks how the data matches a frame specification.

Parameters
frameThe frame / common::Bytes to match against.
errorsIf returning FrameMatch::NoMatch, one or more errors.
Returns
FrameMatch::IncompleteMatch if the frame matches but is incomplete, FrameMatch::FullMatch if it matches completely.

Implements dodo::network::protocol::stomp::Frame.

Definition at line 62 of file stomp.cpp.

References dodo::network::protocol::stomp::Frame::command_connect, and dodo::network::protocol::stomp::Frame::readCommand().

Here is the call graph for this function:

◆ setHeartbeat()

void dodo::network::protocol::stomp::Connect::setHeartbeat ( size_t  out,
size_t  in 
)
inline

Set the heartbeat.

Parameters
outoutgoing heartbeat interval in milliseconds.
inincoming heartbeat interval in milliseconds.

Definition at line 178 of file stomp.hpp.

References heartbeat_in_ms_, and heartbeat_out_ms_.

◆ setHost()

void dodo::network::protocol::stomp::Connect::setHost ( const std::string &  host)
inline

Set the STOMP host.

Parameters
hostThe host to set.

Definition at line 140 of file stomp.hpp.

References host_.

◆ setLogin()

void dodo::network::protocol::stomp::Connect::setLogin ( const std::string &  login)
inline

Set the login.

Parameters
loginThe login to set.

Definition at line 152 of file stomp.hpp.

References login_.

◆ setPasscode()

void dodo::network::protocol::stomp::Connect::setPasscode ( const std::string &  passcode)
inline

Set the login.

Parameters
passcodeThe passcode to set.

Definition at line 164 of file stomp.hpp.

References passcode_.

Field Documentation

◆ heartbeat_in_ms_

size_t dodo::network::protocol::stomp::Connect::heartbeat_in_ms_
protected

Desired incoming heartbeat delay in milliseconds.

Definition at line 197 of file stomp.hpp.

Referenced by generate(), and setHeartbeat().

◆ heartbeat_out_ms_

size_t dodo::network::protocol::stomp::Connect::heartbeat_out_ms_
protected

Offered outgoing heartbeat delay in milliseconds.

Definition at line 194 of file stomp.hpp.

Referenced by generate(), getHeartbeatOut(), and setHeartbeat().

◆ host_

std::string dodo::network::protocol::stomp::Connect::host_
protected

STOMP host to CONNECT.

Definition at line 182 of file stomp.hpp.

Referenced by generate(), getHost(), and setHost().

◆ login_

std::string dodo::network::protocol::stomp::Connect::login_
protected

Optional login.

Definition at line 185 of file stomp.hpp.

Referenced by generate(), getLogin(), and setLogin().

◆ passcode_

std::string dodo::network::protocol::stomp::Connect::passcode_
protected

Optional passcode (required if login is not empty)

Definition at line 188 of file stomp.hpp.

Referenced by generate(), getPasscode(), and setPasscode().

◆ version_

Version dodo::network::protocol::stomp::Connect::version_
protected

STOMP protocol version required in CONNECT handshake.

Definition at line 191 of file stomp.hpp.


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