X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmessaging%2Fmessage.hpp;h=838d9eece2a746be5031fd7fc46373d08a2d459e;hb=refs%2Fheads%2Fdawn;hp=8c06ed10f929061abf1c060d0a16000dd5f87384;hpb=8cb3c6f5d5062b83f17a5739e0671490beb543de;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/src/messaging/message.hpp b/src/messaging/message.hpp index 8c06ed1..838d9ee 100644 --- a/src/messaging/message.hpp +++ b/src/messaging/message.hpp @@ -49,17 +49,19 @@ #endif +namespace xapp { + // ------------------------------------------------------------------------ class Message { private: - static const int NOCHANGE = -99; // internal constant indicating no change to something - rmr_mbuf_t* mbuf; // the underlying RMR message buffer void* mrc; // message router context std::shared_ptr psp; // shared pointer to the payload to give out public: + static const int NO_CHANGE = -99; // indicates no change to a send/reply parameter + static const int NO_WHID = -1; // no wormhole id applies static const int INVALID_MTYPE = -1; static const int INVALID_STATUS = -1; static const int INVALID_SUBID = -2; @@ -67,40 +69,49 @@ class Message { static const int RESPONSE = 0; // send types static const int MESSAGE = 1; + static const int WORMHOLE_MSG = 2; Message( rmr_mbuf_t* mbuf, void* mrc ); // builders Message( void* mrc, int payload_len ); + Message( const Message& soi ); // copy cat + Message& operator=( const Message& soi ); // copy operator + Message( Message&& soi ); // mover + Message& operator=( Message&& soi ); // move operator ~Message(); // destroyer std::unique_ptr Copy_payload( ); // copy the payload; deletable smart pointer - std::unique_ptr Get_meid(); // returns a copy of the meid bytes - int Get_available_size(); - int Get_len(); - int Get_mtype(); - Msg_component Get_payload(); - std::unique_ptr Get_src(); - int Get_state( ); - int Get_subid(); + std::unique_ptr Get_meid() const; // returns a copy of the meid bytes + int Get_available_size() const; + int Get_len() const; + int Get_mtype() const; + Msg_component Get_payload() const; + std::unique_ptr Get_src() const; + int Get_state( ) const; + int Get_subid() const; - void Set_meid( std::unique_ptr new_meid ); + void Set_meid( std::shared_ptr new_meid ); void Set_mtype( int new_type ); void Set_subid( int new_subid ); + void Set_len( int new_len ); bool Reply( ); bool Send( ); - bool Send( int mtype, int subid, int payload_len, unsigned char* payload, int stype ); + bool Send( int mtype, int subid, int payload_len, unsigned char* payload, int stype, int whid ); - bool Send_msg( int mtype, int subid, int payload_len, std::unique_ptr payload ); + bool Send_msg( int mtype, int subid, int payload_len, std::shared_ptr payload ); bool Send_msg( int mtype, int subid, int payload_len, unsigned char* payload ); - bool Send_msg( int payload_len, std::unique_ptr payload ); + bool Send_msg( int payload_len, std::shared_ptr payload ); bool Send_msg( int payload_len, unsigned char* payload ); - bool Send_response( int mtype, int subid, int payload_len, std::unique_ptr response ); + bool Send_response( int mtype, int subid, int payload_len, std::shared_ptr response ); bool Send_response( int mtype, int subid, int payload_len, unsigned char* response ); - bool Send_response( int payload_len, std::unique_ptr response ); + bool Send_response( int payload_len, std::shared_ptr response ); bool Send_response( int payload_len, unsigned char* response ); + + bool Wormhole_send( int whid, int mtype, int subid, int payload_len, std::shared_ptr payload ); }; +} // namespace #endif