Modulo 5.0.0
Loading...
Searching...
No Matches
SubscriptionInterface.cpp
1#include "modulo_core/communication/SubscriptionInterface.hpp"
2
4
5SubscriptionInterface::SubscriptionInterface(std::shared_ptr<MessagePairInterface> message_pair)
6 : message_pair_(std::move(message_pair)) {}
7
8std::shared_ptr<MessagePairInterface> SubscriptionInterface::get_message_pair() const {
9 return this->message_pair_;
10}
11
12void SubscriptionInterface::set_message_pair(const std::shared_ptr<MessagePairInterface>& message_pair) {
13 if (message_pair == nullptr) {
14 throw exceptions::NullPointerException("Provide a valid pointer");
15 }
16 this->message_pair_ = message_pair;
17}
18}// namespace modulo_core::communication
SubscriptionInterface(std::shared_ptr< MessagePairInterface > message_pair=nullptr)
Constructor with the message pair.
void set_message_pair(const std::shared_ptr< MessagePairInterface > &message_pair)
Set the pointer to the message pair of the SubscriptionInterface.
std::shared_ptr< MessagePairInterface > message_pair_
The pointer to the stored MessagePair instance.
std::shared_ptr< MessagePairInterface > get_message_pair() const
Get the pointer to the message pair of the SubscriptionInterface.
An exception class to notify that a certain pointer is null.
Modulo Core communication module for handling messages on publication and subscription interfaces.