Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / tests / TransportCurrent / IIOP / IIOP_Server_Request_Interceptor.h
blobed110479a1c901b3ab69f767f943fcdaec29ffcf
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file IIOP_Server_Request_Interceptor.h
7 * Implementation header for the server request interceptor for the
8 * IIOP_Threading test.
10 * @author Iliyan Jeliazkov <iliyan@ociweb.com>
11 * @author Ciju John <johnc@ociweb.com>
13 //=============================================================================
15 #ifndef ISERVER_REQUEST_INTERCEPTOR_H
16 #define ISERVER_REQUEST_INTERCEPTOR_H
18 #include "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "tao/TransportCurrent/IIOP_Transport_Current.h"
26 #include "Server_Request_Interceptor.h"
28 namespace Test
30 class IIOP_Server_Request_Interceptor
31 : public virtual Test::Server_Request_Interceptor
32 , public virtual ::CORBA::LocalObject
34 public:
35 /// Constructor.
36 IIOP_Server_Request_Interceptor (const char* orbid, TEST test);
38 /// Destructor.
39 virtual ~IIOP_Server_Request_Interceptor () = default;
41 /// queries the status of the test
42 virtual bool self_test ();
44 /**
45 * @name Methods Required by the Server Request Interceptor
46 * Interface
48 * These are methods that must be implemented since they are pure
49 * virtual in the abstract base class. They are the canonical
50 * methods required for all server request interceptors.
52 //@{
53 /// Return the name of this ServerRequestinterceptor.
54 virtual char * name ();
56 /// incomming interception point
57 virtual void receive_request_service_contexts (PortableInterceptor::ServerRequestInfo_ptr);
59 /// outgoing interception point
60 virtual void send_reply (PortableInterceptor::ServerRequestInfo_ptr ri);
62 /// outgoing interception point
63 virtual void send_exception (PortableInterceptor::ServerRequestInfo_ptr ri);
65 /// outgoing interception point
66 virtual void send_other (PortableInterceptor::ServerRequestInfo_ptr ri);
67 //@}
69 protected:
70 /// process incomming requests context
71 void inbound_process_context
72 (PortableInterceptor::ServerRequestInfo_ptr ri);
74 /// process outgoing requests context
75 void outbound_process_context
76 (PortableInterceptor::ServerRequestInfo_ptr ri);
78 /// saves the incomming request info
79 void push_request_info (size_t requestID);
81 /// clears the outgoing request info
82 void pop_request_info (size_t requestID);
84 TAO::Transport::IIOP::Current_ptr resolve_iiop_transport_current (const char* orbid);
86 private:
87 /// transport ID dtata structure
88 typedef struct EP {
89 CORBA::UShort port_;
90 CORBA::String_var host_;
92 EP ()
93 : port_(0)
94 , host_ ()
95 {};
97 EP (CORBA::UShort port, const char* host)
98 : port_(port)
99 , host_ (host)
102 bool operator== (const struct EP &ep) const
104 return (this->port_ == ep.port_) &&
105 (strcmp (this->host_.in (), ep.host_.in ()) == 0);
107 bool operator!= (const struct EP &ep) const
109 return !(this->operator== (ep));
111 } EndPoint;
113 private:
114 /// IIOPTraits test status
115 bool iiop_test_successful_;
117 /// Endpoints hash table
118 EndPoint endPoints_[1001];
120 } // namespace Test
122 #endif /* ISERVER_REQUEST_INTERCEPTOR_H */