summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2003-03-24 19:59:53 +0000
committerbala <balanatarajan@users.noreply.github.com>2003-03-24 19:59:53 +0000
commit259204867fe8f25495dd77e592519dd4dc1c36ac (patch)
tree116bd3ce9a8bb7ce5704cb4775f10eb0b2be8376
parentc75631de6f68a876e5467c466cb895360b9ee47e (diff)
downloadATCD-259204867fe8f25495dd77e592519dd4dc1c36ac.tar.gz
ChangeLogTag: Sat Feb 22 09:50:31 2003 Ossama Othman <ossama@uci.edu>
-rw-r--r--TAO/tao/ChangeLog11
-rw-r--r--TAO/tao/Object.cpp8
-rw-r--r--TAO/tao/Object.h146
-rw-r--r--TAO/tao/Object.i4
-rw-r--r--TAO/tao/PortableServer/Collocated_Object.cpp3
5 files changed, 102 insertions, 70 deletions
diff --git a/TAO/tao/ChangeLog b/TAO/tao/ChangeLog
index f668f8c0c33..c0fcc6461e4 100644
--- a/TAO/tao/ChangeLog
+++ b/TAO/tao/ChangeLog
@@ -1,3 +1,14 @@
+Mon Mar 24 13:57:09 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
+
+ * tao/Object.h:
+ * tao/Object.cpp (_is_local):
+ * tao/Object.i: Cosmetic fixes like improved documentation, making
+ most of the member variables private instead of protected
+ etc. Changed the member initializations to suit the above
+ cosmetic fix.
+
+ * tao/PortableServer/Collocated_Object.cpp: Cosmetic fixes.
+
Mon Mar 24 09:16:11 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
* tao/Object.cpp: The return value from the call to
diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp
index 72cd364bdb1..34961b05fd9 100644
--- a/TAO/tao/Object.cpp
+++ b/TAO/tao/Object.cpp
@@ -40,8 +40,8 @@ CORBA::Object::Object (TAO_Stub * protocol_proxy,
CORBA::Boolean collocated,
TAO_Abstract_ServantBase * servant,
TAO_ORB_Core *orb_core)
- : is_collocated_ (collocated)
- , servant_ (servant)
+ : servant_ (servant)
+ , is_collocated_ (collocated)
, is_local_ (0)
, proxy_broker_ (0)
, is_evaluated_ (1)
@@ -75,8 +75,8 @@ CORBA::Object::Object (TAO_Stub * protocol_proxy,
CORBA::Object::Object (IOP::IOR *ior,
TAO_ORB_Core *orb_core)
- : is_collocated_ (0)
- , servant_ (0)
+ : servant_ (0)
+ , is_collocated_ (0)
, is_local_ (0)
, proxy_broker_ (0)
, is_evaluated_ (0)
diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h
index 357207fcdbf..222467765bc 100644
--- a/TAO/tao/Object.h
+++ b/TAO/tao/Object.h
@@ -55,9 +55,13 @@ namespace CORBA
/// Destructor.
virtual ~Object (void);
- /// Address of this variable used in _unchecked_narrow().
- static int _tao_class_id;
-
+ /**
+ * @name Spec defined methods
+ *
+ * These methods are defined here since they are required by the
+ * CORBA spec in a form specified by the C++ mapping.
+ */
+ //@{
/// Increment the ref count.
static CORBA::Object_ptr _duplicate (CORBA::Object_ptr obj);
@@ -71,15 +75,6 @@ namespace CORBA
static CORBA::Object_ptr _unchecked_narrow (Object_ptr obj
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
- /// Used in the implementation of CORBA::Any
- static void _tao_any_destructor (void*);
-
- /// Uninlined part of the now-inlined CORBA::is_nil().
- static CORBA::Boolean is_nil_i (CORBA::Object_ptr obj);
-
- /// Helper function for reading contents of an IOR
- static void tao_object_initialize (Object *);
-
// These calls correspond to over-the-wire operations, or at least
// do so in many common cases. The normal implementation assumes a
// particular simple, efficient, protocol-neutral interface for
@@ -94,13 +89,26 @@ namespace CORBA
/// implementation method and does no remote invocations!
virtual const char* _interface_repository_id (void) const;
- /// Is this object collocated with the servant?
- virtual CORBA::Boolean _is_collocated (void) const;
- /// Is this a local object?
- virtual CORBA::Boolean _is_local (void) const;
+ /**
+ * Return a (potentially non-unique) hash value for this object.
+ * This method relies on the representation of the object
+ * reference's private state. Since that changes easily (when
+ * different ORB protocols are in use) there is no default
+ * implementation.
+ */
+ virtual CORBA::ULong _hash (CORBA::ULong maximum
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
- virtual TAO_Abstract_ServantBase *_servant (void) const;
+ /**
+ * Try to determine if this object is the same as other_obj. This
+ * method relies on the representation of the object reference's
+ * private state. Since that changes easily (when different ORB
+ * protocols are in use) there is no default implementation.
+ */
+ virtual CORBA::Boolean _is_equivalent (CORBA::Object_ptr other_obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC (());
#if (TAO_HAS_MINIMUM_CORBA == 0)
@@ -160,8 +168,7 @@ namespace CORBA
CORBA::Policy_ptr _get_policy (CORBA::PolicyType type
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
- CORBA::Policy_ptr _get_client_policy (CORBA::PolicyType type
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
CORBA::Object_ptr _set_policy_overrides (
const CORBA::PolicyList & policies,
@@ -179,39 +186,18 @@ namespace CORBA
#endif /* TAO_HAS_CORBA_MESSAGING == 1 */
/**
- * Return a (potentially non-unique) hash value for this object.
- * This method relies on the representation of the object
- * reference's private state. Since that changes easily (when
- * different ORB protocols are in use) there is no default
- * implementation.
- */
- virtual CORBA::ULong _hash (CORBA::ULong maximum
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
-
- /**
- * Try to determine if this object is the same as other_obj. This
- * method relies on the representation of the object reference's
- * private state. Since that changes easily (when different ORB
- * protocols are in use) there is no default implementation.
- */
- virtual CORBA::Boolean _is_equivalent (CORBA::Object_ptr other_obj
- ACE_ENV_ARG_DECL_WITH_DEFAULTS)
- ACE_THROW_SPEC (());
-
- /// Return the object key as an out parameter. Caller should release
- /// return value when finished with it.
- virtual TAO_ObjectKey *_key (ACE_ENV_SINGLE_ARG_DECL);
-
- /**
- * Return a reference to the object key of profile in-use.
- * If there's no in-use profile, then the program will
- * probably crash. This method does not create a new copy.
+ * @name Reference Count Managment
+ *
+ * These are the standard CORBA object reference count manipulations
+ * methods.
*/
- // virtual const TAO_ObjectKey &_object_key (void);
+ //@{
+ /// Increment the reference count.
+ virtual void _add_ref (void);
- /// Downcasting this object pointer to some other derived class.
- /// This QueryInterface stuff only work for local object.
- virtual void * _tao_QueryInterface (ptr_arith_t type);
+ /// Decrement the reference count.
+ virtual void _remove_ref (void);
+ //@}
// Useful for template programming.
#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
@@ -219,19 +205,51 @@ namespace CORBA
typedef Object_var _var_type;
#endif /* __GNUC__ */
+ //@} End of CORBA specific methods
+
+
/**
- * @name Reference Count Managment
+ * @name Methods that are TAO specific.
*
- * These are the standard CORBA object reference count manipulations
- * methods.
+ * These methods are defined here as helper functions to be used
+ * by other parts of TAO. Theoretically they shold all start with
+ * tao_. But we have deviated from that principle.
*/
+
//@{
- /// Increment the reference count.
- virtual void _add_ref (void);
+ /// Address of this variable used in _unchecked_narrow().
+ static int _tao_class_id;
- /// Decrement the reference count.
- virtual void _remove_ref (void);
- //@}
+ virtual TAO_Abstract_ServantBase *_servant (void) const;
+
+ /// Is this object collocated with the servant?
+ virtual CORBA::Boolean _is_collocated (void) const;
+
+ /// Is this a local object?
+ virtual CORBA::Boolean _is_local (void) const;
+
+ /// Used in the implementation of CORBA::Any
+ static void _tao_any_destructor (void*);
+
+ /// Uninlined part of the now-inlined CORBA::is_nil().
+ static CORBA::Boolean is_nil_i (CORBA::Object_ptr obj);
+
+ /// Helper function for reading contents of an IOR
+ static void tao_object_initialize (Object *);
+
+ /// Return the object key as an out parameter. Caller should release
+ /// return value when finished with it.
+ virtual TAO_ObjectKey *_key (ACE_ENV_SINGLE_ARG_DECL);
+
+ /// Downcasting this object pointer to some other derived class.
+ /// This QueryInterface stuff only work for local object.
+ virtual void * _tao_QueryInterface (ptr_arith_t type);
+
+#if (TAO_HAS_CORBA_MESSAGING == 1)
+
+ CORBA::Policy_ptr _get_client_policy (CORBA::PolicyType type
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+#endif /*TAO_HAS_CORBA_MESSAGING*/
/// Constructor
Object (TAO_Stub *p,
@@ -277,6 +295,8 @@ namespace CORBA
const IOP::IOR &ior (void) const;
+ //@} End of TAO-specific methods..
+
protected:
/// Initializing a local object.
@@ -290,13 +310,15 @@ namespace CORBA
protected:
+ /// Servant pointer. It is 0 except for collocated objects.
+ TAO_Abstract_ServantBase *servant_;
+
+ private:
+
/// Flag to indicate collocation. It is 0 except for collocated
/// objects.
CORBA::Boolean is_collocated_;
- /// Servant pointer. It is 0 except for collocated objects.
- TAO_Abstract_ServantBase *servant_;
-
/// Specify whether this is a local object or not.
CORBA::Boolean is_local_;
@@ -304,8 +326,6 @@ namespace CORBA
/// getting the right proxy for performing a given call.
TAO_Object_Proxy_Broker *proxy_broker_;
- private:
-
/// Flag to indicate whether the IOP::IOR has been evaluated fully.
Boolean is_evaluated_;
diff --git a/TAO/tao/Object.i b/TAO/tao/Object.i
index 924fac04cba..daff16e9562 100644
--- a/TAO/tao/Object.i
+++ b/TAO/tao/Object.i
@@ -6,8 +6,8 @@
ACE_INLINE
CORBA::Object::Object (int)
- : is_collocated_ (0),
- servant_ (0),
+ : servant_ (0),
+ is_collocated_ (0),
is_local_ (1),
proxy_broker_ (0),
is_evaluated_ (1),
diff --git a/TAO/tao/PortableServer/Collocated_Object.cpp b/TAO/tao/PortableServer/Collocated_Object.cpp
index be4acff5662..516bbd60135 100644
--- a/TAO/tao/PortableServer/Collocated_Object.cpp
+++ b/TAO/tao/PortableServer/Collocated_Object.cpp
@@ -77,7 +77,8 @@ TAO_Collocated_Object::_is_a (const CORBA::Char *logical_type_id
// Direct collocation strategy is used.
if (this->servant_ != 0)
- return this->servant_->_is_a (logical_type_id ACE_ENV_ARG_PARAMETER);
+ return this->_servant ()->_is_a (logical_type_id
+ ACE_ENV_ARG_PARAMETER);
// @@ Maybe we want to change this exception...
ACE_THROW_RETURN (CORBA::INV_OBJREF (), 0);