diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-08-29 11:30:58 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-08-29 11:30:58 +0000 |
commit | 27877f4987f26a7adc0b48f648a5eb2fcca21c76 (patch) | |
tree | 42a0207b4390bbce28315787e2e6845e593a4f6d /ACE/ace/Event_Handler.cpp | |
parent | 174478f8f8453519d778f93a7666039c0cd04b3b (diff) | |
download | ATCD-27877f4987f26a7adc0b48f648a5eb2fcca21c76.tar.gz |
Fri Aug 29 11:32:31 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Event_Handler.h:
* ace/Event_Handler.cpp:
* tests/Reactor_Remove_Resume_Test.cpp:
Added new operator bool, operator==(nullptr),
and operator==(!nullptr) to easily check whether the
ACE_Event_Handler_var has a pointer or not. These
new operators are only enabled with C++11 features enabled
Diffstat (limited to 'ACE/ace/Event_Handler.cpp')
-rw-r--r-- | ACE/ace/Event_Handler.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/ACE/ace/Event_Handler.cpp b/ACE/ace/Event_Handler.cpp index 445f97484c3..7054cd872da 100644 --- a/ACE/ace/Event_Handler.cpp +++ b/ACE/ace/Event_Handler.cpp @@ -14,8 +14,6 @@ #include <algorithm> - - ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Implement conceptually abstract virtual functions in the base class @@ -374,6 +372,26 @@ ACE_Event_Handler_var::reset (ACE_Event_Handler *p) *this = p; } +#if defined (ACE_HAS_CPP11) +ACE_Event_Handler_var::operator bool() const +{ + return this->ptr_ == nullptr ? false : true; +} + +bool +ACE_Event_Handler_var::operator ==(std::nullptr_t) const +{ + return this->ptr_ == nullptr ? true : false; +} + +bool +ACE_Event_Handler_var::operator !=(std::nullptr_t) const +{ + return this->ptr_ == nullptr ? false : true; + +} +#endif /* ACE_HAS_CPP11 */ + // --------------------------------------------------------------------- ACE_Notification_Buffer::ACE_Notification_Buffer (void) |