#pragma once /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /** @file */ /** @copyright 2021 MPLv2 */ #include #include #include /** * @brief This is the main namespace for all whisper-com related datatypes and classed. */ namespace Whisper { class Transmittable : public std::enable_shared_from_this { private: std::shared_ptr encoding_; public: Transmittable() : encoding_(nullptr) {} ~Transmittable() {encoding_=nullptr;} void setEncoding(std::shared_ptr encoding) {encoding_=encoding;} std::shared_ptr encoding() { return encoding_;} bool hasEnconding() { return encoding_ != nullptr;} virtual std::shared_ptr> encode() = 0; virtual void decode(std::shared_ptr> data) = 0; virtual std::shared_ptr getPayload() = 0; }; // Transmittable }; // namespace Whisper