PhoenixSwarm  5.1.1
Library to ease communication between daemons
Loading...
Searching...
No Matches
CheckStream< Swarm::Message > Struct Reference

Generic Message Check function. More...

#include <Representation.h>

Static Public Member Functions

static bool check_stream (const std::string &fieldDescription, const Swarm::Message &data, const Swarm::Message &reference, std::ostream &out)
 Check Stream for a Message.
 

Detailed Description

Generic Message Check function.

Definition at line 251 of file Representation.h.

Member Function Documentation

◆ check_stream()

bool CheckStream< Swarm::Message >::check_stream ( const std::string & fieldDescription,
const Swarm::Message & data,
const Swarm::Message & reference,
std::ostream & out )
static

Check Stream for a Message.

Parameters
fieldDescription: description of the field to be checked
data: data to be checked
reference: reference of the check
out: ostream used to collect feed back in case of error (std::cerr or a logger)
Returns
true on success, false otherwise

Definition at line 330 of file Representation.cpp.

330 {
331 bool b(true);
332 b &= CheckStream<time_t>::check_stream(fieldDescription + "\n- Message::sendTime", data.getSendTime(), reference.getSendTime(), out);
333 b &= CheckStream<size_t>::check_stream(fieldDescription + "\n- Message::id", data.getId(), reference.getId(), out);
334 b &= CheckStream<bool>::check_stream(fieldDescription + "\n- Message::isConfirmationNeeded", data.getIsConfirmationNeeded(), reference.getIsConfirmationNeeded(), out);
335 b &= CheckStream<PString>::check_stream(fieldDescription + "\n- Message::sender", data.getSender(), reference.getSender(), out);
336 b &= CheckStream<std::vector<PString>>::check_stream(fieldDescription + "\n- Message::vecRecver", data.getVecRecver(), reference.getVecRecver(), out);
337 b &= CheckStream<MessageType::MessageType>::check_stream(fieldDescription + "\n- Message::type", data.getType(), reference.getType(), out);
338 b &= CheckStream<Swarm::Data>::check_stream(fieldDescription + "\n- Message::data", data.getData(), reference.getData(), out);
339 return b;
340}
const PString & getSender() const
Gets the sender of the Message.
const std::vector< PString > & getVecRecver() const
Gets the vecRecver of the Message.
const Swarm::Data & getData() const
Gets the data of the Message.
size_t getId() const
Gets the id of the Message.
bool getIsConfirmationNeeded() const
Gets the isConfirmationNeeded of the Message.
const MessageType::MessageType & getType() const
Gets the type of the Message.
const time_t & getSendTime() const
Gets the sendTime of the Message.
static bool check_stream(const std::string &fieldDescription, const Swarm::Data &data, const Swarm::Data &reference, std::ostream &out)
Check Stream for a Data.
static bool check_stream(const std::string &fieldDescription, const Swarm::Message &data, const Swarm::Message &reference, std::ostream &out)
Check Stream for a Message.

References CheckStream< Swarm::Data >::check_stream(), check_stream(), Swarm::Message::getData(), Swarm::Message::getId(), Swarm::Message::getIsConfirmationNeeded(), Swarm::Message::getSender(), Swarm::Message::getSendTime(), Swarm::Message::getType(), and Swarm::Message::getVecRecver().

Referenced by check_stream().

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

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