Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / DevGuideExamples / PortableInterceptors / Auth / ClientInterceptor.cpp
blobd111a653ff0b1715316da3731431054a5b77151d
1 #include "ClientInterceptor.h"
2 #include "tao/OctetSeqC.h"
3 #include "tao/PI/ClientRequestInfo.h"
4 #include "ace/OS_NS_string.h"
5 #include <iostream>
7 const CORBA::ULong service_ctx_id = 0xdeed;
9 ClientInterceptor::
10 ClientInterceptor ()
11 : myname_ ("Client_Authentication_Interceptor")
13 std::cout << "Calling ClientInterceptor constructor." << std::endl;
16 ClientInterceptor::~ClientInterceptor ()
20 char *
21 ClientInterceptor::name ()
23 std::cout << "Calling ClientInterceptor name() method" << std::endl;
24 return CORBA::string_dup (this->myname_);
27 void
28 ClientInterceptor::destroy ()
32 void
33 ClientInterceptor::send_poll (
34 PortableInterceptor::ClientRequestInfo_ptr)
36 std::cout << "Calling send_poll()." << std::endl;
40 void
41 ClientInterceptor::send_request (
42 PortableInterceptor::ClientRequestInfo_ptr ri)
44 std::cout << "Calling send_request()." << std::endl;
46 IOP::ServiceContext sc;
47 sc.context_id = service_ctx_id;
49 const char user_name[] = "Ron Klein";
50 std::cout << "User's Name: " << user_name << std::endl;
51 CORBA::ULong string_len = sizeof (user_name) + 1;
52 CORBA::Octet *buf = 0;
54 buf = new CORBA::Octet [string_len];
56 ACE_OS::strcpy (reinterpret_cast<char*> (buf), user_name);
58 sc.context_data.replace (string_len, string_len, buf, true);
60 // Add this context to the service context list.
61 ri->add_request_service_context (sc, false);
64 void
65 ClientInterceptor::receive_reply (
66 PortableInterceptor::ClientRequestInfo_ptr ri)
68 ACE_UNUSED_ARG(ri);
69 std::cout << "Calling receive_reply()." << std::endl;
72 void
73 ClientInterceptor::receive_other (
74 PortableInterceptor::ClientRequestInfo_ptr)
76 std::cout << "Calling receive_other()." << std::endl;
79 void
80 ClientInterceptor::receive_exception (
81 PortableInterceptor::ClientRequestInfo_ptr ri)
83 ACE_UNUSED_ARG(ri);
84 std::cout << "Calling receive_exception()." << std::endl;