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

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 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.


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
 

Enumeration values:
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 410 of file Name_Request_Reply.cpp.

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

00411 {
00412   ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
00413 
00414   // Initialize to a known quantity.
00415   this->msg_type (0);
00416   this->errnum (0);
00417   this->length (sizeof this->transfer_);
00418 }

ACE_Name_Reply::ACE_Name_Reply ACE_UINT32  type,
ACE_UINT32  err
 

Create a message.

Definition at line 422 of file Name_Request_Reply.cpp.

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

00423 {
00424   ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
00425   this->msg_type (t);
00426   this->errnum (err);
00427   this->length (sizeof this->transfer_);
00428 }


Member Function Documentation

int ACE_Name_Reply::decode void   ) 
 

Decode a message after reception.

Definition at line 527 of file Name_Request_Reply.cpp.

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

00528 {
00529   ACE_TRACE ("ACE_Name_Reply::decode");
00530   this->transfer_.length_ = ntohl (this->transfer_.length_);
00531   this->transfer_.type_ = ntohl (this->transfer_.type_);
00532   this->transfer_.errno_ = ntohl (this->transfer_.errno_);
00533   return 0;
00534 }

void ACE_Name_Reply::dump void   )  const
 

Print out the values of the message for debugging purposes.

Definition at line 539 of file Name_Request_Reply.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, ACE_TRACE, errnum(), LM_DEBUG, and msg_type().

00540 {
00541 #if defined (ACE_HAS_DUMP)
00542   ACE_TRACE ("ACE_Name_Reply::dump");
00543   ACE_DEBUG ((LM_DEBUG,
00544               ACE_LIB_TEXT ("*******\nlength = %d\nerrnum = %d"),
00545               this->length (),
00546               this->errnum ()));
00547   ACE_DEBUG ((LM_DEBUG,
00548               ACE_LIB_TEXT ("type = ")));
00549   switch (this->msg_type ())
00550     {
00551     case 0:
00552       ACE_DEBUG ((LM_DEBUG,
00553                   ACE_LIB_TEXT ("SUCCESS\n")));
00554       break;
00555     case -1:
00556       ACE_DEBUG ((LM_DEBUG,
00557                   ACE_LIB_TEXT ("FAILURE\n")));
00558       break;
00559     default:
00560       ACE_DEBUG ((LM_DEBUG,
00561                   ACE_LIB_TEXT ("<unknown type> = %d\n"),
00562                   this->msg_type ()));
00563       break;
00564     }
00565 #endif /* ACE_HAS_DUMP */
00566 }

int ACE_Name_Reply::encode void *&   ) 
 

Encode the message before transfer.

Definition at line 511 of file Name_Request_Reply.cpp.

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

00512 {
00513   ACE_TRACE ("ACE_Name_Reply::encode");
00514   int len = this->length (); // Get length *before* marshaling.
00515 
00516   this->transfer_.length_ = htonl (this->transfer_.length_);
00517   this->transfer_.type_ = htonl (this->transfer_.type_);
00518   this->transfer_.errno_ = htonl (this->transfer_.errno_);
00519   buf = (void *) &this->transfer_;
00520   return len;
00521 }

void ACE_Name_Reply::errnum ACE_UINT32   ) 
 

Definition at line 501 of file Name_Request_Reply.cpp.

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

00502 {
00503   ACE_TRACE ("ACE_Name_Reply::errnum");
00504   this->transfer_.errno_ = e;
00505 }

ACE_UINT32 ACE_Name_Reply::errnum void   )  const
 

Definition at line 494 of file Name_Request_Reply.cpp.

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

Referenced by ACE_Name_Reply(), and dump().

00495 {
00496   ACE_TRACE ("ACE_Name_Reply::errnum");
00497   return this->transfer_.errno_;
00498 }

void ACE_Name_Reply::init void   ) 
 

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

Definition at line 433 of file Name_Request_Reply.cpp.

References ACE_TRACE, and length().

00434 {
00435   ACE_TRACE ("ACE_Name_Reply::init");
00436   this->length (sizeof this->transfer_);
00437 }

void ACE_Name_Reply::length ACE_UINT32   ) 
 

Definition at line 449 of file Name_Request_Reply.cpp.

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

00450 {
00451   ACE_TRACE ("ACE_Name_Reply::length");
00452   this->transfer_.length_ = l;
00453 }

ACE_UINT32 ACE_Name_Reply::length void   )  const
 

Definition at line 442 of file Name_Request_Reply.cpp.

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

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

00443 {
00444   ACE_TRACE ("ACE_Name_Reply::length");
00445   return this->transfer_.length_;
00446 }

void ACE_Name_Reply::msg_type ACE_INT32   ) 
 

Definition at line 465 of file Name_Request_Reply.cpp.

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

00466 {
00467   ACE_TRACE ("ACE_Name_Reply::msg_type");
00468   this->transfer_.type_ = t;
00469 }

ACE_INT32 ACE_Name_Reply::msg_type void   )  const
 

Definition at line 458 of file Name_Request_Reply.cpp.

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

Referenced by ACE_Name_Reply(), and dump().

00459 {
00460   ACE_TRACE ("ACE_Name_Reply::msg_type");
00461   return this->transfer_.type_;
00462 }

void ACE_Name_Reply::status ACE_INT32   ) 
 

Definition at line 483 of file Name_Request_Reply.cpp.

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

00484 {
00485   ACE_TRACE ("ACE_Name_Reply::status");
00486   if (s == -1)
00487     this->transfer_.type_ = -1;
00488   else
00489     this->transfer_.type_ = 0;
00490 }

ACE_INT32 ACE_Name_Reply::status void   )  const
 

Definition at line 474 of file Name_Request_Reply.cpp.

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

00475 {
00476   ACE_TRACE ("ACE_Name_Reply::status");
00477   return this->transfer_.type_;
00478 }


Member Data Documentation

Transfer ACE_Name_Reply::transfer_ [private]
 

Transfer buffer.

Definition at line 258 of file Name_Request_Reply.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:25:29 2006 for ACE by doxygen 1.3.6