/* * Author: * Sven Czarnian * Brief: * Implements the zmq context manager * Copyright: * 2021 Sven Czarnian * License: * GNU General Public License v3 (GPLv3) */ #include "ZmqContext.h" using namespace aman; ZmqContext::ZmqContext() : m_context() { } void ZmqContext::initialize() { if (nullptr == this->m_context) this->m_context = std::make_unique(2); } void ZmqContext::deinitialize() { if (nullptr != this->m_context) this->m_context = std::unique_ptr(); } zmq::context_t& ZmqContext::context() { return *this->m_context; } ZmqContext& ZmqContext::instance() { static ZmqContext __instance; return __instance; }