X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmessaging%2Fmessenger.hpp;h=173426c72076c2504122aec268b4a1afc44368b1;hb=6ef23e1d7f7f47ccab5be6ff1b68e5cfdda80ad2;hp=0fa7899468a573a6a5ceca3926c4f1c749105d05;hpb=8cb3c6f5d5062b83f17a5739e0671490beb543de;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/messaging/messenger.hpp b/src/messaging/messenger.hpp index 0fa7899..173426c 100644 --- a/src/messaging/messenger.hpp +++ b/src/messaging/messenger.hpp @@ -39,15 +39,17 @@ #include -//#include "callback.hpp" -//#include "default_cb.hpp" // default callback prototypes #include "message.hpp" +#include "alarm.hpp" #ifndef RMR_FALSE #define RMR_FALSE 0 #define RMR_TRUE 1 #endif +namespace xapp { + + class Messenger { private: @@ -58,21 +60,36 @@ class Messenger { void* mrc; // message router context 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& operator=( const Messenger& soi ); + public: // -- constants which need an instance; that happens as a global in the .cpp file (wtf C++) 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( std::string meid ); + std::unique_ptr Alloc_alarm( int prob_id, std::string meid ); + 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( std::string endpoint ); }; + +} // namespace #endif