summaryrefslogtreecommitdiff
path: root/TAO/performance-tests/Cubit/TAO/IDL_Cubit/Cubit_i.h
blob: 4e6b3a422b0c7cdf5be8360c89c687b89741418f (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
137
138
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/tests/IDL_Cubit
//
// = FILENAME
//    Cubit_Client.h
//
// = AUTHOR
//    Andy Gokhale, Sumedh Mungee and Sergio Flores-Gaitan
//
// ============================================================================

#ifndef _CUBIT_I_H
#define _CUBIT_I_H

#include "cubitS.h"

// Forward declarations.
class Cubit_i;

class Cubit_i : public POA_Cubit
{
  // = TITLE
  //    Illustrates how to integrate a servant with the generated
  //    skeleton.
  //
  // = DESCRIPTION
  //    Implementation of the cubit example at the servant side.
  //    Cubes an octet, short, long, struct and union.
public:
  Cubit_i (CORBA::ORB_ptr orb);
  // Constructor

  ~Cubit_i (void);
  // Destructor

  virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ());
  // Returns the default POA for this servant.

  virtual void cube_oneway (CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Test a oneway call.

  virtual void cube_void (CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Test a twoway call.

  virtual CORBA::Octet cube_octet (CORBA::Octet o,
                                   CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube an octet

  virtual CORBA::Short cube_short (CORBA::Short s,
                                   CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube a short

  virtual CORBA::Long cube_long (CORBA::Long l,
                                 CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube a long

  virtual Cubit::Many cube_struct (const Cubit::Many &values,
                                   CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube a struct.

  virtual Cubit::oneof cube_union (const Cubit::oneof &values,
                                   CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube a union.

  virtual void cube_long_sequence (const Cubit::long_seq &input,
                                   Cubit::long_seq_out output,
                                   CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube a sequence.

  virtual void cube_octet_sequence (const Cubit::octet_seq &input,
                                    Cubit::octet_seq_out output,
                                    CORBA::Environment &_env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube an octet sequence.

  virtual void cube_many_sequence (const Cubit::many_seq & input,
                                   Cubit::many_seq_out output,
                                   CORBA::Environment &_tao_environment)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube an Many sequence.

  virtual void cube_rti_data (const Cubit::RtiPacket &input,
                              Cubit::RtiPacket_out output,
                              CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Cube a sequence.

  virtual void shutdown (CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Shutdown routine.

  void set_default_poa (PortableServer::POA_ptr poa);
  // Set default poa.

protected:
  PortableServer::POA_var poa_;

  CORBA::ORB_var orb_;
  // Keep a pointer to the ORB so we can shut it down.
};

class Cubit_Factory_i: public POA_Cubit_Factory
{
  // = TITLE
  //   Cubit_Factory_i
  //
  // = DESCRIPTION
  //   Factory object returning the cubit objrefs
public:
  Cubit_Factory_i (CORBA::ORB_ptr orb);
  // Constructor.

  ~Cubit_Factory_i (void);
  // Destructor.

  virtual Cubit_ptr make_cubit (CORBA::Environment &env)
    ACE_THROW_SPEC ((CORBA::SystemException));
  // Make a cubit object.

  void set_default_poa (PortableServer::POA_ptr poa);

private:
  Cubit_i my_cubit_;
};

#endif /* _CUBIT_I_H */