diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-04 21:25:40 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-04 21:25:40 +0000 |
commit | 7e07ebc30608809dab5a5f11dcab9b8c32abdbc9 (patch) | |
tree | b59f70927804a4f16016ba0db5a3e2e8745191ad | |
parent | af5505b3b4da87a33407b0effd392605c1d91330 (diff) | |
download | ATCD-7e07ebc30608809dab5a5f11dcab9b8c32abdbc9.tar.gz |
Unlined a bunch of methods in CORBA namespace.
-rw-r--r-- | TAO/tao/Context.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/Context.i | 14 | ||||
-rw-r--r-- | TAO/tao/Environment.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/Environment.i | 13 | ||||
-rw-r--r-- | TAO/tao/NVList.cpp | 26 | ||||
-rw-r--r-- | TAO/tao/NVList.i | 26 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/ORB.i | 13 | ||||
-rw-r--r-- | TAO/tao/Object.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Object.i | 6 | ||||
-rw-r--r-- | TAO/tao/Principal.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Principal.i | 7 | ||||
-rw-r--r-- | TAO/tao/Request.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Request.i | 46 | ||||
-rw-r--r-- | TAO/tao/Server_Request.cpp | 10 | ||||
-rw-r--r-- | TAO/tao/Server_Request.i | 11 | ||||
-rw-r--r-- | TAO/tao/Typecode.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/Typecode.i | 14 | ||||
-rw-r--r-- | TAO/tao/ValueBase.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/ValueBase.i | 14 | ||||
-rw-r--r-- | TAO/tao/corbafwd.cpp | 62 | ||||
-rw-r--r-- | TAO/tao/corbafwd.h | 2 | ||||
-rw-r--r-- | TAO/tao/corbafwd.i | 63 |
23 files changed, 204 insertions, 209 deletions
diff --git a/TAO/tao/Context.cpp b/TAO/tao/Context.cpp index 486ab584d3f..5fdbdc2a891 100644 --- a/TAO/tao/Context.cpp +++ b/TAO/tao/Context.cpp @@ -14,6 +14,19 @@ # include "tao/Context.i" #endif /* ! __ACE_INLINE__ */ +CORBA::Boolean +CORBA::is_nil (CORBA::Context_ptr ctx) +{ + return ctx == 0; +} + +void +CORBA::release (CORBA::Context_ptr ctx) +{ + if (ctx) + ctx->_decr_refcnt (); +} + CORBA_Context::CORBA_Context (void) { } diff --git a/TAO/tao/Context.i b/TAO/tao/Context.i index d2ee3370ac1..3182747ac1d 100644 --- a/TAO/tao/Context.i +++ b/TAO/tao/Context.i @@ -4,13 +4,6 @@ // These should never be non-NULL, but the method // is required of pseudo objects. -ACE_INLINE void -CORBA::release (CORBA::Context_ptr ctx) -{ - if (ctx) - ctx->_decr_refcnt (); -} - ACE_INLINE CORBA_Context* CORBA_Context::_duplicate (CORBA_Context* x) { @@ -25,12 +18,6 @@ CORBA_Context::_nil (void) return (CORBA::Context*)0; } -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::Context_ptr ctx) -{ - return ctx == 0; -} - // ************************************************************* // Inline operations for class CORBA_Context_var // ************************************************************* @@ -372,4 +359,3 @@ CORBA_ContextList_out::operator-> (void) { return this->ptr_; } - diff --git a/TAO/tao/Environment.cpp b/TAO/tao/Environment.cpp index 6240f4e93b3..8388202ff1b 100644 --- a/TAO/tao/Environment.cpp +++ b/TAO/tao/Environment.cpp @@ -10,6 +10,19 @@ ACE_RCSID(tao, Environment, "$Id$") +void +CORBA::release (CORBA::Environment_ptr env) +{ + if (env) + env->_decr_refcnt (); +} + +CORBA::Boolean +CORBA::is_nil (CORBA::Environment_ptr env) +{ + return env == 0; +} + #if 0 CORBA_Environment::CORBA_Environment (void) : exception_ (0), diff --git a/TAO/tao/Environment.i b/TAO/tao/Environment.i index 83b618b4413..6d318b17359 100644 --- a/TAO/tao/Environment.i +++ b/TAO/tao/Environment.i @@ -7,19 +7,6 @@ CORBA_Environment::exception (void) const return this->exception_; } -ACE_INLINE void -CORBA::release (CORBA::Environment_ptr env) -{ - if (env) - env->_decr_refcnt (); -} - -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::Environment_ptr env) -{ - return env == 0; -} - // ************************************************************* // Inline operations for class CORBA_Environment_var // ************************************************************* diff --git a/TAO/tao/NVList.cpp b/TAO/tao/NVList.cpp index 36306a455a2..c09e062b13f 100644 --- a/TAO/tao/NVList.cpp +++ b/TAO/tao/NVList.cpp @@ -18,6 +18,19 @@ ACE_RCSID(tao, NVList, "$Id$") // Reference counting for DII Request object +void +CORBA::release (CORBA::NamedValue_ptr nv) +{ + if (nv) + nv->_decr_refcnt (); +} + +CORBA::Boolean +CORBA::is_nil (CORBA::NamedValue_ptr nv) +{ + return nv == 0; +} + CORBA::ULong CORBA_NamedValue::_incr_refcnt (void) { @@ -51,6 +64,19 @@ CORBA_NamedValue::~CORBA_NamedValue (void) // **************************************************************** +void +CORBA::release (CORBA::NVList_ptr nvl) +{ + if (nvl) + nvl->_decr_refcnt (); +} + +CORBA::Boolean +CORBA::is_nil (CORBA::NVList_ptr nvl) +{ + return (CORBA::Boolean) (nvl == 0); +} + CORBA::ULong CORBA_NVList::_incr_refcnt (void) { diff --git a/TAO/tao/NVList.i b/TAO/tao/NVList.i index a4c9c3efd32..d8d0f549a45 100644 --- a/TAO/tao/NVList.i +++ b/TAO/tao/NVList.i @@ -31,19 +31,6 @@ CORBA_NamedValue::flags (void) const return this->flags_; } -ACE_INLINE void -CORBA::release (CORBA::NamedValue_ptr nv) -{ - if (nv) - nv->_decr_refcnt (); -} - -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::NamedValue_ptr nv) -{ - return nv == 0; -} - ACE_INLINE CORBA_NamedValue* CORBA_NamedValue::_duplicate (CORBA_NamedValue *x) { @@ -237,19 +224,6 @@ CORBA_NVList::count (void) const return this->max_; } -ACE_INLINE void -CORBA::release (CORBA::NVList_ptr nvl) -{ - if (nvl) - nvl->_decr_refcnt (); -} - -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::NVList_ptr nvl) -{ - return (CORBA::Boolean) (nvl == 0); -} - ACE_INLINE CORBA_NVList* CORBA_NVList::_duplicate (CORBA_NVList *x) { diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index fe711690686..ec4d8ebce4e 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -79,6 +79,19 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_ORB_Timeprobe_Description, #endif /* ACE_ENABLE_TIMEPROBES */ +void +CORBA::release (CORBA::ORB_ptr obj) +{ + if (obj) + obj->_decr_refcnt (); +} + +CORBA::Boolean +CORBA::is_nil (CORBA::ORB_ptr obj) +{ + return obj == 0; +} + // = Static initialization. // Count of the number of ORBs. diff --git a/TAO/tao/ORB.i b/TAO/tao/ORB.i index dfefa1ac2a1..679df3f3c6b 100644 --- a/TAO/tao/ORB.i +++ b/TAO/tao/ORB.i @@ -290,13 +290,6 @@ CORBA_ORB::_duplicate (CORBA::ORB_ptr obj) return obj; } -ACE_INLINE void -CORBA::release (CORBA::ORB_ptr obj) -{ - if (obj) - obj->_decr_refcnt (); -} - // Null pointers represent nil objects. ACE_INLINE CORBA::ORB_ptr @@ -306,12 +299,6 @@ CORBA_ORB::_nil (void) } ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::ORB_ptr obj) -{ - return obj == 0; -} - -ACE_INLINE CORBA::Boolean CORBA_ORB::orb_free_resources (void) { return !CORBA_ORB::orb_init_count_; diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index be0486dde13..94289bc2c52 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -30,6 +30,12 @@ CORBA::release (CORBA_Object_ptr obj) obj->_decr_refcnt (); } +CORBA::Boolean +CORBA::is_nil (CORBA::Object_ptr obj) +{ + return obj == 0; +} + CORBA_Object::~CORBA_Object (void) { this->protocol_proxy_->_decr_refcnt (); diff --git a/TAO/tao/Object.i b/TAO/tao/Object.i index f06fdef545a..ebf1aaf2e70 100644 --- a/TAO/tao/Object.i +++ b/TAO/tao/Object.i @@ -45,12 +45,6 @@ CORBA_Object::_narrow (CORBA_Object_ptr obj, CORBA::Environment&) return CORBA_Object::_duplicate (obj); } -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::Object_ptr obj) -{ - return obj == 0; -} - ACE_INLINE TAO_Stub * CORBA_Object::_stubobj (void) const { diff --git a/TAO/tao/Principal.cpp b/TAO/tao/Principal.cpp index 1f9331fd41a..db5606873b0 100644 --- a/TAO/tao/Principal.cpp +++ b/TAO/tao/Principal.cpp @@ -21,6 +21,12 @@ CORBA_Principal::~CORBA_Principal (void) { } +CORBA::Boolean +CORBA::is_nil (CORBA::Principal_ptr principal) +{ + return (CORBA::Boolean) (principal == 0); +} + void CORBA::release (CORBA::Principal_ptr principal) { diff --git a/TAO/tao/Principal.i b/TAO/tao/Principal.i index c7cf019dd18..764491d6860 100644 --- a/TAO/tao/Principal.i +++ b/TAO/tao/Principal.i @@ -19,12 +19,6 @@ CORBA_Principal::_decr_refcnt (void) return 0; } -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::Principal_ptr principal) -{ - return (CORBA::Boolean) (principal == 0); -} - ACE_INLINE CORBA_Principal* CORBA_Principal::_duplicate (CORBA_Principal* x) { @@ -200,4 +194,3 @@ CORBA_Principal_out::operator-> (void) { return this->ptr_; } - diff --git a/TAO/tao/Request.cpp b/TAO/tao/Request.cpp index dd99e992717..161cd7883cc 100644 --- a/TAO/tao/Request.cpp +++ b/TAO/tao/Request.cpp @@ -13,6 +13,12 @@ ACE_RCSID(tao, Request, "$Id$") +CORBA::Boolean +CORBA::is_nil (CORBA::Request_ptr req) +{ + return (CORBA::Boolean) (req == 0); +} + void CORBA::release (CORBA::Request_ptr req) { diff --git a/TAO/tao/Request.i b/TAO/tao/Request.i index 6b3d8e56b87..32edec32e42 100644 --- a/TAO/tao/Request.i +++ b/TAO/tao/Request.i @@ -5,12 +5,6 @@ // Return the target of this request. -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::Request_ptr req) -{ - return (CORBA::Boolean) (req == 0); -} - ACE_INLINE CORBA_Request* CORBA_Request::_duplicate (CORBA_Request* x) { @@ -20,38 +14,38 @@ CORBA_Request::_duplicate (CORBA_Request* x) } -ACE_INLINE CORBA::Object_ptr -CORBA_Request::target (void) const -{ - return this->target_; +ACE_INLINE CORBA::Object_ptr +CORBA_Request::target (void) const +{ + return this->target_; } // Return the operation name for the request. ACE_INLINE const CORBA::Char * -CORBA_Request::operation (void) const +CORBA_Request::operation (void) const { - return this->opname_; + return this->opname_; } // Return the arguments for the request. -ACE_INLINE CORBA::NVList_ptr -CORBA_Request::arguments (void) -{ - return this->args_; +ACE_INLINE CORBA::NVList_ptr +CORBA_Request::arguments (void) +{ + return this->args_; } // Return the result for the request. -ACE_INLINE CORBA::NamedValue_ptr -CORBA_Request::result (void) +ACE_INLINE CORBA::NamedValue_ptr +CORBA_Request::result (void) { - return this->result_; + return this->result_; } // Return the exceptions resulting from this request. -ACE_INLINE CORBA::ExceptionList_ptr -CORBA_Request::exceptions (void) -{ - return &this->exceptions_; +ACE_INLINE CORBA::ExceptionList_ptr +CORBA_Request::exceptions (void) +{ + return &this->exceptions_; } // Return the request's contexts @@ -63,9 +57,9 @@ CORBA_Request::contexts (void) // Return the <Environment> for this request. ACE_INLINE CORBA::Environment * -CORBA_Request::env (void) +CORBA_Request::env (void) { - return &this->env_; + return &this->env_; } // The argument manipulation helper functions @@ -297,5 +291,3 @@ CORBA_Request_out::operator-> (void) { return this->ptr_; } - - diff --git a/TAO/tao/Server_Request.cpp b/TAO/tao/Server_Request.cpp index f94cd6709cf..3446a70016a 100644 --- a/TAO/tao/Server_Request.cpp +++ b/TAO/tao/Server_Request.cpp @@ -19,3 +19,13 @@ ACE_RCSID(tao, Server_Request, "$Id$") +CORBA::Boolean +CORBA::is_nil (CORBA_ServerRequest *x) +{ + return x != 0; +} + +void +CORBA::release (CORBA_ServerRequest *) +{ +} diff --git a/TAO/tao/Server_Request.i b/TAO/tao/Server_Request.i index 808df8fd876..b95ffc23940 100644 --- a/TAO/tao/Server_Request.i +++ b/TAO/tao/Server_Request.i @@ -1,12 +1,6 @@ // -*- C++ -*- // $Id$ -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA_ServerRequest *x) -{ - return x != 0; -} - // @@ TODO TAO allocates its ServerRequest objects from the stack, // using reference counting wouldn't help much. Using a _clone() // method would make the following methods really easy to implement, @@ -23,11 +17,6 @@ CORBA_ServerRequest::_duplicate (CORBA_ServerRequest *) return 0; } -ACE_INLINE void -CORBA::release (CORBA_ServerRequest *) -{ -} - ACE_INLINE CORBA_ServerRequest * CORBA_ServerRequest::_nil (void) { diff --git a/TAO/tao/Typecode.cpp b/TAO/tao/Typecode.cpp index 2abaa4b6f2a..36712f19b89 100644 --- a/TAO/tao/Typecode.cpp +++ b/TAO/tao/Typecode.cpp @@ -26,6 +26,20 @@ ACE_RCSID(tao, Typecode, "$Id$") +void +CORBA::release (CORBA::TypeCode_ptr tc) +{ + if (tc) + tc->_decr_refcnt (); +} + +// returns true if the typecode is NULL +CORBA::Boolean +CORBA::is_nil (CORBA::TypeCode_ptr tc) +{ + return tc == 0; +} + CORBA_TypeCode::Bounds::Bounds (void) : CORBA_UserException (CORBA::TypeCode::_tc_Bounds) { @@ -221,7 +235,7 @@ CORBA_TypeCode::CORBA_TypeCode (CORBA::TCKind kind, // field in our CDR representation. Hence, we introduce a new field // called tc_base_ which represents the start of our CDR // representation. The buffer_ data member will point to our - // encapsulation. + // encapsulation. // @@ The typecode buffer contain the encapsulation byte order // in the first byte... diff --git a/TAO/tao/Typecode.i b/TAO/tao/Typecode.i index 6fbf45bdaf9..fb1b54f9778 100644 --- a/TAO/tao/Typecode.i +++ b/TAO/tao/Typecode.i @@ -20,20 +20,6 @@ CORBA_TypeCode::_decr_refcnt (void) return 0; } -ACE_INLINE void -CORBA::release (CORBA::TypeCode_ptr tc) -{ - if (tc) - tc->_decr_refcnt (); -} - -// returns true if the typecode is NULL -ACE_INLINE CORBA::Boolean -CORBA::is_nil (CORBA::TypeCode_ptr tc) -{ - return tc == 0; -} - ACE_INLINE CORBA::TypeCode_ptr CORBA_TypeCode::_duplicate (CORBA::TypeCode_ptr tc) { diff --git a/TAO/tao/ValueBase.cpp b/TAO/tao/ValueBase.cpp index 5d17173684b..e3f64fcebe6 100644 --- a/TAO/tao/ValueBase.cpp +++ b/TAO/tao/ValueBase.cpp @@ -27,6 +27,19 @@ ACE_RCSID(tao, ValueBase, "$Id$") +void +CORBA::add_ref (CORBA::ValueBase *val) +{ + if (val) + val->_add_ref (); +} + +void +CORBA::remove_ref (CORBA::ValueBase *val) +{ + if (val) + val->_remove_ref (); +} // destructor CORBA_ValueBase::~CORBA_ValueBase (void) diff --git a/TAO/tao/ValueBase.i b/TAO/tao/ValueBase.i index 4117def9904..b71395cf9dc 100644 --- a/TAO/tao/ValueBase.i +++ b/TAO/tao/ValueBase.i @@ -3,20 +3,6 @@ // static operations in namespace CORBA ======================== -ACE_INLINE void -CORBA::add_ref (CORBA::ValueBase *val) -{ - if (val) - val->_add_ref (); -} - -ACE_INLINE void -CORBA::remove_ref (CORBA::ValueBase *val) -{ - if (val) - val->_remove_ref (); -} - // =========================================================== // constructor diff --git a/TAO/tao/corbafwd.cpp b/TAO/tao/corbafwd.cpp index e20f6137ebb..a995d68d9fc 100644 --- a/TAO/tao/corbafwd.cpp +++ b/TAO/tao/corbafwd.cpp @@ -6,6 +6,68 @@ # include "tao/corbafwd.i" #endif /* ! __ACE_INLINE__ */ +CORBA::String +CORBA::string_alloc (CORBA::ULong len) +{ + // Allocate 1 + strlen to accomodate the null terminating character. + return new CORBA::Char[size_t (len + 1)]; +} + +void +CORBA::string_free (CORBA::Char *str) +{ + delete [] str; +} + +CORBA::String +CORBA::string_dup (const CORBA::Char *str) +{ + if (!str) + return 0; + + size_t len = ACE_OS::strlen (str); + + // This allocates an extra byte for the '\0'; + CORBA::String copy = CORBA::string_alloc (len); + + ACE_OS::memcpy (copy, str, len + 1); + return copy; +} + +// ---------------------------------------------------------------------- +// Wide strings +// ---------------------------------------------------------------------- + +CORBA::WChar* +CORBA::wstring_alloc (CORBA::ULong len) +{ + return new CORBA::WChar [(size_t) (len + 1)]; +} + +void +CORBA::wstring_free (CORBA::WChar *const str) +{ + delete [] str; +} + +CORBA::WChar* +CORBA::wstring_dup (const WChar *const str) +{ + if (!str) + return 0; + + CORBA::WChar* retval = CORBA::wstring_alloc (ACE_OS::wslen (str)); + return ACE_OS::wscpy (retval, str); +} + +// **************************************************************** + +CORBA_Environment& +CORBA::default_environment () +{ + return TAO_default_environment (); +} + ACE_RCSID(tao, corbafwd, "$Id$") TAO_NAMESPACE_TYPE (const CORBA::ServiceType) diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index 65b2e6672d4..c88e3054688 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -408,6 +408,7 @@ TAO_NAMESPACE CORBA TAO_NAMESPACE_STORAGE_CLASS Char* string_alloc (ULong len); TAO_NAMESPACE_STORAGE_CLASS Char* string_dup (const Char *); TAO_NAMESPACE_STORAGE_CLASS void string_free (Char *); + // This is a TAO extension and must go away.... TAO_NAMESPACE_STORAGE_CLASS Char* string_copy (const Char *); @@ -892,6 +893,7 @@ TAO_NAMESPACE CORBA // = TAO extensions... TAO_NAMESPACE_STORAGE_CLASS CORBA_Environment& default_environment (void); + // Obtain the thread-specific default environment. // This is obsolete and only left here for backwards compatibility. diff --git a/TAO/tao/corbafwd.i b/TAO/tao/corbafwd.i index 6f955350c06..cfa1da318d3 100644 --- a/TAO/tao/corbafwd.i +++ b/TAO/tao/corbafwd.i @@ -1,64 +1 @@ // $Id$ - -ACE_INLINE CORBA::String -CORBA::string_alloc (CORBA::ULong len) -{ - // Allocate 1 + strlen to accomodate the null terminating character. - return new CORBA::Char[size_t (len + 1)]; -} - -ACE_INLINE void -CORBA::string_free (CORBA::Char *str) -{ - delete [] str; -} - -ACE_INLINE CORBA::String -CORBA::string_dup (const CORBA::Char *str) -{ - if (!str) - return 0; - - size_t len = ACE_OS::strlen (str); - - // This allocates an extra byte for the '\0'; - CORBA::String copy = CORBA::string_alloc (len); - - ACE_OS::memcpy (copy, str, len + 1); - return copy; -} - -// ---------------------------------------------------------------------- -// Wide strings -// ---------------------------------------------------------------------- - -ACE_INLINE CORBA::WChar* -CORBA::wstring_alloc (CORBA::ULong len) -{ - return new CORBA::WChar [(size_t) (len + 1)]; -} - -ACE_INLINE void -CORBA::wstring_free (CORBA::WChar *const str) -{ - delete [] str; -} - -ACE_INLINE CORBA::WChar* -CORBA::wstring_dup (const WChar *const str) -{ - if (!str) - return 0; - - CORBA::WChar* retval = CORBA::wstring_alloc (ACE_OS::wslen (str)); - return ACE_OS::wscpy (retval, str); -} - -// **************************************************************** - -ACE_INLINE CORBA_Environment& -CORBA::default_environment () -{ - return TAO_default_environment (); -} - |