skeleton wip

This commit is contained in:
2019-11-13 23:08:13 +01:00
parent 65e2247b17
commit ab4a18f685
11 changed files with 431 additions and 13 deletions

View File

@@ -0,0 +1,70 @@
/*!
* nats-broker.cpp
*
* Copyright (c) 2015-2019, NADAL Jean-Baptiste. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
* @Author: NADAL Jean-Baptiste
* @Date: 13/11/2019
*
*/
/*------------------------------- INCLUDES ----------------------------------*/
#include <adapters/libevent.h>
#include "nats-broker.h"
#include <nats.h>
/*! ----------------------------------------------------------------------------
* @fn NatsBroker
*
* @brief Constructor of the Nats Broker.
*/
NatsBroker::NatsBroker(void) : m_conn(NULL), m_opts(NULL), m_sub(NULL)
{
}
/*! ----------------------------------------------------------------------------
* @fn ~NatsBroker
*
* @brief Destructor of the Nats.
*/
NatsBroker::~NatsBroker(void)
{
}
/*! ----------------------------------------------------------------------------
* @fn setup
*
* @brief Setup the Broker.
*/
int NatsBroker::setup(void)
{
natsStatus the_status;
nats_Open(-1);
// One time initialization of things that we need.
natsLibevent_Init();
if (natsOptions_Create(&m_opts) != NATS_OK)
return 0;
}