Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Remote_Invocation.h
blob8c5861f0dd2721ea7fdbdd50050f829f08ee387e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Remote_Invocation.h
7 * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
8 */
9 //=============================================================================
11 #ifndef TAO_REMOTE_INVOCATION_H
12 #define TAO_REMOTE_INVOCATION_H
14 #include /**/ "ace/pre.h"
16 #include "tao/Invocation_Base.h"
17 #include "tao/Transport.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/operation_details.h"
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 class TAO_Operation_Details;
28 class TAO_Target_Specification;
29 class TAO_OutputCDR;
31 namespace TAO
33 class Profile_Transport_Resolver;
34 class Argument;
36 /**
37 * @class Remote_Invocation
39 * @brief Base class for remote invocations.
41 * This class encapsulates some of the common functionalities used by
42 * synchronous, asynchronous, DII and DSI invocations.
45 class TAO_Export Remote_Invocation : public Invocation_Base
47 public:
48 /**
49 * @param otarget The original target on which this invocation
50 * was started. This is there to be passed up to its parent
51 * class.
53 * @param resolver The profile and transport holder.
55 * @param detail Pperation details of the invocation on the target
57 * @param response_expected Flag to indicate whether the
58 * operation encapsulated by @a op returns a response or not.
60 Remote_Invocation (CORBA::Object_ptr otarget,
61 Profile_Transport_Resolver &resolver,
62 TAO_Operation_Details &detail,
63 bool response_expected);
65 /**
66 * @param byte_order The intended byte order for the message output
67 * stream. For use in message gateways that forward messages from
68 * sources with different byte order than the native order.
70 void _tao_byte_order (int byte_order);
72 /**
73 * Get the intended byte order for the message output stream.
74 * In case of gateway messages this could divert from the native
75 * byte order.
77 int _tao_byte_order ();
79 protected:
80 /// Initialize the @a spec.
81 void init_target_spec (TAO_Target_Specification &spec, TAO_OutputCDR& output);
83 /// Write the GIOP header into the stream.
84 void write_header (TAO_OutputCDR &out_stream);
86 /// Marshal the arguments into the stream.
87 void marshal_data (TAO_OutputCDR &cdr);
89 /// Write the message onto the socket
90 Invocation_Status send_message (TAO_OutputCDR &cdr,
91 TAO_Message_Semantics message_semantics,
92 ACE_Time_Value *max_wait_time);
94 protected:
95 /// Our resolver
96 Profile_Transport_Resolver &resolver_;
98 /// Intended byte order for message output stream
99 int byte_order_;
102 struct TAO_Export CDR_Byte_Order_Guard
104 TAO_OutputCDR& cdr_;
105 int byte_order_;
106 int present_byte_order_;
107 void reset ();
108 CDR_Byte_Order_Guard (TAO_OutputCDR&, int);
109 ~CDR_Byte_Order_Guard ();
113 TAO_END_VERSIONED_NAMESPACE_DECL
115 #if defined (__ACE_INLINE__)
116 # include "tao/Remote_Invocation.inl"
117 #endif /* __ACE_INLINE__ */
119 #include /**/ "ace/post.h"
121 #endif /*TAO_REMOTE_INVOCATION_H*/