X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=src%2Fmessaging%2Fmessenger.hpp;h=457e24b6a3cdf52fed275ac3d0bf6dd1e154acd2;hb=5328c8da64ea724f8730b7a0bbd3214fde66fca1;hp=0810aeb4ca81501ac333c43dac46db2ccac96ee0;hpb=0b08d9dc1639e926c1df4535703b67903a86aad7;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/messaging/messenger.hpp b/src/messaging/messenger.hpp index 0810aeb..457e24b 100644 --- a/src/messaging/messenger.hpp +++ b/src/messaging/messenger.hpp @@ -40,12 +40,17 @@ #include #include "message.hpp" +#include "alarm.hpp" +#include "metrics.hpp" #ifndef RMR_FALSE #define RMR_FALSE 0 #define RMR_TRUE 1 #endif +namespace xapp { + + class Messenger { private: @@ -57,7 +62,7 @@ class Messenger { char* listen_port; // port we ask msg router to listen on // copy and assignment are PRIVATE so that they fail if xapp tries; messenger cannot be copied! - Messenger( const Messenger& soi ); + Messenger( const Messenger& soi ); Messenger& operator=( const Messenger& soi ); public: @@ -65,18 +70,31 @@ class Messenger { static const int MAX_PAYLOAD; // max message size we'll handle static const int DEFAULT_CALLBACK; // parm for add callback to set default - Messenger( char* port, bool wait4table ); // builder + Messenger( const char* port, bool wait4table ); // builder Messenger( Messenger&& soi ); // move construction Messenger& operator=( Messenger&& soi ); // move operator ~Messenger(); // destroyer void Add_msg_cb( int mtype, user_callback fun_name, void* data ); + std::unique_ptr Alloc_msg( int payload_size ); // message allocation + + std::unique_ptr Alloc_alarm( ); // alarm allocation + std::unique_ptr Alloc_alarm( const std::string& meid ); + std::unique_ptr Alloc_alarm( int prob_id, const std::string& meid ); + + std::unique_ptr Alloc_metrics( ); // metrics allocation + std::unique_ptr Alloc_metrics( const std::string& source ); + std::unique_ptr Alloc_metrics( const std::string& reporter, const std::string& source ); + void Listen( ); // lisen driver std::unique_ptr Receive( int timeout ); // receive 1 message void Stop( ); // force to stop - //void Release_mbuf( void* vmbuf ); bool Wait_for_cts( int max_wait ); + + int Wormhole_open( const std::string& endpoint ); }; + +} // namespace #endif