X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2FKPI-Message-Handler%2FKPIMessageHandler.h;fp=src%2FKPI-Message-Handler%2FKPIMessageHandler.h;h=c9bcc2076e4da7c8e781260dd2c07c2e84662d17;hb=36b57d809f3012375509c603c407b2cf36580af1;hp=0000000000000000000000000000000000000000;hpb=9a1a0c924b38863ca4ebe2465af975f39dd383d5;p=ric-app%2Fkpimon.git diff --git a/src/KPI-Message-Handler/KPIMessageHandler.h b/src/KPI-Message-Handler/KPIMessageHandler.h new file mode 100755 index 0000000..c9bcc20 --- /dev/null +++ b/src/KPI-Message-Handler/KPIMessageHandler.h @@ -0,0 +1,58 @@ +/* +================================================================================== + + Copyright (c) 2018-2019 AT&T Intellectual Property. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +================================================================================== +*/ + + +#ifndef KPI_MESSAGE_HANDLER_H +#define KPI_MESSAGE_HANDLER_H + +#include +#include +#include +#include // For time() +#include +#include +#include + + +#ifdef __GNUC__ +#define likely(x) __builtin_expect((x), 1) +#define unlikely(x) __builtin_expect((x), 0) +#else +#define likely(x) (x) +#define unlikely(x) (x) +#endif + +class kpi_msg_handler +{ +public: + kpi_msg_handler(); + bool operator()(redisContext *,unsigned char *, size_t); + void clear(); + std::string get_error(void) { return error_string;}; + +private: + + std::unique_ptr m_access; + cucp_resource_helper kpi_data; + cucp_resource_status_report kpi_report; + kpi_db_resp kpi_db_res; + std::string error_string; +}; + +#endif