summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Collocated_Object.h
blob: e99a114d0eb1d88bf4ca47e6b0be839e696cdaa9 (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
// This may look like C, but it's really -*- C++ -*-
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO
//
// = FILENAME
//    Collocated_Object.h
//
// = DESCRIPTION
//
// ============================================================================

#ifndef TAO_COLLOCATED_OBJECT_H
#define TAO_COLLOCATED_OBJECT_H
#include "ace/pre.h"

#include "portableserver_export.h"
#include "tao/Object.h"

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

class TAO_ServantBase;

class TAO_PortableServer_Export TAO_Collocated_Object : public virtual CORBA_Object
{
public:
  TAO_Collocated_Object (TAO_Stub *p = 0,
                         CORBA::Boolean collocated = 0,
                         TAO_ServantBase *servant = 0);
  // constructor

  virtual ~TAO_Collocated_Object (void);
  // destructor

  virtual TAO_ServantBase *_servant (void) const;
  // return the associated servant (if one exists)

  static TAO_Collocated_Object *_narrow (CORBA::Object_ptr object,
                                         CORBA_Environment &ACE_TRY_ENV =
                                             TAO_default_environment ());
  // Downcast operation

  // = The CORBA_Object methods, check the tao/Object.h file for details
  virtual CORBA::Boolean _is_a (const CORBA::Char *logical_type_id,
                                CORBA_Environment &ACE_TRY_ENV =
                                  TAO_default_environment ());
  virtual CORBA::Boolean _is_equivalent (CORBA_Object_ptr other_obj,
                                         CORBA::Environment &)
    ACE_THROW_SPEC (());
#if (TAO_HAS_MINIMUM_CORBA == 0)
  virtual CORBA::Boolean _non_existent (CORBA_Environment &ACE_TRY_ENV =
                                          TAO_default_environment ());
#endif /* TAO_HAS_MINIMUM_CORBA */
  virtual void *_tao_QueryInterface(ptr_arith_t type);

private:
  // = Unimplemented methods
  TAO_Collocated_Object (const TAO_Collocated_Object &);
  TAO_Collocated_Object &operator = (const TAO_Collocated_Object &);

private:
  TAO_ServantBase *servant_;
  // Servant pointer.  It is 0 except for collocated objects.
};

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

#include "ace/post.h"
#endif /* TAO_COLLOCATED_OBJECT_H */