2 #include "ace/OS_NS_string.h"
4 #if !defined (ACE_LACKS_PRAGMA_ONCE)
6 #endif /* ACE_LACKS_PRAGMA_ONCE */
8 #include "ace/SV_Message.h"
11 #define SRV_KEY ACE_DEFAULT_SHM_KEY
17 Message_Data (long p
= -1,
18 const char user
[] = "",
19 const char text
[] = ""): pid_ (p
)
21 ACE_OS::strncpy (this->username_
, user
, 9);
22 ACE_OS::strncpy (this->mtext_
, text
, MSGSZ
);
25 long pid () { return this->pid_
; }
26 void pid (long p
) { this->pid_
= p
; }
27 char *user () { return this->username_
; }
28 void user (char user
[]) { ACE_OS::strncpy (this->username_
, user
, 9); }
29 char *text () { return this->mtext_
; }
30 void text (char text
[]) { ACE_OS::strncpy (this->mtext_
, text
, MSGSZ
); }
31 int length () { return sizeof *this - sizeof this->mtext_
+ ACE_OS::strlen (this->mtext_
) + 1; }
39 class Message_Block
: public ACE_SV_Message
, public Message_Data
42 // Stores message content.
44 // This may not be 100 percent portable on all C++ compilers since
45 // it relies on inheritance to be "concatenation."
48 Message_Block (long t
,
50 const char login
[] = "",
51 const char message
[] = "")
53 Message_Data (p
, login
, message
)