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

Generic Message Check function. More...

#include <Representation.h>

Static Public Member Functions

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

Detailed Description

Generic Message Check function.

Definition at line 250 of file Representation.h.

Member Function Documentation

◆ check_stream()

bool CheckStream< Message >::check_stream ( const std::string & fieldDescription,
const Message & data,
const 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 328 of file Representation.cpp.

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

References CheckStream< Data >::check_stream(), check_stream(), Message::getData(), Message::getId(), Message::getIsConfirmationNeeded(), Message::getSender(), Message::getSendTime(), Message::getType(), and 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: