Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / ace / Name_Space.cpp
blob57ebe136393d716ef034e214f401b088913bb49d
1 // Name_Space.cpp
2 #include "ace/Name_Space.h"
3 #include "ace/OS_NS_string.h"
4 #include "ace/OS_NS_stdlib.h"
7 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
9 ACE_Name_Binding::ACE_Name_Binding ()
10 : name_ (),
11 value_ (),
12 type_ (ACE_OS::strdup (""))
14 ACE_TRACE ("ACE_Name_Binding::ACE_Name_Binding");
18 ACE_Name_Binding::~ACE_Name_Binding ()
20 ACE_TRACE ("ACE_Name_Binding::~ACE_Name_Binding");
21 #if defined (ACE_HAS_ALLOC_HOOKS)
22 ACE_Allocator::instance()->free ((void *) this->type_);
23 #else
24 ACE_OS::free ((void *) this->type_);
25 #endif /* ACE_HAS_ALLOC_HOOKS */
28 ACE_Name_Binding::ACE_Name_Binding (const ACE_NS_WString &name,
29 const ACE_NS_WString &value,
30 const char *type)
31 : name_ (name),
32 value_ (value),
33 type_ (type == 0 ? ACE_OS::strdup ("") : ACE_OS::strdup (type))
35 ACE_TRACE ("ACE_Name_Binding::ACE_Name_Binding");
38 ACE_Name_Binding::ACE_Name_Binding (const ACE_Name_Binding &s)
39 : name_ (s.name_),
40 value_ (s.value_),
41 type_ (ACE_OS::strdup (s.type_))
43 ACE_TRACE ("ACE_Name_Binding::ACE_Name_Binding");
46 const ACE_Name_Binding&
47 ACE_Name_Binding::operator = (const ACE_Name_Binding &s)
49 ACE_TRACE ("ACE_Name_Binding::operator =");
51 if (this != &s)
53 #if defined (ACE_HAS_ALLOC_HOOKS)
54 ACE_Allocator::instance()->free ((void *) this->type_);
55 #else
56 ACE_OS::free ((void *) this->type_);
57 #endif /* ACE_HAS_ALLOC_HOOKS */
58 this->name_ = s.name_;
59 this->value_ = s.value_;
60 this->type_ = ACE_OS::strdup (s.type_);
63 return *this;
66 bool
67 ACE_Name_Binding::operator == (const ACE_Name_Binding &s) const
69 ACE_TRACE ("ACE_Name_Binding::operator ==");
70 return this->name_ == s.name_
71 && this->value_ == s.value_
72 && ACE_OS::strcmp (this->type_, s.type_) == 0;
75 ACE_Name_Space::~ACE_Name_Space ()
77 ACE_TRACE ("ACE_Name_Space::~ACE_Name_Space");
80 ACE_END_VERSIONED_NAMESPACE_DECL