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.

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

void use_stub_args (CORBA::Boolean use_stub_arguments)
 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.

TAO::Collocated_Arguments_Converter * cac (void) const
 Accessor for cac_ pointer.

void cac (TAO::Collocated_Arguments_Converter *cac)
 Marshals the list of <this->arg_> into the cdr.

TAO_Reply_Dispatcherreply_dispatcher (void) const
 Marshals the list of <this->arg_> into the cdr.

void reply_dispatcher (TAO_Reply_Dispatcher *rd)
 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::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.

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

CORBA::Long ft_retention_id_
 FT request retention id.

TAO::Collocated_Arguments_Converter * cac_
 The optional collocated arguments converter.

TAO_Reply_Dispatcherreply_dispatcher_
 The optional reply dispatcher.


Public Member Functions

 TAO_Operation_Details (const char *name, CORBA::ULong len, 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)
 Reset the contents of the service context lists that we hold.

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) const
bool has_exception (::CORBA::Exception &ex) const
 Check whether exception ex is in the signature of this operation.


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 64 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,
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.inl.

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


Member Function Documentation

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

Set method for the addressing mode.

Definition at line 153 of file operation_details.inl.

References addressing_mode_.

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

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

Accessor method for the addressing mode.

Definition at line 147 of file operation_details.inl.

References addressing_mode_.

00148 {
00149   return this->addressing_mode_;
00150 }

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

Accessors for the argument list.

Definition at line 164 of file operation_details.inl.

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

00165 {
00166   return this->args_;
00167 }

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

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

Definition at line 170 of file operation_details.inl.

References num_args_.

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

00171 {
00172   return this->num_args_;
00173 }

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 46 of file operation_details.inl.

References num_args_.

Referenced by TAO_GIOP_Message_Generator_Parser_12::write_request_header().

00047 {
00048   return (this->num_args_ > 1);
00049 }

ACE_INLINE void TAO_Operation_Details::cac TAO::Collocated_Arguments_Converter *  cac  ) 
 

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

Definition at line 220 of file operation_details.inl.

References cac_.

00221 {
00222   this->cac_ = cac;
00223 }

ACE_INLINE TAO::Collocated_Arguments_Converter * TAO_Operation_Details::cac void   )  const
 

Accessor for cac_ pointer.

Definition at line 214 of file operation_details.inl.

References cac_.

00215 {
00216   return this->cac_;
00217 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::Exception * TAO_Operation_Details::corba_exception const char *  ex  )  const
 

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 TAO::Exception_Data::alloc, ex_count_, ex_data_, and ACE_OS::strcmp().

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

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

bool TAO_Operation_Details::demarshal_args TAO_InputCDR cdr  ) 
 

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

Definition at line 80 of file operation_details.cpp.

References num_args_.

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

00081 {
00082   for (CORBA::ULong i = 0; i != this->num_args_; ++i)
00083     {
00084       if (!((*this->args_[i]).demarshal (cdr)))
00085         return false;
00086     }
00087 
00088   return true;
00089 }

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

Exception count.

Definition at line 129 of file operation_details.inl.

References ex_count_.

00130 {
00131   return this->ex_count_;
00132 }

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 135 of file operation_details.inl.

References ex_data_.

00136 {
00137   return this->ex_data_;
00138 }

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::has_exception ::CORBA::Exception ex  )  const
 

Check whether exception ex is in the signature of this operation.

Definition at line 50 of file operation_details.cpp.

References CORBA::Exception::_rep_id(), ex_count_, ex_data_, TAO::Exception_Data::id, and ACE_OS::strcmp().

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

00051 {
00052   for (CORBA::ULong i = 0; i != this->ex_count_; ++i)
00053     {
00054       if (ACE_OS::strcmp (ex._rep_id (), this->ex_data_[i].id) == 0)
00055         {
00056           return true;
00057         }
00058     }
00059   return false;
00060 }

bool TAO_Operation_Details::marshal_args TAO_OutputCDR cdr  ) 
 

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

Definition at line 63 of file operation_details.cpp.

References TAO_OutputCDR::more_fragments(), and num_args_.

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

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

ACE_INLINE const char * TAO_Operation_Details::opname void   )  const
 

Operation name.

Definition at line 34 of file operation_details.inl.

References opname_.

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

00035 {
00036   return this->opname_;
00037 }

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

Length of the operation name.

Definition at line 40 of file operation_details.inl.

References opname_len_.

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

00041 {
00042   return this->opname_len_;
00043 }

ACE_INLINE void TAO_Operation_Details::reply_dispatcher TAO_Reply_Dispatcher rd  ) 
 

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

Definition at line 232 of file operation_details.inl.

References reply_dispatcher_.

00233 {
00234   this->reply_dispatcher_ = rd;
00235 }

ACE_INLINE TAO_Reply_Dispatcher * TAO_Operation_Details::reply_dispatcher void   )  const
 

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

Definition at line 226 of file operation_details.inl.

References reply_dispatcher_.

00227 {
00228   return this->reply_dispatcher_;
00229 }

ACE_INLINE const TAO_Service_Context & TAO_Operation_Details::reply_service_context void   )  const
 

Definition at line 82 of file operation_details.inl.

00083 {
00084   return this->reply_service_info_;
00085 }

ACE_INLINE TAO_Service_Context & TAO_Operation_Details::reply_service_context void   ) 
 

Definition at line 76 of file operation_details.inl.

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

00077 {
00078   return this->reply_service_info_;
00079 }

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

Definition at line 94 of file operation_details.inl.

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

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

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

Definition at line 88 of file operation_details.inl.

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

Referenced by TAO::LocateRequest_Invocation::invoke(), and TAO::Synch_Twoway_Invocation::remote_twoway().

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

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

Return the request ID associated with the operation.

Definition at line 117 of file operation_details.inl.

00118 {
00119   return this->request_id_;
00120 }

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

Cache the request id.

Definition at line 111 of file operation_details.inl.

Referenced by 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_Generator_Parser_12::write_request_header(), and TAO_GIOP_Message_Generator_Parser_10::write_request_header().

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

ACE_INLINE const TAO_Service_Context & TAO_Operation_Details::request_service_context void   )  const
 

Definition at line 58 of file operation_details.inl.

References request_service_info_.

00059 {
00060   return this->request_service_info_;
00061 }

ACE_INLINE TAO_Service_Context & TAO_Operation_Details::request_service_context void   ) 
 

Access the TAO_Service_Context.

Definition at line 52 of file operation_details.inl.

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

00053 {
00054   return this->request_service_info_;
00055 }

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

Definition at line 70 of file operation_details.inl.

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

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

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

Accessors for the service context list.

Definition at line 64 of file operation_details.inl.

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

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

ACE_INLINE void TAO_Operation_Details::reset_reply_service_info void   ) 
 

Definition at line 105 of file operation_details.inl.

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

Referenced by TAO::Invocation_Adapter::invoke_i().

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

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 100 of file operation_details.inl.

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

Referenced by TAO::Invocation_Adapter::invoke_i().

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

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

Get the response flags.

Definition at line 141 of file operation_details.inl.

References response_flags_.

00142 {
00143   return this->response_flags_;
00144 }

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

Set the response flags.

Definition at line 123 of file operation_details.inl.

References response_flags_.

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

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

ACE_INLINE void TAO_Operation_Details::use_stub_args CORBA::Boolean  use_stub_arguments  ) 
 

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

Definition at line 182 of file operation_details.inl.

References use_stub_args_.

00183 {
00184   this->use_stub_args_ = use_stub_args;
00185 }

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

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

Definition at line 176 of file operation_details.inl.

References use_stub_args_.

00177 {
00178   return this->use_stub_args_;
00179 }


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 71 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 200 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 206 of file operation_details.h.

TAO::Collocated_Arguments_Converter* TAO_Operation_Details::cac_ [private]
 

The optional collocated arguments converter.

Definition at line 230 of file operation_details.h.

Referenced by cac().

CORBA::ULong TAO_Operation_Details::ex_count_ [private]
 

Count of the exceptions that operations can throw.

Definition at line 215 of file operation_details.h.

Referenced by corba_exception(), ex_count(), and has_exception().

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

The type of exceptions that the operations can throw.

Definition at line 212 of file operation_details.h.

Referenced by corba_exception(), ex_data(), and has_exception().

TimeBase::TimeT TAO_Operation_Details::ft_expiration_time_ [private]
 

FT request expiration time (absolute gregorian).

Definition at line 223 of file operation_details.h.

CORBA::Long TAO_Operation_Details::ft_retention_id_ [private]
 

FT request retention id.

Definition at line 226 of file operation_details.h.

CORBA::ULong TAO_Operation_Details::num_args_ [private]
 

Number of arguments including the return value.

Definition at line 209 of file operation_details.h.

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

const char* TAO_Operation_Details::opname_ [private]
 

Name of the operation being invoked.

Definition at line 180 of file operation_details.h.

Referenced by opname().

CORBA::ULong TAO_Operation_Details::opname_len_ [private]
 

Precalculated length of opname_.

Definition at line 183 of file operation_details.h.

Referenced by opname_len().

TAO_Reply_Dispatcher* TAO_Operation_Details::reply_dispatcher_ [private]
 

The optional reply dispatcher.

Definition at line 233 of file operation_details.h.

Referenced by reply_dispatcher().

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

CORBA::ULong TAO_Operation_Details::request_id_ [private]
 

Request ID of this operation.

Definition at line 186 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 193 of file operation_details.h.

Referenced by request_service_context().

CORBA::Octet TAO_Operation_Details::response_flags_ [private]
 

Response flags.

Definition at line 189 of file operation_details.h.

Referenced by response_flags().

CORBA::Boolean TAO_Operation_Details::use_stub_args_ [private]
 

Boolean flag to indicate whether in the skeletons the stub arguments stored in these operation details should be used or not.

Definition at line 219 of file operation_details.h.

Referenced by use_stub_args().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:15:38 2008 for TAO by doxygen 1.3.6