Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / LocalObject.h
blobcb8c2a4b5018821ebe0e9ed29c5577b8a4a32847
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file LocalObject.h
7 * Header file for CORBA's base "LocalObject" type.
9 * A "LocalObject" is an entity that can be the target of a local
10 * invocation. See the CORBA Component Model specification for
11 * details.
13 * @author Nanbor Wang <nanbor@cs.wustl.edu>
15 //=============================================================================
18 #ifndef TAO_CORBA_LOCALOBJECT_H
19 #define TAO_CORBA_LOCALOBJECT_H
21 #include /**/ "ace/pre.h"
23 #include "ace/Thread_Mutex.h"
24 #include "ace/Atomic_Op.h"
26 #if !defined (ACE_LACKS_PRAGMA_ONCE)
27 # pragma once
28 #endif /* ACE_LACKS_PRAGMA_ONCE */
30 #include "tao/Object.h"
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 namespace CORBA
36 class LocalObject;
37 typedef LocalObject *LocalObject_ptr;
38 typedef TAO_Pseudo_Var_T<LocalObject> LocalObject_var;
39 typedef TAO_Pseudo_Out_T<LocalObject> LocalObject_out;
41 /**
42 * @class LocalObject
44 class TAO_Export LocalObject : public virtual CORBA::Object
46 public:
47 /// Destructor
48 virtual ~LocalObject ();
50 /// Increment the ref count
51 static LocalObject_ptr _duplicate (LocalObject_ptr obj);
53 /// Return a NIL object
54 static LocalObject_ptr _nil ();
56 /**
57 * @todo Narrowing a LocalObject to a CORBA::Object is broken
58 * right now. The solution seems to be making CORBA::Object an
59 * abstract base class and create a CORBA::RemoteObject for
60 * regular object. Or, even easier, add a @c is_local member into
61 * CORBA::Object. I'll take the easier route for now.
63 static LocalObject_ptr _narrow (CORBA::Object_ptr obj);
65 #if (TAO_HAS_MINIMUM_CORBA == 0)
67 /// Always returns false.
68 virtual CORBA::Boolean _non_existent ();
70 /// Get the repository id.
71 virtual char * _repository_id ();
73 #if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO)
74 /// Gets info about object from the Interface Repository.
75 virtual CORBA::InterfaceDef_ptr _get_interface ();
77 /// Throws NO_IMPLEMENT.
78 virtual CORBA::Object_ptr _get_component ();
80 virtual void _create_request (CORBA::Context_ptr ctx,
81 const char * operation,
82 CORBA::NVList_ptr arg_list,
83 CORBA::NamedValue_ptr result,
84 CORBA::Request_ptr & request,
85 CORBA::Flags req_flags);
87 virtual void _create_request (CORBA::Context_ptr ctx,
88 const char * operation,
89 CORBA::NVList_ptr arg_list,
90 CORBA::NamedValue_ptr result,
91 CORBA::ExceptionList_ptr exclist,
92 CORBA::ContextList_ptr ctxtlist,
93 CORBA::Request_ptr & request,
94 CORBA::Flags req_flags);
96 /// Throws NO_IMPLEMENT.
97 virtual CORBA::Request_ptr _request (const char * operation);
99 #endif
100 #endif /* TAO_HAS_MINIMUM_CORBA */
102 #if (TAO_HAS_CORBA_MESSAGING == 1)
104 /// Throws CORBA::NO_IMPLEMENT.
105 CORBA::Policy_ptr _get_policy (CORBA::PolicyType type);
107 /// Throws CORBA::NO_IMPLEMENT.
108 CORBA::Policy_ptr _get_cached_policy (TAO_Cached_Policy_Type type);
110 /// Throws CORBA::NO_IMPLEMENT.
111 CORBA::Object_ptr _set_policy_overrides (
112 const CORBA::PolicyList & policies,
113 CORBA::SetOverrideType set_add);
115 /// Throws CORBA::NO_IMPLEMENT.
116 CORBA::PolicyList * _get_policy_overrides (
117 const CORBA::PolicyTypeSeq & types);
119 /// Throws CORBA::NO_IMPLEMENT.
120 CORBA::Boolean _validate_connection (
121 CORBA::PolicyList_out inconsistent_policies);
123 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
126 * Return a hash value for this object. The hash is based on the
127 * address of the object. On non-32 bit platforms, the hash may
128 * be non-unique.
130 virtual CORBA::ULong _hash (CORBA::ULong maximum);
133 * Try to determine if this object is the same as @c other_obj.
134 * This method relies on the representation of the object
135 * reference's private state. Since that changes easily (when
136 * different ORB protocols are in use) there is no default
137 * implementation.
139 virtual CORBA::Boolean _is_equivalent (CORBA::Object_ptr other_obj);
141 virtual CORBA::ORB_ptr _get_orb ();
143 // = TAO extensions
145 /// Throws CORBA::NO_IMPLEMENT.
146 virtual TAO::ObjectKey * _key ();
148 /// Useful for template programming.
149 typedef LocalObject_ptr _ptr_type;
150 typedef LocalObject_var _var_type;
151 typedef LocalObject_out _out_type;
153 protected:
154 /// Default constructor.
156 * Make it protected to prevent instantiation of this class.
158 LocalObject ();
160 private:
161 LocalObject (const LocalObject &) = delete;
162 LocalObject & operator = (const LocalObject &) = delete;
164 } // End CORBA namespace
166 TAO_END_VERSIONED_NAMESPACE_DECL
168 #if defined (__ACE_INLINE__)
169 # include "tao/LocalObject.inl"
170 #endif /* __ACE_INLINE__ */
172 #include /**/ "ace/post.h"
174 #endif /* TAO_CORBA_LOCALOBJECT_H */