summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-11-04 03:25:49 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-11-04 03:25:49 +0000
commit124d6257e3a9289beecafca7ee286cd3ea2723de (patch)
treea67b22b3f37ccbf323543bfdbfc8e81605ca4b2f
parentd580b3eaa9462f8ffa082ae18c215b97c8a7b333 (diff)
downloadATCD-124d6257e3a9289beecafca7ee286cd3ea2723de.tar.gz
(get_preallocated_{object,array}): inlined function definitions into the class header
-rw-r--r--ace/Managed_Object.h34
-rw-r--r--ace/Managed_Object.i38
2 files changed, 32 insertions, 40 deletions
diff --git a/ace/Managed_Object.h b/ace/Managed_Object.h
index 1cc6cd2d02c..523fcf1c6fd 100644
--- a/ace/Managed_Object.h
+++ b/ace/Managed_Object.h
@@ -93,17 +93,43 @@ class ACE_Managed_Object
// the ACE library.
{
public:
- static ACE_INLINE TYPE *
- get_preallocated_object (ACE_Object_Manager::Preallocated_Object id);
+ static TYPE *
+ get_preallocated_object (ACE_Object_Manager::Preallocated_Object id)
+ {
+ // The preallocated objects are in a separate, "read-only" array so
+ // that this function doesn't need a lock. Also, because it is
+ // intended _only_ for use with hard-code values, it performs no
+ // range checking on "id".
+
+ // Cast the return type of the the object pointer based
+ // on the type of the function template parameter.
+ return &((ACE_Cleanup_Adapter<TYPE> *)
+ ACE_Object_Manager::preallocated_object[id])->object ();
+ }
// Get the preallocated object identified by "id". Returns a
// pointer to the object. Beware: no error indication is provided,
// because it can _only_ be used for accessing preallocated objects.
+ // Note: the function definition is inlined here so that it compiles
+ // on AIX 4.1 w/xlC v. 3.01.
+
+ static TYPE *
+ get_preallocated_array (ACE_Object_Manager::Preallocated_Array id)
+ {
+ // The preallocated array are in a separate, "read-only" array so
+ // that this function doesn't need a lock. Also, because it is
+ // intended _only_ for use with hard-code values, it performs no
+ // range checking on "id".
- static ACE_INLINE TYPE *
- get_preallocated_array (ACE_Object_Manager::Preallocated_Array id);
+ // Cast the return type of the the object pointer based
+ // on the type of the function template parameter.
+ return &((ACE_Cleanup_Adapter<TYPE> *)
+ ACE_Object_Manager::preallocated_array[id])->object ();
+ }
// Get the preallocated array identified by "id". Returns a
// pointer to the array. Beware: no error indication is provided,
// because it can _only_ be used for accessing preallocated arrays.
+ // Note: the function definition is inlined here so that it compiles
+ // on AIX 4.1 w/xlC v. 3.01.
private:
// Disallow instantiation of this class.
diff --git a/ace/Managed_Object.i b/ace/Managed_Object.i
index c87fe9ff691..d4dd6043418 100644
--- a/ace/Managed_Object.i
+++ b/ace/Managed_Object.i
@@ -1,11 +1,11 @@
/* -*- C++ -*- */
// $Id$
-// Note: don't explicitly initialize "object_", because TYPE may not
-// have a default constructor. Let the compiler figure it out . . .
template <class TYPE>
ACE_INLINE
ACE_Cleanup_Adapter<TYPE>::ACE_Cleanup_Adapter (void)
+ // Note: don't explicitly initialize "object_", because TYPE may not
+ // have a default constructor. Let the compiler figure it out . . .
{
}
@@ -16,37 +16,3 @@ ACE_Cleanup_Adapter<TYPE>::object (void)
{
return this->object_;
}
-
-template <class TYPE>
-ACE_INLINE
-TYPE *
-ACE_Managed_Object<TYPE>::get_preallocated_object
- (ACE_Object_Manager::Preallocated_Object id)
-{
- // The preallocated objects are in a separate, "read-only" array so
- // that this function doesn't need a lock. Also, because it is
- // intended _only_ for use with hard-code values, it performs no
- // range checking on "id".
-
- // Cast the return type of the the object pointer based
- // on the type of the function template parameter.
- return &((ACE_Cleanup_Adapter<TYPE> *)
- ACE_Object_Manager::preallocated_object[id])->object ();
-}
-
-template <class TYPE>
-ACE_INLINE
-TYPE *
-ACE_Managed_Object<TYPE>::get_preallocated_array
- (ACE_Object_Manager::Preallocated_Array id)
-{
- // The preallocated array are in a separate, "read-only" array so
- // that this function doesn't need a lock. Also, because it is
- // intended _only_ for use with hard-code values, it performs no
- // range checking on "id".
-
- // Cast the return type of the the object pointer based
- // on the type of the function template parameter.
- return &((ACE_Cleanup_Adapter<TYPE> *)
- ACE_Object_Manager::preallocated_array[id])->object ();
-}