RIC-641 Fixing client/server model definitions and adding client and server API
[ric-plt/xapp-frame-cpp.git] / src / messaging / message.hpp
index 0db0927..838d9ee 100644 (file)
@@ -49,6 +49,8 @@
 #endif
 
 
+namespace xapp {
+
 // ------------------------------------------------------------------------
 
 class Message {
@@ -59,6 +61,7 @@ class Message {
 
        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;
@@ -66,6 +69,7 @@ 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 );
@@ -77,14 +81,14 @@ class Message {
 
                std::unique_ptr<unsigned char>  Copy_payload( );                // copy the payload; deletable smart pointer
 
-               std::unique_ptr<unsigned char> 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<unsigned char>  Get_src();
-               int     Get_state( );
-               int     Get_subid();
+               std::unique_ptr<unsigned char> 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<unsigned char>  Get_src() const;
+               int     Get_state( ) const;
+               int     Get_subid() const;
 
                void Set_meid( std::shared_ptr<unsigned char> new_meid );
                void Set_mtype( int new_type );
@@ -93,7 +97,7 @@ class Message {
 
                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::shared_ptr<unsigned char> payload );
                bool Send_msg( int mtype, int subid, int payload_len, unsigned char* payload );
@@ -104,7 +108,10 @@ class Message {
                bool Send_response( int mtype, int subid, int payload_len, unsigned char* response );
                bool Send_response( int payload_len, std::shared_ptr<unsigned char> 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<unsigned char> payload );
 };
 
+} // namespace
 
 #endif