summaryrefslogtreecommitdiff
path: root/TAO/tao/RT_Current.h
blob: fe212468c8fe90ab81b56f9816f2392cc7c72bf2 (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
139
140
141
142
143
144
145
146
147
148
// $Id$

// ============================================================================
//
// = LIBRARY
//   TAO
//
// = FILENAME
//   RT_Current.h
//
// = AUTHOR
//   Carlos O'Ryan (coryan@cs.wustl.edu)
//
// ============================================================================

#ifndef TAO_RT_CURRENT_H
#define TAO_RT_CURRENT_H

#include "tao/rtcorbafwd.h"

#if defined (TAO_HAS_RT_CORBA)

#include "tao/Exception.h"
#include "tao/CurrentC.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

class TAO_RT_Current_var;
class TAO_RT_Current;
typedef TAO_RT_Current *TAO_RT_Current_ptr;

class TAO_Export TAO_RT_Current : public CORBA_Current
{
  // = TITLE
  //   The interface for accessing and setting the priority of the
  //   current thread.
  //
  // = DESCRIPTION
  //   Check the RT-CORBA spec (orbos/99-02-12) secions 4.6
  //
public:
  TAO_RT_Current (TAO_Stub *stub);
  // Default constructor

  virtual ~TAO_RT_Current (void);
  // The destructor

#if !defined(__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8)
  typedef TAO_RT_Current_ptr _ptr_type;
  typedef TAO_RT_Current_var _var_type;
#endif /* ! __GNUC__ || g++ >= 2.8 */

    // the static operations
    static TAO_RT_Current_ptr _duplicate (TAO_RT_Current_ptr obj);
    static TAO_RT_Current_ptr _narrow (
        CORBA::Object_ptr obj,
        CORBA::Environment &env =
          TAO_default_environment ()
      );
    static TAO_RT_Current_ptr _nil (void)
    {
      return (RTCORBA::Current_ptr)0;
    }

  virtual RTCORBA::Priority the_priority (
        CORBA::Environment &ACE_TRY_ENV =
          TAO_default_environment ()
      )
      ACE_THROW_SPEC ((
        CORBA::SystemException
      ));

  virtual void the_priority (
        RTCORBA::Priority the_priority,
        CORBA::Environment &ACE_TRY_ENV =
          TAO_default_environment ()
      )
      ACE_THROW_SPEC ((
        CORBA::SystemException
      ));

  virtual CORBA::Boolean _is_a (
        const char *type_id,
        CORBA::Environment &env =
          TAO_default_environment ()
      );
  virtual const char* _interface_repository_id (void) const;

private:
  TAO_RT_Current (const TAO_RT_Current &);
  void operator= (const TAO_RT_Current &);
};

// ****************************************************************

class TAO_Export TAO_RT_Current_var
{
public:
  TAO_RT_Current_var (void);
  TAO_RT_Current_var (TAO_RT_Current_ptr);
  TAO_RT_Current_var (const TAO_RT_Current_var &);
  ~TAO_RT_Current_var (void);

  TAO_RT_Current_var &operator= (TAO_RT_Current_ptr);
  TAO_RT_Current_var &operator= (const TAO_RT_Current_var &);
  TAO_RT_Current_ptr operator-> (void) const;

  operator const TAO_RT_Current_ptr &() const;
  operator TAO_RT_Current_ptr &();
  // in, inout, out, _retn
  TAO_RT_Current_ptr in (void) const;
  TAO_RT_Current_ptr &inout (void);
  TAO_RT_Current_ptr &out (void);
  TAO_RT_Current_ptr _retn (void);
  TAO_RT_Current_ptr ptr (void) const;

private:
  TAO_RT_Current_ptr ptr_;
};

// ****************************************************************

class TAO_Export TAO_RT_Current_out
{
public:
  TAO_RT_Current_out (TAO_RT_Current_ptr &);
  TAO_RT_Current_out (TAO_RT_Current_var &);
  TAO_RT_Current_out (const TAO_RT_Current_out &);
  TAO_RT_Current_out &operator= (const TAO_RT_Current_out &);
  TAO_RT_Current_out &operator= (const TAO_RT_Current_var &);
  TAO_RT_Current_out &operator= (TAO_RT_Current_ptr);
  operator TAO_RT_Current_ptr &();
  TAO_RT_Current_ptr &ptr (void);
  TAO_RT_Current_ptr operator-> (void);

private:
  TAO_RT_Current_ptr &ptr_;
};

#if defined (__ACE_INLINE__)
# include "tao/RT_Current.i"
#endif /* __ACE_INLINE__ */

#endif /* TAO_HAS_RT_CORBA */

#endif /* TAO_RT_CURRENT_H */