summaryrefslogtreecommitdiff
path: root/TAO/performance-tests/Pluggable/PP_Test_i.cpp
blob: b1127f11a315c6b2e5fd9ab9a8b2ee544247702f (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
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/performance-tests/Pluggable
//
// = FILENAME
//    PP_Test_i.cpp
//
// = AUTHOR
//    Jeff Parsons <parsons@cs.wustl.edu>
//
// ============================================================================

#include "tao/corba.h"
#include "tao/Timeprobe.h"
#include "PP_Test_i.h"

ACE_RCSID(IDL_Cubit, Cubit_Client, "$Id$")

#if defined (ACE_ENABLE_TIMEPROBES)

static const char *PP_Test_i_Timeprobe_Description[] =
{
  "PP_Test_i::send_oneway - start",
  "PP_Test_i::send_oneway - end",

  "PP_Test_i::send_void - start",
  "PP_Test_i::send_void - end",

  "PP_Test_i::make_pluggable - start",
  "PP_Test_i::make_pluggable - end",

  "PP_Test_i::server_shutdown - start",
  "PP_Test_i::server_shutdown - end"
};

enum
{
  // Timeprobe description table start key 
  PP_TEST_I_SEND_ONEWAY_START = 10100,
  PP_TEST_I_SEND_ONEWAY_END,

  PP_TEST_I_SEND_VOID_START,
  PP_TEST_I_SEND_VOID_END,

  PP_TEST_I_MAKE_PLUGGABLE_START,
  PP_TEST_I_MAKE_PLUGGABLE_END,

  PP_TEST_I_SERVER_SHUTDOWN_START,
  PP_TEST_I_SERVER_SHUTDOWN_END
};

// Setup Timeprobes
ACE_TIMEPROBE_EVENT_DESCRIPTIONS (PP_Test_i_Timeprobe_Description,
                                  PP_TEST_I_SEND_ONEWAY_START);

#endif /* ACE_ENABLE_TIMEPROBES */

// Factory Constructor

Pluggable_Test_Factory_i::Pluggable_Test_Factory_i (CORBA::ORB_ptr orb)
  : my_pluggable_test_ (orb)
{
}

// Factory Destructor

Pluggable_Test_Factory_i::~Pluggable_Test_Factory_i (void)
{
}

Pluggable_Test_ptr
Pluggable_Test_Factory_i::make_pluggable_test (CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException))
{
  ACE_FUNCTION_TIMEPROBE (PP_TEST_I_MAKE_PLUGGABLE_START);
  return my_pluggable_test_._this (env);
}

// Constructor

PP_Test_i::PP_Test_i (CORBA::ORB_ptr orb)
  : orb_ (CORBA::ORB::_duplicate (orb))
{
}

// Destructor

PP_Test_i::~PP_Test_i (void)
{
}

// Oneway send

void
PP_Test_i::send_oneway (CORBA::Environment &)
    ACE_THROW_SPEC ((CORBA::SystemException))
{
  ACE_FUNCTION_TIMEPROBE (PP_TEST_I_SEND_ONEWAY_START);
}

// Twoway send

void
PP_Test_i::send_void (CORBA::Environment &)
    ACE_THROW_SPEC ((CORBA::SystemException))
{
  ACE_FUNCTION_TIMEPROBE (PP_TEST_I_SEND_VOID_START);
}

// Shutdown.

void PP_Test_i::shutdown (CORBA::Environment &)
    ACE_THROW_SPEC ((CORBA::SystemException))
{
  ACE_DEBUG ((LM_DEBUG,
              "%s\n",
              "PP_Test_i is shutting down"));

  ACE_FUNCTION_TIMEPROBE (PP_TEST_I_SERVER_SHUTDOWN_START);

  this->orb_->shutdown ();
}