Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Name_Reply Class Reference

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

#include <Name_Request_Reply.h>

List of all members.

Public Types

enum  Constants { MAX_NAME_LENGTH = MAXPATHLEN + 1 }

Public Methods

 ACE_Name_Reply (void)
 Default constructor. More...

 ACE_Name_Reply (ACE_UINT32 type, ACE_UINT32 err)
 Create a <ACE_Name_Reply> message. More...

void init (void)
 Initialize length_ in order to ensure correct byte ordering before a reply is sent. More...

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

int decode (void)
 Decode a message after reception. More...

void dump (void) const
 Print out the values of the message for debugging purposes. More...


Private Attributes

Transfer transfer_
 Transfer buffer. More...


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 194 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 197 of file Name_Request_Reply.h.

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


Constructor & Destructor Documentation

ACE_Name_Reply::ACE_Name_Reply void   
 

Default constructor.

Definition at line 403 of file Name_Request_Reply.cpp.

References ACE_TRACE, errnum, length, and msg_type.

00404 {
00405   ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
00406 
00407   // Initialize to a known quantity.
00408   this->msg_type (0);
00409   this->errnum (0);
00410   this->length (sizeof this->transfer_);
00411 }

ACE_Name_Reply::ACE_Name_Reply ACE_UINT32    type,
ACE_UINT32    err
 

Create a <ACE_Name_Reply> message.

Definition at line 415 of file Name_Request_Reply.cpp.

References ACE_TRACE.

00416 {
00417   ACE_TRACE ("ACE_Name_Reply::ACE_Name_Reply");
00418   this->msg_type (t);
00419   this->errnum (err);
00420   this->length (sizeof this->transfer_);
00421 }


Member Function Documentation

int ACE_Name_Reply::decode void   
 

Decode a message after reception.

Definition at line 520 of file Name_Request_Reply.cpp.

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

Referenced by ACE_Name_Proxy::request_reply.

00521 {
00522   ACE_TRACE ("ACE_Name_Reply::decode");
00523   this->transfer_.length_ = ntohl (this->transfer_.length_);
00524   this->transfer_.type_ = ntohl (this->transfer_.type_);
00525   this->transfer_.errno_ = ntohl (this->transfer_.errno_);
00526   return 0;
00527 }

void ACE_Name_Reply::dump void    const
 

Print out the values of the message for debugging purposes.

Definition at line 532 of file Name_Request_Reply.cpp.

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

00533 {
00534   ACE_TRACE ("ACE_Name_Reply::dump");
00535   ACE_DEBUG ((LM_DEBUG,
00536               ACE_LIB_TEXT ("*******\nlength = %d\nerrnum = %d"),
00537               this->length (),
00538               this->errnum ()));
00539   ACE_DEBUG ((LM_DEBUG,
00540               ACE_LIB_TEXT ("type = ")));
00541   switch (this->msg_type ())
00542     {
00543     case 0:
00544       ACE_DEBUG ((LM_DEBUG,
00545                   ACE_LIB_TEXT ("SUCCESS\n")));
00546       break;
00547     case -1:
00548       ACE_DEBUG ((LM_DEBUG,
00549                   ACE_LIB_TEXT ("FAILURE\n")));
00550       break;
00551     default:
00552       ACE_DEBUG ((LM_DEBUG,
00553                   ACE_LIB_TEXT ("<unknown type> = %d\n"),
00554                   this->msg_type ()));
00555       break;
00556     }
00557 }

int ACE_Name_Reply::encode void *&   
 

Encode the message before transfer.

Definition at line 504 of file Name_Request_Reply.cpp.

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

00505 {
00506   ACE_TRACE ("ACE_Name_Reply::encode");
00507   int len = this->length (); // Get length *before* marshaling.
00508 
00509   this->transfer_.length_ = htonl (this->transfer_.length_);
00510   this->transfer_.type_ = htonl (this->transfer_.type_);
00511   this->transfer_.errno_ = htonl (this->transfer_.errno_);
00512   buf = (void *) &this->transfer_;
00513   return len;
00514 }

void ACE_Name_Reply::errnum ACE_UINT32   
 

Definition at line 494 of file Name_Request_Reply.cpp.

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

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

ACE_UINT32 ACE_Name_Reply::errnum void    const
 

Definition at line 487 of file Name_Request_Reply.cpp.

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

Referenced by ACE_Name_Reply, dump, and ACE_Name_Proxy::request_reply.

00488 {
00489   ACE_TRACE ("ACE_Name_Reply::errnum");
00490   return this->transfer_.errno_;
00491 }

void ACE_Name_Reply::init void   
 

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

Definition at line 426 of file Name_Request_Reply.cpp.

References ACE_TRACE, and length.

00427 {
00428   ACE_TRACE ("ACE_Name_Reply::init");
00429   this->length (sizeof this->transfer_);
00430 }

void ACE_Name_Reply::length ACE_UINT32   
 

Definition at line 442 of file Name_Request_Reply.cpp.

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

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

ACE_UINT32 ACE_Name_Reply::length void    const
 

Definition at line 435 of file Name_Request_Reply.cpp.

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

Referenced by ACE_Name_Reply, encode, and init.

00436 {
00437   ACE_TRACE ("ACE_Name_Reply::length");
00438   return this->transfer_.length_;
00439 }

void ACE_Name_Reply::msg_type ACE_INT32   
 

Definition at line 458 of file Name_Request_Reply.cpp.

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

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

ACE_INT32 ACE_Name_Reply::msg_type void    const
 

Definition at line 451 of file Name_Request_Reply.cpp.

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

Referenced by ACE_Name_Reply, and dump.

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

void ACE_Name_Reply::status ACE_INT32   
 

Definition at line 476 of file Name_Request_Reply.cpp.

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

00477 {
00478   ACE_TRACE ("ACE_Name_Reply::status");
00479   if (s == -1)
00480     this->transfer_.type_ = -1;
00481   else
00482     this->transfer_.type_ = 0;
00483 }

ACE_INT32 ACE_Name_Reply::status 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_Proxy::request_reply.

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


Member Data Documentation

Transfer ACE_Name_Reply::transfer_ [private]
 

Transfer buffer.

Definition at line 256 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 Mon Jun 16 12:50:53 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002