From b6245769053a32e00ac22fd4c9330c0d8904707d Mon Sep 17 00:00:00 2001 From: levine Date: Wed, 24 Sep 1997 14:36:08 +0000 Subject: removed ACE_Managed_Object get_object () interface --- ace/Managed_Object.cpp | 56 -------------------------------------------------- 1 file changed, 56 deletions(-) (limited to 'ace/Managed_Object.cpp') diff --git a/ace/Managed_Object.cpp b/ace/Managed_Object.cpp index 5ca197c1383..9c915a4366e 100644 --- a/ace/Managed_Object.cpp +++ b/ace/Managed_Object.cpp @@ -5,66 +5,10 @@ #if !defined (ACE_MANAGED_OBJECT_CPP) #define ACE_MANAGED_OBJECT_CPP -#include "ace/Object_Manager.h" #include "ace/Managed_Object.h" -#if !defined (ACE_TEMPLATES_REQUIRE_SOURCE) -# include "ace/Synch.h" -#endif /* !ACE_TEMPLATES_REQUIRE_SOURCE */ #if !defined (__ACE_INLINE__) #include "ace/Managed_Object.i" #endif /* __ACE_INLINE__ */ -template -int -ACE_Managed_Object::get_object (int &id, TYPE *&object) -{ - // Use the ACE_Object_Manager instance's lock. - ACE_MT (ACE_Thread_Mutex &lock = *ACE_Object_Manager::instance ()->lock_); - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, lock, -1)); - - if (id == 0) - { - // User is requesting a new object. - if (ACE_Object_Manager::next_managed_object < ACE_MAX_MANAGED_OBJECTS) - { - // Allocate a new object, store it in the table, and return it. - ACE_NEW_RETURN (object, TYPE, -1); - if (object == 0) - { - errno = ENOMEM; - return -1; - } - else - { - id = ACE_Object_Manager::next_managed_object + 1; - ACE_Object_Manager::managed_object[ - ACE_Object_Manager::next_managed_object++] = object; - return 0; - } - } - else - { - // No more managed_object table slots. - object = 0; - errno = ENOSPC; - return -1; - } - } - else if (id < 0 || (u_int) id > ACE_Object_Manager::next_managed_object) - { - // Unknown, non-zero, or negative id. - object = 0; - errno = ENOENT; - return -1; - } - else - { - // id is known, so return the object. Cast its type based - // on the type of the function template parameter. - object = (TYPE *) ACE_Object_Manager::managed_object[id - 1]; - return 0; - } -} - #endif /* ACE_MANAGED_OBJECT_CPP */ -- cgit v1.2.1