summaryrefslogtreecommitdiff
path: root/trunk/TAO/tests/CSD_Strategy_Tests/TP_Foo_C/Foo_C_Custom_Proxy.cpp
blob: acd49fa4665af4ecae18c779a9aa2112c71567c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// $Id$
#include "Foo_C_Custom_Proxy.h"
#include "Foo_C_cust_op1.h"
#include "Foo_C_cust_op2.h"
#include "Foo_C_cust_op3.h"
#include "Foo_C_cust_op4.h"
#include "Foo_C_cust_op5.h"
#include "AppHelper.h"


Foo_C_Custom_Proxy::Foo_C_Custom_Proxy(Foo_C_i* servant,
                                       Foo_C_ptr objref,
                                       TAO::CSD::TP_Strategy* strategy)
  : servant_(servant),
    objref_(Foo_C::_duplicate(objref)),
    strategy_(strategy, false)
{
  // This try-catch block is not really necessary, but we have to add it to
  // satisfy the non-exception builds. Since there is actually no exception
  // raised from _add_ref, we just ignore the exception here.
  try
  {
    servant_->_add_ref ();
  }
  catch (...)
  {
  }
}


Foo_C_Custom_Proxy::~Foo_C_Custom_Proxy()
{
  // This try-catch block is not really necessary, but we have to add it to
  // satisfy the non-exception builds. Since there is actually no exception
  // raised from _add_ref, we just ignore the exception here.
  try
  {
    servant_->_remove_ref ();
  }
  catch (...)
  {
  }
}


bool
Foo_C_Custom_Proxy::validate_connection ()
{
  return AppHelper::validate_connection (this->objref_.in ());
}


void
Foo_C_Custom_Proxy::op1(void)
{
  this->objref_->op1();
}


void
Foo_C_Custom_Proxy::op2(CORBA::Long x)
{
  this->objref_->op2(x);
}


CORBA::Long
Foo_C_Custom_Proxy::op3(CORBA::Long x)
{
  CORBA::Long result = this->objref_->op3(x);
  return result;
}


void
Foo_C_Custom_Proxy::op4(CORBA::Long x)
{
  this->objref_->op4(x);
}


void
Foo_C_Custom_Proxy::op5(void)
{
  this->objref_->op5();
}


void
Foo_C_Custom_Proxy::done(void)
{
  this->objref_->done();
}


void
Foo_C_Custom_Proxy::cust_op1(void)
{
  Foo_C_cust_op1_Handle op = new Foo_C_cust_op1(this->servant_);
  this->strategy_->custom_synch_request(op.in());
}


void
Foo_C_Custom_Proxy::cust_op2(long x)
{
  Foo_C_cust_op2_Handle op = new Foo_C_cust_op2(this->servant_, x);
  this->strategy_->custom_synch_request(op.in());
}


long
Foo_C_Custom_Proxy::cust_op3(long x)
{
  Foo_C_cust_op3_Handle op = new Foo_C_cust_op3(this->servant_, x);
  this->strategy_->custom_synch_request(op.in());
  int ret = op->result();
  return ret;
}


void
Foo_C_Custom_Proxy::cust_op4(long x)
{
  Foo_C_cust_op4_Handle op = new Foo_C_cust_op4(this->servant_,x);
  this->strategy_->custom_asynch_request(op.in());
}


void
Foo_C_Custom_Proxy::cust_op5(void)
{
  Foo_C_cust_op5_Handle op = new Foo_C_cust_op5(this->servant_);
  this->strategy_->custom_synch_request(op.in());
  op->result();
}