Commit b76aab18 authored by Mosaical's avatar Mosaical

rm all

parent e91290b1
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
.openapi-generator-ignore
CMakeLists.txt
README.md
api/NFInstanceIDDocumentApi.cpp
api/NFInstanceIDDocumentApi.h
api/NFInstancesStoreApi.cpp
api/NFInstancesStoreApi.h
api/SubscriptionIDDocumentApi.cpp
api/SubscriptionIDDocumentApi.h
api/SubscriptionsCollectionApi.cpp
api/SubscriptionsCollectionApi.h
impl/NFInstanceIDDocumentApiImpl.cpp
impl/NFInstanceIDDocumentApiImpl.h
impl/NFInstancesStoreApiImpl.cpp
impl/NFInstancesStoreApiImpl.h
impl/SubscriptionIDDocumentApiImpl.cpp
impl/SubscriptionIDDocumentApiImpl.h
impl/SubscriptionsCollectionApiImpl.cpp
impl/SubscriptionsCollectionApiImpl.h
main-api-server.cpp
model/AccessType.cpp
model/AccessType.h
model/AfEvent.cpp
model/AfEvent.h
model/AfEventExposureData.cpp
model/AfEventExposureData.h
model/AmfCond.cpp
model/AmfCond.h
model/AmfInfo.cpp
model/AmfInfo.h
model/AnNodeType.cpp
model/AnNodeType.h
model/AtsssCapability.cpp
model/AtsssCapability.h
model/AusfInfo.cpp
model/AusfInfo.h
model/BsfInfo.cpp
model/BsfInfo.h
model/ChangeItem.cpp
model/ChangeItem.h
model/ChangeType.cpp
model/ChangeType.h
model/ChfInfo.cpp
model/ChfInfo.h
model/ChfServiceInfo.cpp
model/ChfServiceInfo.h
model/DataSetId.cpp
model/DataSetId.h
model/DefaultNotificationSubscription.cpp
model/DefaultNotificationSubscription.h
model/DnnSmfInfoItem.cpp
model/DnnSmfInfoItem.h
model/DnnUpfInfoItem.cpp
model/DnnUpfInfoItem.h
model/EventId.cpp
model/EventId.h
model/ExternalClientType.cpp
model/ExternalClientType.h
model/GmlcInfo.cpp
model/GmlcInfo.h
model/Guami.cpp
model/Guami.h
model/GuamiListCond.cpp
model/GuamiListCond.h
model/Helpers.cpp
model/Helpers.h
model/HssInfo.cpp
model/HssInfo.h
model/IdentityRange.cpp
model/IdentityRange.h
model/ImsiRange.cpp
model/ImsiRange.h
model/Inline_response_200.cpp
model/Inline_response_200.h
model/InterfaceUpfInfoItem.cpp
model/InterfaceUpfInfoItem.h
model/InternalGroupIdRange.cpp
model/InternalGroupIdRange.h
model/InvalidParam.cpp
model/InvalidParam.h
model/IpEndPoint.cpp
model/IpEndPoint.h
model/Ipv4AddressRange.cpp
model/Ipv4AddressRange.h
model/Ipv6Addr.cpp
model/Ipv6Addr.h
model/Ipv6Prefix.cpp
model/Ipv6Prefix.h
model/Ipv6PrefixRange.cpp
model/Ipv6PrefixRange.h
model/Link.cpp
model/Link.h
model/LinksValueSchema.cpp
model/LinksValueSchema.h
model/LmfInfo.cpp
model/LmfInfo.h
model/N1MessageClass.cpp
model/N1MessageClass.h
model/N2InformationClass.cpp
model/N2InformationClass.h
model/N2InterfaceAmfInfo.cpp
model/N2InterfaceAmfInfo.h
model/NFProfile.cpp
model/NFProfile.h
model/NFService.cpp
model/NFService.h
model/NFServiceStatus.cpp
model/NFServiceStatus.h
model/NFServiceVersion.cpp
model/NFServiceVersion.h
model/NFStatus.cpp
model/NFStatus.h
model/NFType.cpp
model/NFType.h
model/NefInfo.cpp
model/NefInfo.h
model/NetworkSliceCond.cpp
model/NetworkSliceCond.h
model/NfGroupCond.cpp
model/NfGroupCond.h
model/NfInfo.cpp
model/NfInfo.h
model/NfInstanceIdCond.cpp
model/NfInstanceIdCond.h
model/NfServiceSetCond.cpp
model/NfServiceSetCond.h
model/NfSetCond.cpp
model/NfSetCond.h
model/NfTypeCond.cpp
model/NfTypeCond.h
model/NotifCondition.cpp
model/NotifCondition.h
model/NotificationData.cpp
model/NotificationData.h
model/NotificationEventType.cpp
model/NotificationEventType.h
model/NotificationType.cpp
model/NotificationType.h
model/NrfInfo.cpp
model/NrfInfo.h
model/NwdafEvent.cpp
model/NwdafEvent.h
model/NwdafInfo.cpp
model/NwdafInfo.h
model/PatchItem.cpp
model/PatchItem.h
model/PatchOperation.cpp
model/PatchOperation.h
model/PcfInfo.cpp
model/PcfInfo.h
model/PcscfInfo.cpp
model/PcscfInfo.h
model/PduSessionType.cpp
model/PduSessionType.h
model/PfdData.cpp
model/PfdData.h
model/PlmnId.cpp
model/PlmnId.h
model/PlmnIdNid.cpp
model/PlmnIdNid.h
model/PlmnRange.cpp
model/PlmnRange.h
model/PlmnSnssai.cpp
model/PlmnSnssai.h
model/ProblemDetails.cpp
model/ProblemDetails.h
model/RatType.cpp
model/RatType.h
model/ServiceName.cpp
model/ServiceName.h
model/ServiceNameCond.cpp
model/ServiceNameCond.h
model/SmfInfo.cpp
model/SmfInfo.h
model/Snssai.cpp
model/Snssai.h
model/SnssaiSmfInfoItem.cpp
model/SnssaiSmfInfoItem.h
model/SnssaiUpfInfoItem.cpp
model/SnssaiUpfInfoItem.h
model/SubscriptionData.cpp
model/SubscriptionData.h
model/SupiRange.cpp
model/SupiRange.h
model/TacRange.cpp
model/TacRange.h
model/Tai.cpp
model/Tai.h
model/TaiRange.cpp
model/TaiRange.h
model/TngfInfo.cpp
model/TngfInfo.h
model/TransportProtocol.cpp
model/TransportProtocol.h
model/TwifInfo.cpp
model/TwifInfo.h
model/UPInterfaceType.cpp
model/UPInterfaceType.h
model/UdmInfo.cpp
model/UdmInfo.h
model/UdrInfo.cpp
model/UdrInfo.h
model/UdsfInfo.cpp
model/UdsfInfo.h
model/UpfCond.cpp
model/UpfCond.h
model/UpfInfo.cpp
model/UpfInfo.h
model/UriScheme.cpp
model/UriScheme.h
model/VendorSpecificFeature.cpp
model/VendorSpecificFeature.h
model/WAgfInfo.cpp
model/WAgfInfo.h
5.0.0-SNAPSHOT
\ No newline at end of file
cmake_minimum_required (VERSION 3.2)
project(api-server)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -pg -g3" )
include(ExternalProject)
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external)
#ExternalProject_Add(PISTACHE
# GIT_REPOSITORY https://github.com/oktal/pistache.git
# CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
#)
#ExternalProject_Add(NLOHMANN
# GIT_REPOSITORY https://github.com/nlohmann/json.git
# CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
#)
#include_directories(/usr/local/include)
include_directories(zookeeper-3.4.5)
link_directories(lib)
link_directories(json-include/json)
include_directories(model)
include_directories(api)
include_directories(impl)
include_directories(zkH)
include_directories(json)
include_directories(nlohmann)
include_directories(/usr/local/include/librdkafka)
#include_directories(json-include/json)
#link_libraries(/home/root/nrf2/lib/lib_json.lib)
add_subdirectory(json-include)
file(GLOB SRCS
${CMAKE_CURRENT_SOURCE_DIR}/api/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/model/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/zkH/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
add_executable(${PROJECT_NAME} ${SRCS} )
#add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN)
target_link_libraries(${PROJECT_NAME} pistache zookeeper_mt jsoncpp rdkafka pthread)
This diff is collapsed.
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* NFInstanceIDDocumentApi.h
*
*
*/
#ifndef NFInstanceIDDocumentApi_H_
#define NFInstanceIDDocumentApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "NFProfile.h"
#include "PatchItem.h"
#include "ProblemDetails.h"
#include <string>
#include <vector>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class NFInstanceIDDocumentApi {
public:
NFInstanceIDDocumentApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~NFInstanceIDDocumentApi() {}
void init();
const std::string base = "/nnrf-nfm/v1";
private:
void setupRoutes();
void deregister_nf_instance_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void get_nf_instance_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void register_nf_instance_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void update_nf_instance_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void nf_instance_id_document_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Deregisters a given NF Instance
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="nfInstanceID">Unique ID of the NF Instance to deregister</param>
virtual void deregister_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Read the profile of a given NF Instance
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="nfInstanceID">Unique ID of the NF Instance</param>
virtual void get_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Register a new NF Instance
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="nfInstanceID">Unique ID of the NF Instance to register</param>
/// <param name="nFProfile"></param>
/// <param name="contentEncoding">Content-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
/// <param name="acceptEncoding">Accept-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
virtual void register_nf_instance(const std::string &nfInstanceID, const NFProfile &nFProfile, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response, nlohmann::json &j0, std::string URI) = 0;
/// <summary>
/// Update NF Instance profile
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="nfInstanceID">Unique ID of the NF Instance to update</param>
/// <param name="patchItem"></param>
/// <param name="contentEncoding">Content-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
/// <param name="acceptEncoding">Accept-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
virtual void update_nf_instance(const std::string &nfInstanceID, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response, nlohmann::json &j0) = 0;
};
}
}
}
}
#endif /* NFInstanceIDDocumentApi_H_ */
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "NFInstancesStoreApi.h"
#include "Helpers.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace org::openapitools::server::model;
NFInstancesStoreApi::NFInstancesStoreApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void NFInstancesStoreApi::init() {
setupRoutes();
}
void NFInstancesStoreApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/nf-instances", Routes::bind(&NFInstancesStoreApi::get_nf_instances_handler, this));
Routes::Options(*router, base + "/nf-instances", Routes::bind(&NFInstancesStoreApi::options_nf_instances_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&NFInstancesStoreApi::nf_instances_store_api_default_handler, this));
}
void NFInstancesStoreApi::get_nf_instances_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the query params
auto nfTypeQuery = request.query().get("nf-type");
Pistache::Optional<NFType> nfType;
if(!nfTypeQuery.isEmpty()){
/*
NFType valueQuery_instance;
if(fromStringValue(nfTypeQuery.get(), valueQuery_instance)){
nfType = Pistache::Some(valueQuery_instance);
}
*/
}
auto limitQuery = request.query().get("limit");
Pistache::Optional<int32_t> limit;
if(!limitQuery.isEmpty()){
int32_t valueQuery_instance;
/*
if(fromStringValue(limitQuery.get(), valueQuery_instance)){
limit = Pistache::Some(valueQuery_instance);
}
*/
}
try {
this->get_nf_instances(nfType, limit, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void NFInstancesStoreApi::options_nf_instances_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
try {
this->options_nf_instances(response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void NFInstancesStoreApi::nf_instances_store_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* NFInstancesStoreApi.h
*
*
*/
#ifndef NFInstancesStoreApi_H_
#define NFInstancesStoreApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "Inline_response_200.h"
#include "NFType.h"
#include "ProblemDetails.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class NFInstancesStoreApi {
public:
NFInstancesStoreApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~NFInstancesStoreApi() {}
void init();
const std::string base = "/nnrf-nfm/v1";
private:
void setupRoutes();
void get_nf_instances_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void options_nf_instances_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void nf_instances_store_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Retrieves a collection of NF Instances
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="nfType">Type of NF (optional, default to NFType())</param>
/// <param name="limit">How many items to return at one time (optional, default to 0)</param>
virtual void get_nf_instances(const Pistache::Optional<NFType> &nfType, const Pistache::Optional<int32_t> &limit, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Discover communication options supported by NRF for NF Instances
/// </summary>
/// <remarks>
///
/// </remarks>
virtual void options_nf_instances(Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
}
#endif /* NFInstancesStoreApi_H_ */
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SubscriptionIDDocumentApi.h"
#include "Helpers.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace org::openapitools::server::model;
SubscriptionIDDocumentApi::SubscriptionIDDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionIDDocumentApi::init() {
setupRoutes();
}
void SubscriptionIDDocumentApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Delete(*router, base + "/subscriptions/:subscriptionID", Routes::bind(&SubscriptionIDDocumentApi::remove_subscription_handler, this));
Routes::Patch(*router, base + "/subscriptions/:subscriptionID", Routes::bind(&SubscriptionIDDocumentApi::update_subscription_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionIDDocumentApi::subscription_id_document_api_default_handler, this));
}
void SubscriptionIDDocumentApi::remove_subscription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto subscriptionID = request.param(":subscriptionID").as<std::string>();
try {
this->remove_subscription(subscriptionID, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void SubscriptionIDDocumentApi::update_subscription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto subscriptionID = request.param(":subscriptionID").as<std::string>();
// Getting the body param
std::vector<PatchItem> patchItem;
// Getting the header params
auto contentEncoding = request.headers().tryGetRaw("Content-Encoding");
auto acceptEncoding = request.headers().tryGetRaw("Accept-Encoding");
try {
nlohmann::json::parse(request.body()).get_to(patchItem);
this->update_subscription(subscriptionID, patchItem, contentEncoding, acceptEncoding, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void SubscriptionIDDocumentApi::subscription_id_document_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SubscriptionIDDocumentApi.h
*
*
*/
#ifndef SubscriptionIDDocumentApi_H_
#define SubscriptionIDDocumentApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "PatchItem.h"
#include "ProblemDetails.h"
#include "SubscriptionData.h"
#include <string>
#include <vector>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class SubscriptionIDDocumentApi {
public:
SubscriptionIDDocumentApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionIDDocumentApi() {}
void init();
const std::string base = "/nnrf-nfm/v1";
private:
void setupRoutes();
void remove_subscription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void update_subscription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscription_id_document_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Deletes a subscription
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionID">Unique ID of the subscription to remove</param>
virtual void remove_subscription(const std::string &subscriptionID, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// Updates a subscription
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionID">Unique ID of the subscription to update</param>
/// <param name="patchItem"></param>
/// <param name="contentEncoding">Content-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
/// <param name="acceptEncoding">Accept-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
virtual void update_subscription(const std::string &subscriptionID, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
}
#endif /* SubscriptionIDDocumentApi_H_ */
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SubscriptionsCollectionApi.h"
#include "Helpers.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace org::openapitools::server::model;
SubscriptionsCollectionApi::SubscriptionsCollectionApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionsCollectionApi::init() {
setupRoutes();
}
void SubscriptionsCollectionApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Post(*router, base + "/subscriptions", Routes::bind(&SubscriptionsCollectionApi::create_subscription_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionsCollectionApi::subscriptions_collection_api_default_handler, this));
}
void SubscriptionsCollectionApi::create_subscription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
SubscriptionData subscriptionData;
std::cout << "SubscriptionsCollectionApi::create_subscription_handler已启动!" << std::endl;
//nlohmann::json::parse(request.body()).get_to(subscriptionData);
std::string requestBodyString = request.body().c_str();
nlohmann::json::parse(requestBodyString).get_to(subscriptionData);//无用行
nlohmann::json jSubscriptionData;
jSubscriptionData = nlohmann::json::parse(requestBodyString);
std::cout << "jSubscriptionData is : " << jSubscriptionData << std::endl;
// Getting the header params
auto contentEncoding = request.headers().tryGetRaw("Content-Encoding");
auto acceptEncoding = request.headers().tryGetRaw("Accept-Encoding");
try {
nlohmann::json::parse(request.body()).get_to(subscriptionData);
this->create_subscription(subscriptionData, contentEncoding, acceptEncoding, response, jSubscriptionData/*额外加入一个*/);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void SubscriptionsCollectionApi::subscriptions_collection_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SubscriptionsCollectionApi.h
*
*
*/
#ifndef SubscriptionsCollectionApi_H_
#define SubscriptionsCollectionApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "SubscriptionData.h"
#include <string>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class SubscriptionsCollectionApi {
public:
SubscriptionsCollectionApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionsCollectionApi() {}
void init();
const std::string base = "/nnrf-nfm/v1";
private:
void setupRoutes();
void create_subscription_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscriptions_collection_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Create a new subscription
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionData"></param>
/// <param name="contentEncoding">Content-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
/// <param name="acceptEncoding">Accept-Encoding, described in IETF RFC 7231 (optional, default to &quot;&quot;)</param>
virtual void create_subscription(const SubscriptionData &subscriptionData, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response, nlohmann::json &jSubscriptionData) = 0;
};
}
}
}
}
#endif /* SubscriptionsCollectionApi_H_ */
This diff is collapsed.
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* NFInstanceIDDocumentApiImpl.h
*
*
*/
#ifndef NF_INSTANCE_ID_DOCUMENT_API_IMPL_H_
#define NF_INSTANCE_ID_DOCUMENT_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <NFInstanceIDDocumentApi.h>
#include <pistache/optional.h>
#include "NFProfile.h"
#include "PatchItem.h"
#include "ProblemDetails.h"
#include <string>
#include <vector>
#include <pthread.h>
#include <iostream>
#include <fstream>
#include <iomanip>
#include "myNotify.h"
#include "get2rdNodeMessage.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class NFInstanceIDDocumentApiImpl : public org::openapitools::server::api::NFInstanceIDDocumentApi {
public:
NFInstanceIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>);
~NFInstanceIDDocumentApiImpl() {}
void deregister_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response);
void get_nf_instance(const std::string &nfInstanceID, Pistache::Http::ResponseWriter &response);
void register_nf_instance(const std::string &nfInstanceID, const NFProfile &nFProfile, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response, nlohmann::json &j0, std::string URI);
static void* print_message( void* data )
{
//pthread_detach(pthread_self());
//pthread_detach(pthread_self()),将状态改为unjoinable状态,确保资源的释放
//static int g;
//int flag = 0;
//while(flag < 20){
// flag++;
// printf("%d\n", g++);
// sleep(100);
// }
// pthread_exit(0) ;//pthread_exit时自动会被释放
int flag = 1;
std::string dataString = *((std::string*)data);
std::cout << "data is :" << *((std::string*)data) <<std::endl;//(已成功取出)
std::string heartBeatString;
zookeeperClient zooK;
bool atest = zooK.connect2ZKServer("192.168.211.128:2181");
utility::zk_cpp* zk;
zk = zooK.getZk();
std::string path = "/HeartBeat";
while (1)
{
utility::zoo_rc ret = zk->get_node(path.c_str(), heartBeatString, nullptr, true);
//get2rdNodeMessage *Get2rdNodeMessage = new get2rdNodeMessage;
//std::string path = "/HeartBeat";
//std::string heartBeatString = Get2rdNodeMessage->getNodeMessage(path);
//free(Get2rdNodeMessage);
if(heartBeatString == dataString){
//将心跳zookeeper归零
std::cout << "进入归零程序!" << std::endl;
zookeeperClient zooK;
bool atest = zooK.connect2ZKServer("192.168.211.128:2181");
utility::zk_cpp* zk;
zk = zooK.getZk();//连接zookeeper完毕
std::string heartBeatPath = "/HeartBeat";
std::string value = "";
utility::zoo_rc setSubscribeURI = zk->set_node(heartBeatPath.c_str(), value, -1);
//delete zooK;
free(zk);
flag = 0;
usleep(100 * 1000);
printf("thread1 running...!\n");
}else{
usleep(100 * 1000);
printf("thread1 running...!\n");
flag++;
if(flag>=60) break;
}
}
//标记sus
get2rdNodeMessage *Get2rdNodeMessage2 = new get2rdNodeMessage;
//心跳停止的nf的注册节点地址
std::cout << "心跳已停止" << std::endl;
std::string fullPath = Get2rdNodeMessage2->getFullPath(dataString);
//std::cout << "full Path is : " << fullPath << std::endl;成功取出type+ID的节点地址
free(Get2rdNodeMessage2);
//连接zookeeper
//zookeeperClient zooK;
//bool atest = zooK.connect2ZKServer("192.168.211.128:2181");
//utility::zk_cpp* zk;
//zk = zooK.getZk();//连接zookeeper完毕
//std::string stopHeartValue;//取出停止心跳的实例的profile
//utility::zoo_rc ret = zk->get_node(fullPath.c_str(), stopHeartValue, nullptr, true);
//std::cout << "停止心跳的profile" << stopHeartValue << std::endl;
//通过profile.json更改nfstatus
std::string fileName = dataString + ".json";
std::ifstream readProfile(fileName);
nlohmann::json thisProfileJson;
readProfile>> thisProfileJson;
//std::cout << "profile is :" << thisProfileJson << std::endl;
thisProfileJson["nfStatus"] = "SUSPENDED";
std::ofstream myfile(fileName);
//std::string thisProfileString = thisProfileJson.dump();
myfile << std::setw(75) << thisProfileJson << std::endl;
//通知订阅者
printf("Leave thread1!\n");
return NULL;
}
void update_nf_instance(const std::string &nfInstanceID, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response, nlohmann::json &j0);
};
}
}
}
}
#endif
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "NFInstancesStoreApiImpl.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
NFInstancesStoreApiImpl::NFInstancesStoreApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr)
: NFInstancesStoreApi(rtr)
{ }
void NFInstancesStoreApiImpl::get_nf_instances(const Pistache::Optional<NFType> &nfType, const Pistache::Optional<int32_t> &limit, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void NFInstancesStoreApiImpl::options_nf_instances(Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* NFInstancesStoreApiImpl.h
*
*
*/
#ifndef NF_INSTANCES_STORE_API_IMPL_H_
#define NF_INSTANCES_STORE_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <NFInstancesStoreApi.h>
#include <pistache/optional.h>
#include "Inline_response_200.h"
#include "NFType.h"
#include "ProblemDetails.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class NFInstancesStoreApiImpl : public org::openapitools::server::api::NFInstancesStoreApi {
public:
NFInstancesStoreApiImpl(std::shared_ptr<Pistache::Rest::Router>);
~NFInstancesStoreApiImpl() {}
void get_nf_instances(const Pistache::Optional<NFType> &nfType, const Pistache::Optional<int32_t> &limit, Pistache::Http::ResponseWriter &response);
void options_nf_instances(Pistache::Http::ResponseWriter &response);
};
}
}
}
}
#endif
\ No newline at end of file
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SubscriptionIDDocumentApiImpl.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
SubscriptionIDDocumentApiImpl::SubscriptionIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr)
: SubscriptionIDDocumentApi(rtr)
{ }
void SubscriptionIDDocumentApiImpl::remove_subscription(const std::string &subscriptionID, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
void SubscriptionIDDocumentApiImpl::update_subscription(const std::string &subscriptionID, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SubscriptionIDDocumentApiImpl.h
*
*
*/
#ifndef SUBSCRIPTION_ID_DOCUMENT_API_IMPL_H_
#define SUBSCRIPTION_ID_DOCUMENT_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <SubscriptionIDDocumentApi.h>
#include <pistache/optional.h>
#include "PatchItem.h"
#include "ProblemDetails.h"
#include "SubscriptionData.h"
#include <string>
#include <vector>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class SubscriptionIDDocumentApiImpl : public org::openapitools::server::api::SubscriptionIDDocumentApi {
public:
SubscriptionIDDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>);
~SubscriptionIDDocumentApiImpl() {}
void remove_subscription(const std::string &subscriptionID, Pistache::Http::ResponseWriter &response);
void update_subscription(const std::string &subscriptionID, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response);
};
}
}
}
}
#endif
\ No newline at end of file
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SubscriptionsCollectionApiImpl.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
SubscriptionsCollectionApiImpl::SubscriptionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr)
: SubscriptionsCollectionApi(rtr)
{ }
void SubscriptionsCollectionApiImpl::create_subscription(const SubscriptionData &subscriptionData, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response, nlohmann::json &jSubscriptionData) {
nlohmann::json subscriptionDataJson = jSubscriptionData;
std::cout << "进来的json为 : " << subscriptionDataJson << std::endl;
/*下面对json信息进行处理*/
//取出返回URI
std::string nfStatusNotificationUriString = subscriptionDataJson.at("nfStatusNotificationUri").dump();
nfStatusNotificationUriString.erase(remove(nfStatusNotificationUriString.begin(), nfStatusNotificationUriString.end(), '\"'), nfStatusNotificationUriString.end());//删掉了前后的引号
std::cout << "nfStatusNotificationUriString is : " << nfStatusNotificationUriString << std::endl;
//首先是查看订阅了什么
if(subscriptionDataJson.contains("NfInstanceIdCond")){
//订阅单个NF
std::string NfInstanceId = subscriptionDataJson.at("NfInstanceIdCond").dump();
NfInstanceId.erase(remove(NfInstanceId.begin(), NfInstanceId.end(), '\"'), NfInstanceId.end());//删掉了前后的引号
subscribeNode *SubscribeNode = new subscribeNode;
//getChildPath *GetChildPath = new getChildPath;
std::string childFullPath = SubscribeNode->getFullPath(NfInstanceId);
std::cout << "ChildFullPath is :" << childFullPath << std::endl;
//free(GetChildPath);
//从之前获得的路径获取subscribe下的订阅信息
//subscribeNode *SubscribeNode = new subscribeNode;
bool setSubFlag = SubscribeNode->setSubscribeURI(nfStatusNotificationUriString , childFullPath);//输入的childFullPath并不包含一级节点Subscribe
free(SubscribeNode);
}
else if(subscriptionDataJson.contains("NfTypeCond")){
//订阅了一个type
}
else if(subscriptionDataJson.contains("ServiceNameCond")){
//订阅了一种serviceName
}
else if(subscriptionDataJson.contains("AmfCond")){
//订阅了某个AMF集或某AMF区域的一组NF实例
}
else if(subscriptionDataJson.contains("GuamiListCond")){
//订阅了由Guamis确定的一组NF实例
}
else if (subscriptionDataJson.contains("NetworkSliceCond")){
//订阅了由S-NSSAI和NSIID标识的一组NF实例
}
else if(subscriptionDataJson.contains("NfGroupCond")){
//订阅了由NF组标标识的一组NF实例
}
else{
//订阅全部NF
}
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SubscriptionsCollectionApiImpl.h
*
*
*/
#ifndef SUBSCRIPTIONS_COLLECTION_API_IMPL_H_
#define SUBSCRIPTIONS_COLLECTION_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <SubscriptionsCollectionApi.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "SubscriptionData.h"
#include <string>
//#include "getChildPath.h"
#include "subscribeNode.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class SubscriptionsCollectionApiImpl : public org::openapitools::server::api::SubscriptionsCollectionApi {
public:
SubscriptionsCollectionApiImpl(std::shared_ptr<Pistache::Rest::Router>);
~SubscriptionsCollectionApiImpl() {}
void create_subscription(const SubscriptionData &subscriptionData, const Pistache::Optional<Pistache::Http::Header::Raw> &contentEncoding, const Pistache::Optional<Pistache::Http::Header::Raw> &acceptEncoding, Pistache::Http::ResponseWriter &response, nlohmann::json &jSubscriptionData);
};
}
}
}
}
#endif
json @ 5ba0f65c
Subproject commit 5ba0f65c34832aa18fb2b582d58a0c1f92c93bfb
FILE(GLOB INCLUDE_FILES "json/*.h")
INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/json)
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef CPPTL_JSON_ALLOCATOR_H_INCLUDED
#define CPPTL_JSON_ALLOCATOR_H_INCLUDED
#include <cstring>
#include <memory>
#pragma pack(push, 8)
namespace Json {
template <typename T> class SecureAllocator {
public:
// Type definitions
using value_type = T;
using pointer = T*;
using const_pointer = const T*;
using reference = T&;
using const_reference = const T&;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
/**
* Allocate memory for N items using the standard allocator.
*/
pointer allocate(size_type n) {
// allocate using "global operator new"
return static_cast<pointer>(::operator new(n * sizeof(T)));
}
/**
* Release memory which was allocated for N items at pointer P.
*
* The memory block is filled with zeroes before being released.
* The pointer argument is tagged as "volatile" to prevent the
* compiler optimizing out this critical step.
*/
void deallocate(volatile pointer p, size_type n) {
std::memset(p, 0, n * sizeof(T));
// free using "global operator delete"
::operator delete(p);
}
/**
* Construct an item in-place at pointer P.
*/
template <typename... Args> void construct(pointer p, Args&&... args) {
// construct using "placement new" and "perfect forwarding"
::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
}
size_type max_size() const { return size_t(-1) / sizeof(T); }
pointer address(reference x) const { return std::addressof(x); }
const_pointer address(const_reference x) const { return std::addressof(x); }
/**
* Destroy an item in-place at pointer P.
*/
void destroy(pointer p) {
// destroy using "explicit destructor"
p->~T();
}
// Boilerplate
SecureAllocator() {}
template <typename U> SecureAllocator(const SecureAllocator<U>&) {}
template <typename U> struct rebind { using other = SecureAllocator<U>; };
};
template <typename T, typename U>
bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
return true;
}
template <typename T, typename U>
bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
return false;
}
} // namespace Json
#pragma pack(pop)
#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
#include <sstream>
#include <stdlib.h>
#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
/** It should not be possible for a maliciously designed file to
* cause an abort() or seg-fault, so these macros are used only
* for pre-condition violations and internal logic errors.
*/
#if JSON_USE_EXCEPTION
// @todo <= add detail about condition in exception
#define JSON_ASSERT(condition) \
{ \
if (!(condition)) { \
Json::throwLogicError("assert json failed"); \
} \
}
#define JSON_FAIL_MESSAGE(message) \
{ \
JSONCPP_OSTRINGSTREAM oss; \
oss << message; \
Json::throwLogicError(oss.str()); \
abort(); \
}
#else // JSON_USE_EXCEPTION
#define JSON_ASSERT(condition) assert(condition)
// The call to assert() will show the failure message in debug builds. In
// release builds we abort, for a core-dump or debugger.
#define JSON_FAIL_MESSAGE(message) \
{ \
JSONCPP_OSTRINGSTREAM oss; \
oss << message; \
assert(false && oss.str().c_str()); \
abort(); \
}
#endif
#define JSON_ASSERT_MESSAGE(condition, message) \
if (!(condition)) { \
JSON_FAIL_MESSAGE(message); \
}
#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef JSON_AUTOLINK_H_INCLUDED
#define JSON_AUTOLINK_H_INCLUDED
#include "config.h"
#ifdef JSON_IN_CPPTL
#include <cpptl/cpptl_autolink.h>
#endif
#if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \
!defined(JSON_IN_CPPTL)
#define CPPTL_AUTOLINK_NAME "json"
#undef CPPTL_AUTOLINK_DLL
#ifdef JSON_DLL
#define CPPTL_AUTOLINK_DLL
#endif
#include "autolink.h"
#endif
#endif // JSON_AUTOLINK_H_INCLUDED
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef JSON_CONFIG_H_INCLUDED
#define JSON_CONFIG_H_INCLUDED
#include <stddef.h>
#include <stdint.h> //typedef int64_t, uint64_t
#include <string> //typedef String
/// If defined, indicates that json library is embedded in CppTL library.
//# define JSON_IN_CPPTL 1
/// If defined, indicates that json may leverage CppTL library
//# define JSON_USE_CPPTL 1
/// If defined, indicates that cpptl vector based map should be used instead of
/// std::map
/// as Value container.
//# define JSON_USE_CPPTL_SMALLMAP 1
// If non-zero, the library uses exceptions to report bad input instead of C
// assertion macros. The default is to use exceptions.
#ifndef JSON_USE_EXCEPTION
#define JSON_USE_EXCEPTION 1
#endif
/// If defined, indicates that the source file is amalgamated
/// to prevent private header inclusion.
/// Remarks: it is automatically defined in the generated amalgamated header.
// #define JSON_IS_AMALGAMATION
#ifdef JSON_IN_CPPTL
#include <cpptl/config.h>
#ifndef JSON_USE_CPPTL
#define JSON_USE_CPPTL 1
#endif
#endif
#ifdef JSON_IN_CPPTL
#define JSON_API CPPTL_API
#elif defined(JSON_DLL_BUILD)
#if defined(_MSC_VER) || defined(__MINGW32__)
#define JSON_API __declspec(dllexport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#endif // if defined(_MSC_VER)
#elif defined(JSON_DLL)
#if defined(_MSC_VER) || defined(__MINGW32__)
#define JSON_API __declspec(dllimport)
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
#endif // if defined(_MSC_VER)
#endif // ifdef JSON_IN_CPPTL
#if !defined(JSON_API)
#define JSON_API
#endif
// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
// integer
// Storages, and 64 bits integer support is disabled.
// #define JSON_NO_INT64 1
#if defined(_MSC_VER) // MSVC
#if _MSC_VER <= 1200 // MSVC 6
// Microsoft Visual Studio 6 only support conversion from __int64 to double
// (no conversion from unsigned __int64).
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
// characters in the debug information)
// All projects I've ever seen with VS6 were using this globally (not bothering
// with pragma push/pop).
#pragma warning(disable : 4786)
#endif // MSVC 6
#if _MSC_VER >= 1500 // MSVC 2008
/// Indicates that the following function is deprecated.
#define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
#endif
#endif // defined(_MSC_VER)
// In c++11 the override keyword allows you to explicitly define that a function
// is intended to override the base-class version. This makes the code more
// manageable and fixes a set of common hard-to-find bugs.
#if __cplusplus >= 201103L
#define JSONCPP_OVERRIDE override
#define JSONCPP_NOEXCEPT noexcept
#define JSONCPP_OP_EXPLICIT explicit
#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
#define JSONCPP_OVERRIDE override
#define JSONCPP_NOEXCEPT throw()
#if _MSC_VER >= 1800 // MSVC 2013
#define JSONCPP_OP_EXPLICIT explicit
#else
#define JSONCPP_OP_EXPLICIT
#endif
#elif defined(_MSC_VER) && _MSC_VER >= 1900
#define JSONCPP_OVERRIDE override
#define JSONCPP_NOEXCEPT noexcept
#define JSONCPP_OP_EXPLICIT explicit
#else
#define JSONCPP_OVERRIDE
#define JSONCPP_NOEXCEPT throw()
#define JSONCPP_OP_EXPLICIT
#endif
#ifndef JSON_HAS_RVALUE_REFERENCES
#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
#define JSON_HAS_RVALUE_REFERENCES 1
#endif // MSVC >= 2010
#ifdef __clang__
#if __has_feature(cxx_rvalue_references)
#define JSON_HAS_RVALUE_REFERENCES 1
#endif // has_feature
#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
#define JSON_HAS_RVALUE_REFERENCES 1
#endif // GXX_EXPERIMENTAL
#endif // __clang__ || __GNUC__
#endif // not defined JSON_HAS_RVALUE_REFERENCES
#ifndef JSON_HAS_RVALUE_REFERENCES
#define JSON_HAS_RVALUE_REFERENCES 0
#endif
#ifdef __clang__
#if __has_extension(attribute_deprecated_with_message)
#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
#endif
#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
#define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
#elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
#define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
#endif // GNUC version
#endif // __clang__ || __GNUC__
#if !defined(JSONCPP_DEPRECATED)
#define JSONCPP_DEPRECATED(message)
#endif // if !defined(JSONCPP_DEPRECATED)
#if __GNUC__ >= 6
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
#endif
#if !defined(JSON_IS_AMALGAMATION)
#include "version.h"
#if JSONCPP_USING_SECURE_MEMORY
#include "allocator.h" //typedef Allocator
#endif
#endif // if !defined(JSON_IS_AMALGAMATION)
namespace Json {
typedef int Int;
typedef unsigned int UInt;
#if defined(JSON_NO_INT64)
typedef int LargestInt;
typedef unsigned int LargestUInt;
#undef JSON_HAS_INT64
#else // if defined(JSON_NO_INT64)
// For Microsoft Visual use specific types as long long is not supported
#if defined(_MSC_VER) // Microsoft Visual Studio
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
#else // if defined(_MSC_VER) // Other platforms, use long long
typedef int64_t Int64;
typedef uint64_t UInt64;
#endif // if defined(_MSC_VER)
typedef Int64 LargestInt;
typedef UInt64 LargestUInt;
#define JSON_HAS_INT64
#endif // if defined(JSON_NO_INT64)
#if JSONCPP_USING_SECURE_MEMORY
#define JSONCPP_STRING \
std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >
#define JSONCPP_OSTRINGSTREAM \
std::basic_ostringstream<char, std::char_traits<char>, \
Json::SecureAllocator<char> >
#define JSONCPP_OSTREAM std::basic_ostream<char, std::char_traits<char> >
#define JSONCPP_ISTRINGSTREAM \
std::basic_istringstream<char, std::char_traits<char>, \
Json::SecureAllocator<char> >
#define JSONCPP_ISTREAM std::istream
#else
#define JSONCPP_STRING std::string
#define JSONCPP_OSTRINGSTREAM std::ostringstream
#define JSONCPP_OSTREAM std::ostream
#define JSONCPP_ISTRINGSTREAM std::istringstream
#define JSONCPP_ISTREAM std::istream
#endif // if JSONCPP_USING_SECURE_MEMORY
} // end namespace Json
#endif // JSON_CONFIG_H_INCLUDED
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
#define CPPTL_JSON_FEATURES_H_INCLUDED
#if !defined(JSON_IS_AMALGAMATION)
#include "forwards.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
#pragma pack(push, 8)
namespace Json {
/** \brief Configuration passed to reader and writer.
* This configuration object can be used to force the Reader or Writer
* to behave in a standard conforming way.
*/
class JSON_API Features {
public:
/** \brief A configuration that allows all features and assumes all strings
* are UTF-8.
* - C & C++ comments are allowed
* - Root object can be any JSON value
* - Assumes Value strings are encoded in UTF-8
*/
static Features all();
/** \brief A configuration that is strictly compatible with the JSON
* specification.
* - Comments are forbidden.
* - Root object must be either an array or an object value.
* - Assumes Value strings are encoded in UTF-8
*/
static Features strictMode();
/** \brief Initialize the configuration like JsonConfig::allFeatures;
*/
Features();
/// \c true if comments are allowed. Default: \c true.
bool allowComments_;
/// \c true if root must be either an array or an object value. Default: \c
/// false.
bool strictRoot_;
/// \c true if dropped null placeholders are allowed. Default: \c false.
bool allowDroppedNullPlaceholders_;
/// \c true if numeric object key are allowed. Default: \c false.
bool allowNumericKeys_;
};
} // namespace Json
#pragma pack(pop)
#endif // CPPTL_JSON_FEATURES_H_INCLUDED
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef JSON_FORWARDS_H_INCLUDED
#define JSON_FORWARDS_H_INCLUDED
#if !defined(JSON_IS_AMALGAMATION)
#include "config.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
namespace Json {
// writer.h
class FastWriter;
class StyledWriter;
// reader.h
class Reader;
// features.h
class Features;
// value.h
typedef unsigned int ArrayIndex;
class StaticString;
class Path;
class PathArgument;
class Value;
class ValueIteratorBase;
class ValueIterator;
class ValueConstIterator;
} // namespace Json
#endif // JSON_FORWARDS_H_INCLUDED
// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef JSON_JSON_H_INCLUDED
#define JSON_JSON_H_INCLUDED
#include "autolink.h"
#include "features.h"
#include "reader.h"
#include "value.h"
#include "writer.h"
#endif // JSON_JSON_H_INCLUDED
This diff is collapsed.
This diff is collapsed.
// DO NOT EDIT. This file (and "version") is generated by CMake.
// Run CMake configure step to update it.
#ifndef JSON_VERSION_H_INCLUDED
#define JSON_VERSION_H_INCLUDED
#define JSONCPP_VERSION_STRING "1.8.4"
#define JSONCPP_VERSION_MAJOR 1
#define JSONCPP_VERSION_MINOR 8
#define JSONCPP_VERSION_PATCH 4
#define JSONCPP_VERSION_QUALIFIER
#define JSONCPP_VERSION_HEXA \
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
(JSONCPP_VERSION_PATCH << 8))
#ifdef JSONCPP_USING_SECURE_MEMORY
#undef JSONCPP_USING_SECURE_MEMORY
#endif
#define JSONCPP_USING_SECURE_MEMORY 0
// If non-zero, the library zeroes any memory that it has allocated before
// it frees its memory.
#endif // JSON_VERSION_H_INCLUDED
This diff is collapsed.
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was PistacheConfig.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
set_and_check ( Pistache_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include")
include_directories(${Pistache_INCLUDE_DIRS})
set_and_check ( Pistache_LIBRARIES "${PACKAGE_PREFIX_DIR}/lib")
link_directories(${Pistache_LIBRARIES})
include("${CMAKE_CURRENT_LIST_DIR}/PistacheTargets.cmake")
#----------------------------------------------------------------
# Generated CMake target import file for configuration "Release".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "pistache_static" for configuration "Release"
set_property(TARGET pistache_static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(pistache_static PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libpistache.a"
)
list(APPEND _IMPORT_CHECK_TARGETS pistache_static )
list(APPEND _IMPORT_CHECK_FILES_FOR_pistache_static "${_IMPORT_PREFIX}/lib/libpistache.a" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
message(FATAL_ERROR "CMake >= 2.6.0 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.6)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_targetsDefined)
set(_targetsNotDefined)
set(_expectedTargets)
foreach(_expectedTarget pistache_static)
list(APPEND _expectedTargets ${_expectedTarget})
if(NOT TARGET ${_expectedTarget})
list(APPEND _targetsNotDefined ${_expectedTarget})
endif()
if(TARGET ${_expectedTarget})
list(APPEND _targetsDefined ${_expectedTarget})
endif()
endforeach()
if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT "${_targetsDefined}" STREQUAL "")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
endif()
unset(_targetsDefined)
unset(_targetsNotDefined)
unset(_expectedTargets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target pistache_static
add_library(pistache_static STATIC IMPORTED)
set_target_properties(pistache_static PROPERTIES
INTERFACE_LINK_LIBRARIES "-latomic;Threads::Threads"
)
# Load information for each installed configuration.
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_DIR}/PistacheTargets-*.cmake")
foreach(f ${CONFIG_FILES})
include(${f})
endforeach()
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(target ${_IMPORT_CHECK_TARGETS} )
foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
if(NOT EXISTS "${file}" )
message(FATAL_ERROR "The imported target \"${target}\" references the file
\"${file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
unset(_IMPORT_CHECK_FILES_FOR_${target})
endforeach()
unset(_IMPORT_CHECK_TARGETS)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
libpistache.so.0
\ No newline at end of file
libpistache.so.0.0.002-git20200301
\ No newline at end of file
librdkafka++.so.1
\ No newline at end of file
librdkafka.so.1
\ No newline at end of file
# libzookeeper_mt.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libzookeeper_mt.so.2'
# Names of this library.
library_names='libzookeeper_mt.so.2.0.0 libzookeeper_mt.so.2 libzookeeper_mt.so'
# The name of the static archive.
old_library='libzookeeper_mt.a'
# Libraries that this one depends upon.
dependency_libs=' -lm -lpthread'
# Version information for libzookeeper_mt.
current=2
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
libzookeeper_mt.so.2.0.0
\ No newline at end of file
libzookeeper_mt.so.2.0.0
\ No newline at end of file
# libzookeeper_st.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libzookeeper_st.so.2'
# Names of this library.
library_names='libzookeeper_st.so.2.0.0 libzookeeper_st.so.2 libzookeeper_st.so'
# The name of the static archive.
old_library='libzookeeper_st.a'
# Libraries that this one depends upon.
dependency_libs=' -lm'
# Version information for libzookeeper_st.
current=2
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'
libzookeeper_st.so.2.0.0
\ No newline at end of file
libzookeeper_st.so.2.0.0
\ No newline at end of file
prefix=/usr/local
exec_prefix=/usr/local/bin
libdir=/usr/local/lib/
includedir=/usr/local/include/
Name: libpistache
URL: http://pistache.io/
Description: An elegant C++ REST framework.
Version: 0.0.002-git20200301
Requires:
Libs: -L'${libdir}/' -lpistache -lpthread -latomic
Libs.private:
Cflags: -I'${includedir}/'
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "pistache/endpoint.h"
#include "pistache/http.h"
#include "pistache/router.h"
#ifdef __linux__
#include <vector>
#include <signal.h>
#include <unistd.h>
#endif
#include "NFInstanceIDDocumentApiImpl.h"
#include "NFInstancesStoreApiImpl.h"
#include "SubscriptionIDDocumentApiImpl.h"
#include "SubscriptionsCollectionApiImpl.h"
#define PISTACHE_SERVER_THREADS 2
#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768
#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768
static Pistache::Http::Endpoint *httpEndpoint;
#ifdef __linux__
static void sigHandler [[noreturn]] (int sig){
switch(sig){
case SIGINT:
case SIGQUIT:
case SIGTERM:
case SIGHUP:
default:
httpEndpoint->shutdown();
break;
}
exit(0);
}
static void setUpUnixSignals(std::vector<int> quitSignals) {
sigset_t blocking_mask;
sigemptyset(&blocking_mask);
for (auto sig : quitSignals)
sigaddset(&blocking_mask, sig);
struct sigaction sa;
sa.sa_handler = sigHandler;
sa.sa_mask = blocking_mask;
sa.sa_flags = 0;
for (auto sig : quitSignals)
sigaction(sig, &sa, nullptr);
}
#endif
using namespace org::openapitools::server::api;
int main() {
#ifdef __linux__
std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP};
setUpUnixSignals(sigs);
#endif
Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(9080));
httpEndpoint = new Pistache::Http::Endpoint((addr));
auto router = std::make_shared<Pistache::Rest::Router>();
auto opts = Pistache::Http::Endpoint::options()
.threads(PISTACHE_SERVER_THREADS);
opts.flags(Pistache::Tcp::Options::ReuseAddr);
opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE);
opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE);
httpEndpoint->init(opts);
NFInstanceIDDocumentApiImpl NFInstanceIDDocumentApiserver(router);
NFInstanceIDDocumentApiserver.init();
NFInstancesStoreApiImpl NFInstancesStoreApiserver(router);
NFInstancesStoreApiserver.init();
SubscriptionIDDocumentApiImpl SubscriptionIDDocumentApiserver(router);
SubscriptionIDDocumentApiserver.init();
SubscriptionsCollectionApiImpl SubscriptionsCollectionApiserver(router);
SubscriptionsCollectionApiserver.init();
httpEndpoint->setHandler(router->handler());
httpEndpoint->serve();
httpEndpoint->shutdown();
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AccessType.h"
namespace org {
namespace openapitools {
namespace server {
namespace model {
AccessType::AccessType()
{
}
AccessType::~AccessType()
{
}
void AccessType::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const AccessType& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, AccessType& o)
{
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AccessType.h
*
*
*/
#ifndef AccessType_H_
#define AccessType_H_
#include <nlohmann/json.hpp>
namespace org {
namespace openapitools {
namespace server {
namespace model {
/// <summary>
///
/// </summary>
class AccessType
{
public:
AccessType();
virtual ~AccessType();
void validate();
/////////////////////////////////////////////
/// AccessType members
friend void to_json(nlohmann::json& j, const AccessType& o);
friend void from_json(const nlohmann::json& j, AccessType& o);
protected:
};
}
}
}
}
#endif /* AccessType_H_ */
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AfEvent.h"
namespace org {
namespace openapitools {
namespace server {
namespace model {
AfEvent::AfEvent()
{
}
AfEvent::~AfEvent()
{
}
void AfEvent::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const AfEvent& o)
{
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, AfEvent& o)
{
}
}
}
}
}
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AfEvent.h
*
*
*/
#ifndef AfEvent_H_
#define AfEvent_H_
#include <nlohmann/json.hpp>
namespace org {
namespace openapitools {
namespace server {
namespace model {
/// <summary>
///
/// </summary>
class AfEvent
{
public:
AfEvent();
virtual ~AfEvent();
void validate();
/////////////////////////////////////////////
/// AfEvent members
friend void to_json(nlohmann::json& j, const AfEvent& o);
friend void from_json(const nlohmann::json& j, AfEvent& o);
protected:
};
}
}
}
}
#endif /* AfEvent_H_ */
/**
* NRF NFManagement Service
* NRF NFManagement Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AfEventExposureData.h"
namespace org {
namespace openapitools {
namespace server {
namespace model {
AfEventExposureData::AfEventExposureData()
{
m_AfIdsIsSet = false;
m_AppIdsIsSet = false;
}
AfEventExposureData::~AfEventExposureData()
{
}
void AfEventExposureData::validate()
{
// TODO: implement validation
}
void to_json(nlohmann::json& j, const AfEventExposureData& o)
{
j = nlohmann::json();
j["afEvents"] = o.m_AfEvents;
if(o.afIdsIsSet() || !o.m_AfIds.empty())
j["afIds"] = o.m_AfIds;
if(o.appIdsIsSet() || !o.m_AppIds.empty())
j["appIds"] = o.m_AppIds;
}
void from_json(const nlohmann::json& j, AfEventExposureData& o)
{
j.at("afEvents").get_to(o.m_AfEvents);
if(j.find("afIds") != j.end())
{
j.at("afIds").get_to(o.m_AfIds);
o.m_AfIdsIsSet = true;
}
if(j.find("appIds") != j.end())
{
j.at("appIds").get_to(o.m_AppIds);
o.m_AppIdsIsSet = true;
}
}
std::vector<AfEvent>& AfEventExposureData::getAfEvents()
{
return m_AfEvents;
}
void AfEventExposureData::setAfEvents(std::vector<AfEvent> const& value)
{
m_AfEvents = value;
}
std::vector<std::string>& AfEventExposureData::getAfIds()
{
return m_AfIds;
}
void AfEventExposureData::setAfIds(std::vector<std::string> const& value)
{
m_AfIds = value;
m_AfIdsIsSet = true;
}
bool AfEventExposureData::afIdsIsSet() const
{
return m_AfIdsIsSet;
}
void AfEventExposureData::unsetAfIds()
{
m_AfIdsIsSet = false;
}
std::vector<std::string>& AfEventExposureData::getAppIds()
{
return m_AppIds;
}
void AfEventExposureData::setAppIds(std::vector<std::string> const& value)
{
m_AppIds = value;
m_AppIdsIsSet = true;
}
bool AfEventExposureData::appIdsIsSet() const
{
return m_AppIdsIsSet;
}
void AfEventExposureData::unsetAppIds()
{
m_AppIdsIsSet = false;
}
}
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment