summaryrefslogtreecommitdiff
path: root/TAO/IIOP/lib/object.i
blob: d0e39792561af1172378f53bc259ef3afbe5ea1d (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
ACE_INLINE void *
CORBA_Object::get_subclass (void)
{
  return sub_;
}

// CORBA dup/release build on top of COM's (why not).

ACE_INLINE void
CORBA_release (CORBA_Object_ptr obj)
{
  if (obj)
    obj->Release ();
}

ACE_INLINE CORBA_Object_ptr
CORBA_Object::_duplicate (CORBA_Object_ptr obj)
{
  if (obj)
    obj->AddRef ();
  return obj;
}

// Null pointers represent nil objects.

ACE_INLINE CORBA_Object_ptr
CORBA_Object::_nil (void)
{
  return 0;
}

ACE_INLINE CORBA_Boolean
CORBA_is_nil (CORBA_Object_ptr	obj)
{
  return (CORBA_Boolean) (obj == 0);
}

// Constructor and destructor are accessible to subclasses

ACE_INLINE
CORBA_Object::CORBA_Object (IUnknown *_jan)
  : parent_ (_jan),
    orb_ (0)
{
  //    assert (parent != 0);
  // we removed this as it doesn't fit in our schema of things
}

ACE_INLINE void
CORBA_Object::set_parent (IUnknown *p)
{
  this->parent_ = p;
  assert (this->parent_ != 0);
}

ACE_INLINE void
CORBA_Object::orb (CORBA_ORB_ptr orb)
{
  orb_ = orb;
}

ACE_INLINE CORBA_ORB_ptr
CORBA_Object::orb (void) const
{
  return orb_;
}

ACE_INLINE
CORBA_Object::~CORBA_Object (void)
{
}

// DII hook to objref
//
// The mapping for create_request is split into two forms,
// corresponding to the two usage styles described in CORBA section
// 6.2.1.

ACE_INLINE void __stdcall
CORBA_Object::_create_request (const CORBA_Char *operation,
			       CORBA_NVList_ptr arg_list,
			       CORBA_NamedValue_ptr result,
			       CORBA_Request_ptr &request,
			       CORBA_Flags req_flags,
			       CORBA_Environment &env)
{
  env.clear ();
  request = new CORBA_Request (this, operation, arg_list, result, req_flags);
}

ACE_INLINE CORBA_Request_ptr __stdcall
CORBA_Object::_request (const CORBA_Char *operation,
			CORBA_Environment &env)
{
  env.clear ();
  return new CORBA_Request (this, operation);
}

ACE_INLINE ULONG __stdcall
CORBA_Object::AddRef (void)
{
  return parent_->AddRef ();
}

ACE_INLINE ULONG __stdcall
CORBA_Object::Release (void)
{
  return parent_->Release ();
}

ACE_INLINE HRESULT __stdcall
CORBA_Object::QueryInterface (REFIID riid,
                              void **ppv)
{
  return parent_->QueryInterface (riid, ppv);
}