ACE_Name_Reply Class Reference

Message format for delivering replies from the ACE_Name Server. More...

#include <Name_Request_Reply.h>

Collaboration diagram for ACE_Name_Reply:

Collaboration graph
[legend]
List of all members.

Public Types

 MAX_NAME_LENGTH = MAXPATHLEN + 1
 Class-specific constant values.
enum  Constants { MAX_NAME_LENGTH = MAXPATHLEN + 1 }

Public Member Functions

 ACE_Name_Reply (void)
 Default constructor.
 ACE_Name_Reply (ACE_UINT32 type, ACE_UINT32 err)
 Create a <ACE_Name_Reply> message.
void init (void)
ACE_UINT32 length (void) const
void length (ACE_UINT32)
ACE_INT32 msg_type (void) const
void msg_type (ACE_INT32)
ACE_INT32 status (void) const
void status (ACE_INT32)
ACE_UINT32 errnum (void) const
void errnum (ACE_UINT32)
int encode (void *&)
 Encode the message before transfer.
int decode (void)
 Decode a message after reception.
void dump (void) const
 Print out the values of the message for debugging purposes.

Private Attributes

Transfer transfer_
 Transfer buffer.

Classes

struct  Transfer

Detailed Description

Message format for delivering replies from the ACE_Name Server.

This class is implemented to minimize data copying. In particular, all marshaling is done in situ...

Definition at line 196 of file Name_Request_Reply.h.


Member Enumeration Documentation

enum ACE_Name_Reply::Constants

Enumerator:
MAX_NAME_LENGTH  Class-specific constant values.

Definition at line 199 of file Name_Request_Reply.h.

00200   {
00201     /// Class-specific constant values.
00202     MAX_NAME_LENGTH = MAXPATHLEN + 1
00203   };


Constructor & Destructor Documentation

ACE_Name_Reply::ACE_Name_Reply ( void   ) 

Default constructor.

Definition at line 419 of file Name_Request_Reply.cpp.

References ACE_TRACE, errnum(), length(), and msg_type().

00420 {
00421   ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
00422 
00423   // Initialize to a known quantity.
00424   this->msg_type (0);
00425   this->errnum (0);
00426   this->length (sizeof this->transfer_);
00427 }

ACE_Name_Reply::ACE_Name_Reply ( ACE_UINT32  type,
ACE_UINT32  err 
)

Create a <ACE_Name_Reply> message.

Definition at line 431 of file Name_Request_Reply.cpp.

References ACE_TRACE, errnum(), length(), and msg_type().

00432 {
00433   ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
00434   this->msg_type (t);
00435   this->errnum (err);
00436   this->length (sizeof this->transfer_);
00437 }


Member Function Documentation

int ACE_Name_Reply::decode ( void   ) 

Decode a message after reception.

Definition at line 536 of file Name_Request_Reply.cpp.

References ACE_NTOHL, ACE_TRACE, ACE_Name_Reply::Transfer::errno_, ACE_Name_Reply::Transfer::length_, transfer_, and ACE_Name_Reply::Transfer::type_.

00537 {
00538   ACE_TRACE ("ACE_Name_Reply::decode");
00539   this->transfer_.length_ = ACE_NTOHL (this->transfer_.length_);
00540   this->transfer_.type_ = ACE_NTOHL (this->transfer_.type_);
00541   this->transfer_.errno_ = ACE_NTOHL (this->transfer_.errno_);
00542   return 0;
00543 }

void ACE_Name_Reply::dump ( void   )  const

Print out the values of the message for debugging purposes.

Definition at line 548 of file Name_Request_Reply.cpp.

References ACE_DEBUG, ACE_TEXT, ACE_TRACE, errnum(), and LM_DEBUG.

00549 {
00550 #if defined (ACE_HAS_DUMP)
00551   ACE_TRACE ("ACE_Name_Reply::dump");
00552   ACE_DEBUG ((LM_DEBUG,
00553               ACE_TEXT ("*******\nlength = %d\nerrnum = %d"),
00554               this->length (),
00555               this->errnum ()));
00556   ACE_DEBUG ((LM_DEBUG,
00557               ACE_TEXT ("type = ")));
00558   switch (this->msg_type ())
00559     {
00560     case 0:
00561       ACE_DEBUG ((LM_DEBUG,
00562                   ACE_TEXT ("SUCCESS\n")));
00563       break;
00564     case -1:
00565       ACE_DEBUG ((LM_DEBUG,
00566                   ACE_TEXT ("FAILURE\n")));
00567       break;
00568     default:
00569       ACE_DEBUG ((LM_DEBUG,
00570                   ACE_TEXT ("<unknown type> = %d\n"),
00571                   this->msg_type ()));
00572       break;
00573     }
00574 #endif /* ACE_HAS_DUMP */
00575 }

int ACE_Name_Reply::encode ( void *&   ) 

Encode the message before transfer.

Definition at line 520 of file Name_Request_Reply.cpp.

References ACE_HTONL, ACE_TRACE, ACE_Name_Reply::Transfer::errno_, length(), ACE_Name_Reply::Transfer::length_, transfer_, and ACE_Name_Reply::Transfer::type_.

00521 {
00522   ACE_TRACE ("ACE_Name_Reply::encode");
00523   int len = this->length (); // Get length *before* marshaling.
00524 
00525   this->transfer_.length_ = ACE_HTONL (this->transfer_.length_);
00526   this->transfer_.type_ = ACE_HTONL (this->transfer_.type_);
00527   this->transfer_.errno_ = ACE_HTONL (this->transfer_.errno_);
00528   buf = (void *) &this->transfer_;
00529   return len;
00530 }

void ACE_Name_Reply::errnum ( ACE_UINT32   ) 

Definition at line 510 of file Name_Request_Reply.cpp.

References ACE_TRACE, ACE_Name_Reply::Transfer::errno_, and transfer_.

00511 {
00512   ACE_TRACE ("ACE_Name_Reply::errnum");
00513   this->transfer_.errno_ = e;
00514 }

ACE_UINT32 ACE_Name_Reply::errnum ( void   )  const

Definition at line 503 of file Name_Request_Reply.cpp.

References ACE_TRACE, ACE_Name_Reply::Transfer::errno_, and transfer_.

Referenced by ACE_Name_Reply(), and dump().

00504 {
00505   ACE_TRACE ("ACE_Name_Reply::errnum");
00506   return this->transfer_.errno_;
00507 }

void ACE_Name_Reply::init ( void   ) 

Initialize length_ in order to ensure correct byte ordering before a reply is sent.

Definition at line 442 of file Name_Request_Reply.cpp.

References ACE_TRACE, and length().

00443 {
00444   ACE_TRACE ("ACE_Name_Reply::init");
00445   this->length (sizeof this->transfer_);
00446 }

void ACE_Name_Reply::length ( ACE_UINT32   ) 

Definition at line 458 of file Name_Request_Reply.cpp.

References ACE_TRACE, ACE_Name_Reply::Transfer::length_, and transfer_.

00459 {
00460   ACE_TRACE ("ACE_Name_Reply::length");
00461   this->transfer_.length_ = l;
00462 }

ACE_UINT32 ACE_Name_Reply::length ( void   )  const

Definition at line 451 of file Name_Request_Reply.cpp.

References ACE_TRACE, ACE_Name_Reply::Transfer::length_, and transfer_.

Referenced by ACE_Name_Reply(), encode(), and init().

00452 {
00453   ACE_TRACE ("ACE_Name_Reply::length");
00454   return this->transfer_.length_;
00455 }

void ACE_Name_Reply::msg_type ( ACE_INT32   ) 

Definition at line 474 of file Name_Request_Reply.cpp.

References ACE_TRACE, transfer_, and ACE_Name_Reply::Transfer::type_.

00475 {
00476   ACE_TRACE ("ACE_Name_Reply::msg_type");
00477   this->transfer_.type_ = t;
00478 }

ACE_INT32 ACE_Name_Reply::msg_type ( void   )  const

Definition at line 467 of file Name_Request_Reply.cpp.

References ACE_TRACE, transfer_, and ACE_Name_Reply::Transfer::type_.

Referenced by ACE_Name_Reply().

00468 {
00469   ACE_TRACE ("ACE_Name_Reply::msg_type");
00470   return this->transfer_.type_;
00471 }

void ACE_Name_Reply::status ( ACE_INT32   ) 

Definition at line 492 of file Name_Request_Reply.cpp.

References ACE_TRACE, transfer_, and ACE_Name_Reply::Transfer::type_.

00493 {
00494   ACE_TRACE ("ACE_Name_Reply::status");
00495   if (s == -1)
00496     this->transfer_.type_ = -1;
00497   else
00498     this->transfer_.type_ = 0;
00499 }

ACE_INT32 ACE_Name_Reply::status ( void   )  const

Definition at line 483 of file Name_Request_Reply.cpp.

References ACE_TRACE, transfer_, and ACE_Name_Reply::Transfer::type_.

00484 {
00485   ACE_TRACE ("ACE_Name_Reply::status");
00486   return this->transfer_.type_;
00487 }


Member Data Documentation

Transfer ACE_Name_Reply::transfer_ [private]

Transfer buffer.

Definition at line 258 of file Name_Request_Reply.h.

Referenced by decode(), encode(), errnum(), length(), msg_type(), and status().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:35:22 2010 for ACE by  doxygen 1.4.7