Obsidian
Probabilistic Geophysical Joint Inversion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
stateline::comms::Message Class Reference

Define valid messages to send on the GDFP-SW (GDF Server-Worker Protocol) More...

#include <messages.hpp>

Public Member Functions

 Message (const std::vector< std::string > &addr, const Subject &subj, const std::vector< std::string > &d)
 Constructor to build a message. More...
 
 Message (const Subject &subj, const std::vector< std::string > &d)
 Create a new message with no address. More...
 
 Message (const std::vector< std::string > &addr, const Subject &subj)
 Create a new message with no data. More...
 
 Message (const Subject &subj)
 Constructor to build a message with no data or address. More...
 
bool operator== (const Message &m) const
 Equality comparator for testing purposes. More...
 

Public Attributes

std::vector< std::string > address
 The destination address of this message.
 
Subject subject
 The subject of the message (e.g. HELLO).
 
std::vector< std::string > data
 The data that this message contains.
 

Friends

std::ostream & operator<< (std::ostream &os, const Message &m)
 Allows a message to be printed with std::cout. More...
 

Detailed Description

Define valid messages to send on the GDFP-SW (GDF Server-Worker Protocol)

Constructor & Destructor Documentation

stateline::comms::Message::Message ( const std::vector< std::string > &  addr,
const Subject subj,
const std::vector< std::string > &  d 
)

Constructor to build a message.

Parameters
addrThe address to send the message to.
subjThe subject of the message (eg. HELLO, JOB etc).
dA vector of data to send in the message. Each element of the vector is sent as a separate frame.
stateline::comms::Message::Message ( const Subject subj,
const std::vector< std::string > &  d 
)

Create a new message with no address.

Parameters
subjThe subject of the message (eg. HELLO, JOB etc).
dA vector of data to send in the message. Each element of the vector is sent as a separate frame.
stateline::comms::Message::Message ( const std::vector< std::string > &  addr,
const Subject subj 
)

Create a new message with no data.

Parameters
addrThe address to send the message to.
subjThe subject of the message (eg. HELLO, JOB etc).
stateline::comms::Message::Message ( const Subject subj)

Constructor to build a message with no data or address.

Parameters
subjThe subject of the message (eg. HELLO, JOB etc).

Member Function Documentation

bool stateline::comms::Message::operator== ( const Message m) const

Equality comparator for testing purposes.

Parameters
mThe message to compare with.
Returns
True if the message is equal to this message.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Message m 
)
friend

Allows a message to be printed with std::cout.

Parameters
osthe output stream.
mthe message object.
osThe output stream.
mThe message to print.

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