TAO_Operation_Details Class Reference

Class with operation details. More...

#include <operation_details.h>

Collaboration diagram for TAO_Operation_Details:

Collaboration graph
[legend]
List of all members.

Helper methods used by the Invocation classes.

bool marshal_args (TAO_OutputCDR &cdr)
 Marshals the list of <this->arg_> into the cdr.

bool demarshal_args (TAO_InputCDR &cdr)
 Demarshals the list of <this->arg_> into the cdr.

TAO::Argument ** args (void) const
 Accessors for the argument list.

CORBA::ULong args_num (void) const
 Marshals the list of <this->arg_> into the cdr.

CORBA::ULong ex_count (void) const
 Exception count.

TAO::Exception_Data const * ex_data (void) const
 Marshals the list of <this->arg_> into the cdr.

void ft_expiration_time (TimeBase::TimeT time)
 Marshals the list of <this->arg_> into the cdr.

TimeBase::TimeT ft_expiration_time (void) const
 Marshals the list of <this->arg_> into the cdr.

void ft_retention_id (CORBA::Long request_id)
 Marshals the list of <this->arg_> into the cdr.

CORBA::Long ft_retention_id (void) const
 Marshals the list of <this->arg_> into the cdr.

const char * opname_
 Name of the operation being invoked.

CORBA::ULong opname_len_
 Precalculated length of opname_.

CORBA::ULong request_id_
 Request ID of this operation.

CORBA::Boolean argument_flag_
CORBA::Octet response_flags_
 Response flags.

TAO_Service_Context request_service_info_
TAO_Service_Context reply_service_info_
TAO_Target_Specification::TAO_Target_Address addressing_mode_
 Addressing mode for this request.

TAO::Argument ** args_
CORBA::ULong num_args_
 Number of arguments including the return value.

TAO::Exception_Dataex_data_
 The type of exceptions that the operations can throw.

CORBA::ULong ex_count_
 Count of the exceptions that operations can throw.

TimeBase::TimeT ft_expiration_time_
 FT request expiration time (absolute gregorian).

CORBA::Long ft_retention_id_
 FT request retention id.


Public Member Functions

 TAO_Operation_Details (const char *name, CORBA::ULong len, CORBA::Boolean argument_flag, TAO::Argument **args=0, CORBA::ULong num_args=0, TAO::Exception_Data *ex_data=0, CORBA::ULong ex_count=0)
 Constructor.

const char * opname (void) const
 Operation name.

CORBA::ULong opname_len (void) const
 Length of the operation name.

CORBA::Boolean argument_flag (void) const
void response_flags (CORBA::Octet flags)
 Set the response flags.

CORBA::Octet response_flags (void) const
 Get the response flags.

IOP::ServiceContextListrequest_service_info (void)
 Accessors for the service context list.

const IOP::ServiceContextListrequest_service_info (void) const
IOP::ServiceContextListreply_service_info (void)
const IOP::ServiceContextListreply_service_info (void) const
TAO_Service_Contextrequest_service_context (void)
 Access the TAO_Service_Context.

const TAO_Service_Contextrequest_service_context (void) const
TAO_Service_Contextreply_service_context (void)
const TAO_Service_Contextreply_service_context (void) const
void reset_request_service_info (void)
void reset_reply_service_info (void)
void request_id (CORBA::ULong id)
 Cache the request id.

CORBA::ULong request_id (void) const
 Return the request ID associated with the operation.

TAO_Target_Specification::TAO_Target_Address addressing_mode (void) const
 Accessor method for the addressing mode.

void addressing_mode (CORBA::Short addr)
 Set method for the addressing mode.

CORBA::Exceptioncorba_exception (const char *ex) throw (CORBA::SystemException)

Friends

class TAO::CSD::FW_Server_Request_Wrapper

Detailed Description

Class with operation details.

This class stores some of the "operation" details that would be required by the invocation classes. This class is in its infancy now but I expect this one to grow as we come with different varieties of use cases.

Todo:
Put this in namespace TAO.

Definition at line 63 of file operation_details.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_Operation_Details::TAO_Operation_Details const char *  name,
CORBA::ULong  len,
CORBA::Boolean  argument_flag,
TAO::Argument **  args = 0,
CORBA::ULong  num_args = 0,
TAO::Exception_Data ex_data = 0,
CORBA::ULong  ex_count = 0
 

Constructor.

Definition at line 8 of file operation_details.i.

00015   : opname_ (name)
00016     , opname_len_ (len)
00017     , request_id_ (0)
00018     , argument_flag_ (argument_flag)
00019     , response_flags_ (0)
00020     , addressing_mode_ (TAO_Target_Specification::Key_Addr)
00021     , args_ (args)
00022     , num_args_ (num)
00023     , ex_data_ (data)
00024     , ex_count_ (count)
00025 #if TAO_HAS_INTERCEPTORS == 1
00026     , ft_expiration_time_ (0)
00027     , ft_retention_id_ (0)
00028 #endif /*TAO_HAS_INTERCEPTORS == 1*/
00029 {
00030 }


Member Function Documentation

ACE_INLINE void TAO_Operation_Details::addressing_mode CORBA::Short  addr  ) 
 

Set method for the addressing mode.

Definition at line 152 of file operation_details.i.

References addressing_mode_.

00153 {
00154   if (mode == 0)
00155     this->addressing_mode_ = TAO_Target_Specification::Key_Addr;
00156   else if (mode == 1)
00157     this->addressing_mode_ = TAO_Target_Specification::Profile_Addr;
00158   else if (mode == 2)
00159     this->addressing_mode_ = TAO_Target_Specification::Reference_Addr;
00160 }

ACE_INLINE TAO_Target_Specification::TAO_Target_Address TAO_Operation_Details::addressing_mode void   )  const
 

Accessor method for the addressing mode.

Definition at line 146 of file operation_details.i.

References addressing_mode_.

00147 {
00148   return this->addressing_mode_;
00149 }

ACE_INLINE TAO::Argument ** TAO_Operation_Details::args void   )  const
 

Accessors for the argument list.

Definition at line 163 of file operation_details.i.

Referenced by TAO::Collocated_Invocation::invoke().

00164 {
00165   return this->args_;
00166 }

ACE_INLINE CORBA::ULong TAO_Operation_Details::args_num void   )  const
 

Marshals the list of <this->arg_> into the cdr.

Definition at line 169 of file operation_details.i.

References num_args_.

Referenced by TAO::Collocated_Invocation::invoke().

00170 {
00171   return this->num_args_;
00172 }

ACE_INLINE CORBA::Boolean TAO_Operation_Details::argument_flag void   )  const
 

Return the flag that indicates whether the operation has any arguments

Definition at line 45 of file operation_details.i.

References argument_flag_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::write_request_header().

00046 {
00047   return this->argument_flag_;
00048 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::Exception * TAO_Operation_Details::corba_exception const char *  ex  )  throw (CORBA::SystemException)
 

This step is important to decode the exception that the client got from the server. If the exception received from the server is not found in the list of exceptions specified by the operation this call would raise an UNKNOWN exception.

Definition at line 24 of file operation_details.cpp.

References ACE_THROW_RETURN, and ACE_OS::strcmp().

00027 {
00028   for (CORBA::ULong i = 0; i != this->ex_count_; ++i)
00029     {
00030       if (ACE_OS::strcmp (id,
00031                           this->ex_data_[i].id) != 0)
00032         {
00033           continue;
00034         }
00035 
00036       // Create an exception object
00037       CORBA::Exception *exception =
00038         this->ex_data_[i].alloc ();
00039 
00040       if (exception == 0)
00041         {
00042           ACE_THROW_RETURN (CORBA::NO_MEMORY (0,
00043                                               CORBA::COMPLETED_YES),
00044                             0);
00045         }
00046 
00047       // Return the exception object that we just created.
00048       return exception;
00049     }
00050 
00051   // If there are no matches return an unknown exception.
00052   ACE_THROW_RETURN (CORBA::UNKNOWN (0,
00053                                     CORBA::COMPLETED_YES),
00054                     0);
00055 }

bool TAO_Operation_Details::demarshal_args TAO_InputCDR cdr  ) 
 

Demarshals the list of <this->arg_> into the cdr.

Definition at line 75 of file operation_details.cpp.

References num_args_.

Referenced by TAO::Synch_Twoway_Invocation::check_reply_status().

00076 {
00077   for (CORBA::ULong i = 0; i != this->num_args_; ++i)
00078     {
00079       if (!((*this->args_[i]).demarshal (cdr)))
00080         return false;
00081     }
00082 
00083   return true;
00084 }

ACE_INLINE CORBA::ULong TAO_Operation_Details::ex_count void   )  const
 

Exception count.

Definition at line 128 of file operation_details.i.

References ex_count_.

00129 {
00130   return this->ex_count_;
00131 }

ACE_INLINE TAO::Exception_Data const * TAO_Operation_Details::ex_data void   )  const
 

Marshals the list of <this->arg_> into the cdr.

Definition at line 134 of file operation_details.i.

References ex_data_.

00135 {
00136   return this->ex_data_;
00137 }

TimeBase::TimeT TAO_Operation_Details::ft_expiration_time void   )  const
 

Marshals the list of <this->arg_> into the cdr.

void TAO_Operation_Details::ft_expiration_time TimeBase::TimeT  time  ) 
 

Marshals the list of <this->arg_> into the cdr.

CORBA::Long TAO_Operation_Details::ft_retention_id void   )  const
 

Marshals the list of <this->arg_> into the cdr.

void TAO_Operation_Details::ft_retention_id CORBA::Long  request_id  ) 
 

Marshals the list of <this->arg_> into the cdr.

bool TAO_Operation_Details::marshal_args TAO_OutputCDR cdr  ) 
 

Marshals the list of <this->arg_> into the cdr.

Definition at line 58 of file operation_details.cpp.

References TAO_OutputCDR::more_fragments(), and num_args_.

Referenced by TAO::Remote_Invocation::marshal_data().

00059 {
00060   for (CORBA::ULong i = 0; i != this->num_args_; ++i)
00061     {
00062       if (!((*this->args_[i]).marshal (cdr)))
00063         return false;
00064     }
00065 
00066   // Nothing else to fragment.  We're also guaranteed to have
00067   // data in the CDR stream since the operation was a marshaling
00068   // operation, not a fragmentation operation.
00069   cdr.more_fragments (false);
00070 
00071   return true;
00072 }

ACE_INLINE const char * TAO_Operation_Details::opname void   )  const
 

Operation name.

Definition at line 33 of file operation_details.i.

References opname_.

Referenced by TAO::Collocated_Invocation::invoke(), TAO_GIOP_Message_Lite::write_request_header(), TAO_GIOP_Message_Generator_Parser_12::write_request_header(), and TAO_GIOP_Message_Generator_Parser_10::write_request_header().

00034 {
00035   return this->opname_;
00036 }

ACE_INLINE CORBA::ULong TAO_Operation_Details::opname_len void   )  const
 

Length of the operation name.

Definition at line 39 of file operation_details.i.

References opname_len_.

Referenced by TAO::Collocated_Invocation::invoke(), TAO_GIOP_Message_Lite::write_request_header(), TAO_GIOP_Message_Generator_Parser_12::write_request_header(), and TAO_GIOP_Message_Generator_Parser_10::write_request_header().

00040 {
00041   return this->opname_len_;
00042 }

ACE_INLINE const TAO_Service_Context & TAO_Operation_Details::reply_service_context void   )  const
 

Definition at line 81 of file operation_details.i.

00082 {
00083   return this->reply_service_info_;
00084 }

ACE_INLINE TAO_Service_Context & TAO_Operation_Details::reply_service_context void   ) 
 

Definition at line 75 of file operation_details.i.

Referenced by TAO::Invocation_Base::reply_service_context(), reply_service_info(), and reset_reply_service_info().

00076 {
00077   return this->reply_service_info_;
00078 }

ACE_INLINE const IOP::ServiceContextList & TAO_Operation_Details::reply_service_info void   )  const
 

Definition at line 93 of file operation_details.i.

References reply_service_context(), and TAO_Service_Context::service_info().

00094 {
00095   return this->reply_service_context ().service_info ();
00096 }

ACE_INLINE IOP::ServiceContextList & TAO_Operation_Details::reply_service_info void   ) 
 

Definition at line 87 of file operation_details.i.

References reply_service_context(), and TAO_Service_Context::service_info().

00088 {
00089   return this->reply_service_context ().service_info ();
00090 }

ACE_INLINE CORBA::ULong TAO_Operation_Details::request_id void   )  const
 

Return the request ID associated with the operation.

Definition at line 116 of file operation_details.i.

00117 {
00118   return this->request_id_;
00119 }

ACE_INLINE void TAO_Operation_Details::request_id CORBA::ULong  id  ) 
 

Cache the request id.

Definition at line 110 of file operation_details.i.

Referenced by TAO_GIOP_Message_Lite::generate_locate_request_header(), TAO_GIOP_Message_Base::generate_locate_request_header(), TAO_IIOP_Transport::generate_request_header(), TAO::LocateRequest_Invocation_Adapter::invoke(), TAO::Invocation_Adapter::invoke_remote_i(), TAO_GIOP_Message_Lite::write_request_header(), TAO_GIOP_Message_Generator_Parser_12::write_request_header(), and TAO_GIOP_Message_Generator_Parser_10::write_request_header().

00111 {
00112   this->request_id_ = id;
00113 }

ACE_INLINE const TAO_Service_Context & TAO_Operation_Details::request_service_context void   )  const
 

Definition at line 57 of file operation_details.i.

References request_service_info_.

00058 {
00059   return this->request_service_info_;
00060 }

ACE_INLINE TAO_Service_Context & TAO_Operation_Details::request_service_context void   ) 
 

Access the TAO_Service_Context.

Definition at line 51 of file operation_details.i.

References request_service_info_.

Referenced by TAO::Remote_Invocation::init_target_spec(), TAO::Invocation_Base::request_service_context(), request_service_info(), reset_request_service_info(), and TAO_IIOP_Transport::set_bidir_context_info().

00052 {
00053   return this->request_service_info_;
00054 }

ACE_INLINE const IOP::ServiceContextList & TAO_Operation_Details::request_service_info void   )  const
 

Definition at line 69 of file operation_details.i.

References request_service_context(), and TAO_Service_Context::service_info().

00070 {
00071   return this->request_service_context ().service_info ();
00072 }

ACE_INLINE IOP::ServiceContextList & TAO_Operation_Details::request_service_info void   ) 
 

Accessors for the service context list.

Definition at line 63 of file operation_details.i.

References request_service_context(), and TAO_Service_Context::service_info().

Referenced by TAO_GIOP_Message_Generator_Parser_12::write_request_header(), and TAO_GIOP_Message_Generator_Parser_10::write_request_header().

00064 {
00065   return this->request_service_context ().service_info ();
00066 }

ACE_INLINE void TAO_Operation_Details::reset_reply_service_info void   ) 
 

Definition at line 104 of file operation_details.i.

References TAO::unbounded_value_sequence< ServiceContext >::length(), reply_service_context(), and TAO_Service_Context::service_info().

00105 {
00106   this->reply_service_context ().service_info ().length (0);
00107 }

ACE_INLINE void TAO_Operation_Details::reset_request_service_info void   ) 
 

Reset the contents of the service context lists that we hold.

Definition at line 99 of file operation_details.i.

References TAO::unbounded_value_sequence< ServiceContext >::length(), request_service_context(), and TAO_Service_Context::service_info().

00100 {
00101   this->request_service_context ().service_info ().length (0);
00102 }

ACE_INLINE CORBA::Octet TAO_Operation_Details::response_flags void   )  const
 

Get the response flags.

Definition at line 140 of file operation_details.i.

References response_flags_.

00141 {
00142   return this->response_flags_;
00143 }

ACE_INLINE void TAO_Operation_Details::response_flags CORBA::Octet  flags  ) 
 

Set the response flags.

Definition at line 122 of file operation_details.i.

References response_flags_.

Referenced by TAO::Invocation_Adapter::invoke_remote_i(), TAO::Invocation_Adapter::set_response_flags(), TAO_GIOP_Message_Lite::write_request_header(), TAO_GIOP_Message_Generator_Parser_12::write_request_header(), and TAO_GIOP_Message_Generator_Parser_10::write_request_header().

00123 {
00124   this->response_flags_ = flags;
00125 }


Friends And Related Function Documentation

friend class TAO::CSD::FW_Server_Request_Wrapper [friend]
 

Declare FW_Server_Request_Wrapper a friend This friendship makes the FW_Server_Request_Wrapper be able to clone the TAO_Operation_Details data member in TAO_ServerRequest.

Definition at line 70 of file operation_details.h.


Member Data Documentation

TAO_Target_Specification::TAO_Target_Address TAO_Operation_Details::addressing_mode_ [private]
 

Addressing mode for this request.

Definition at line 194 of file operation_details.h.

Referenced by addressing_mode().

TAO::Argument** TAO_Operation_Details::args_ [private]
 

The arguments of this operation. Note that the return value is also an argument

Definition at line 200 of file operation_details.h.

CORBA::Boolean TAO_Operation_Details::argument_flag_ [private]
 

Flag that indicates whether the operation has any arguments. If there are arguments this flag is true, else false.

Definition at line 180 of file operation_details.h.

Referenced by argument_flag().

CORBA::ULong TAO_Operation_Details::ex_count_ [private]
 

Count of the exceptions that operations can throw.

Definition at line 209 of file operation_details.h.

Referenced by ex_count().

TAO::Exception_Data* TAO_Operation_Details::ex_data_ [private]
 

The type of exceptions that the operations can throw.

Definition at line 206 of file operation_details.h.

Referenced by ex_data().

TimeBase::TimeT TAO_Operation_Details::ft_expiration_time_ [private]
 

FT request expiration time (absolute gregorian).

Definition at line 212 of file operation_details.h.

CORBA::Long TAO_Operation_Details::ft_retention_id_ [private]
 

FT request retention id.

Definition at line 215 of file operation_details.h.

CORBA::ULong TAO_Operation_Details::num_args_ [private]
 

Number of arguments including the return value.

Definition at line 203 of file operation_details.h.

Referenced by args_num(), demarshal_args(), and marshal_args().

const char* TAO_Operation_Details::opname_ [private]
 

Name of the operation being invoked.

Definition at line 168 of file operation_details.h.

Referenced by opname().

CORBA::ULong TAO_Operation_Details::opname_len_ [private]
 

Precalculated length of opname_.

Definition at line 171 of file operation_details.h.

Referenced by opname_len().

TAO_Service_Context TAO_Operation_Details::reply_service_info_ [private]
 

The ServiceContextList received from the server side. Only valid when sending a request.

Definition at line 191 of file operation_details.h.

CORBA::ULong TAO_Operation_Details::request_id_ [private]
 

Request ID of this operation.

Definition at line 174 of file operation_details.h.

TAO_Service_Context TAO_Operation_Details::request_service_info_ [private]
 

The ServiceContextList sent to the server side. Only valid when sending a request.

Definition at line 187 of file operation_details.h.

Referenced by request_service_context().

CORBA::Octet TAO_Operation_Details::response_flags_ [private]
 

Response flags.

Definition at line 183 of file operation_details.h.

Referenced by response_flags().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:22:39 2006 for TAO by doxygen 1.3.6