define a context for all components

Este cometimento está contido em:
Sven Czarnian
2021-08-17 17:25:59 +02:00
ascendente c03b75fc89
cometimento 627361035c
2 ficheiros modificados com 45 adições e 0 eliminações

20
src/com/ZmqContext.cpp Ficheiro normal
Ver ficheiro

@@ -0,0 +1,20 @@
/*
* Author:
* Sven Czarnian <devel@svcz.de>
* Brief:
* Implements the zmq context manager
* Copyright:
* 2021 Sven Czarnian
* License:
* GNU General Public License v3 (GPLv3)
*/
#include "ZmqContext.h"
using namespace aman;
static zmq::context_t __context(2);
zmq::context_t& ZmqContext::context() {
return __context;
}

25
src/com/ZmqContext.h Ficheiro normal
Ver ficheiro

@@ -0,0 +1,25 @@
/*
* @brief Defines the context manager
* @file src/com/ZmqContext.h
* @author Sven Czarnian <devel@svcz.de>
* @copyright Copyright 2021 Sven Czarnian
* @license This project is published under the GNU General Public License v3 (GPLv3)
*/
#pragma once
#include <zmq.hpp>
namespace aman {
/**
* @brief Handles the ZMQ context information
*/
class ZmqContext {
public:
/**
* @brief Returns the system wide context
* @return The ZMQ context
*/
static zmq::context_t& context();
};
}