ACE 8.0.5
Loading...
Searching...
No Matches
ACE_Message_Block Class Reference

Stores messages for use throughout ACE (particularly in an ACE_Message_Queue). More...

#include <Message_Block.h>

Detailed Description

Stores messages for use throughout ACE (particularly in an ACE_Message_Queue).

An ACE_Message_Block is modeled after the message data structures used in System V STREAMS. Its purpose is to enable efficient manipulation of arbitrarily large messages without incurring much memory copying overhead. Here are the main characteristics of an ACE_Message_Block:

  • Contains a pointer to a reference-counted ACE_Data_Block, which in turn points to the actual data buffer. This allows very flexible and efficient sharing of data by multiple ACE_Message_Block objects.
  • One or more ACE_Message_Blocks can be linked to form a ``fragment chain.''
  • ACE_Message_Blocks can be linked together in a doubly linked fashion to form a queue of messages (this is how ACE_Message_Queue works).
See also
C++NPv1, section 4.2; APG, section 12.3.2. */ class ACE_Message_Block { public: friend class ACE_Data_Block;

enum { = Data and proto / Undifferentiated data message MB_DATA = 0x01, / Undifferentiated protocol control MB_PROTO = 0x02,

= Control messages / Line break (regular and priority) MB_BREAK = 0x03, / Pass file pointer MB_PASSFP = 0x04, / Post an event to an event queue MB_EVENT = 0x05, / Generate process signal MB_SIG = 0x06, / ioctl; set/get params MB_IOCTL = 0x07, / Set various stream head options MB_SETOPTS = 0x08,

= Control messages / Acknowledge ioctl (high priority; go to head of queue) MB_IOCACK = 0x81, / Negative ioctl acknowledge MB_IOCNAK = 0x82, / Priority proto message MB_PCPROTO = 0x83, / Generate process signal MB_PCSIG = 0x84, / Generate read notification MB_READ = 0x85, / Flush your queues MB_FLUSH = 0x86, / Stop transmission immediately MB_STOP = 0x87, / Restart transmission after stop MB_START = 0x88, / Line disconnect MB_HANGUP = 0x89, / Fatal error used to set u.u_error MB_ERROR = 0x8a, / Post an event to an event queue MB_PCEVENT = 0x8b,

= Message class masks / Normal priority message mask MB_NORMAL = 0x00, / High priority control message mask MB_PRIORITY = 0x80, / User-defined message mask MB_USER = 0x200 };

typedef int ACE_Message_Type; typedef unsigned long Message_Flags;

enum { / Don't delete the data on exit since we don't own it. DONT_DELETE = 01, / user defined flags start here USER_FLAGS = 0x1000 };

/ Create an empty message. ACE_Message_Block (ACE_Allocator *message_block_allocator = 0);

/** Create an ACE_Message_Block that owns the specified ACE_Data_Block without copying it. If the flags is set to DONT_DELETE we don't delete the ACE_Data_Block. It is left to the client's responsibility to take care of the memory allocated for the data_block


The documentation for this class was generated from the following file: