ACE_Event_Handler_var Class Reference

Auto pointer like class for Event Handlers. More...

#include <Event_Handler.h>

Collaboration diagram for ACE_Event_Handler_var:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Event_Handler_var (void)
 Default constructor.

 ACE_Event_Handler_var (ACE_Event_Handler *p)
 Construct with a handler.

 ACE_Event_Handler_var (const ACE_Event_Handler_var &b)
 Copy constructor.

 ~ACE_Event_Handler_var (void)
 Destructor.

ACE_Event_Handler_varoperator= (ACE_Event_Handler *p)
 Assignment to a handler.

ACE_Event_Handler_varoperator= (const ACE_Event_Handler_var &b)
 Assignment to a ACE_Event_Handler_var.

ACE_Event_Handleroperator-> () const
 Overloaded "->".

ACE_Event_Handlerhandler (void) const
 Access the handler.

ACE_Event_Handlerrelease (void)
 Release the handler.

void reset (ACE_Event_Handler *p=0)
 Reset the handler.


Private Attributes

ACE_Event_Handlerptr_
 Handler.


Detailed Description

Auto pointer like class for Event Handlers.

Used to manage lifecycle of handlers. This class calls ACE_Event_Handler::remove_reference() in its destructor.

Definition at line 317 of file Event_Handler.h.


Constructor & Destructor Documentation

ACE_Event_Handler_var::ACE_Event_Handler_var void   ) 
 

Default constructor.

Definition at line 311 of file Event_Handler.cpp.

00312   : ptr_ (0)
00313 {
00314 }

ACE_Event_Handler_var::ACE_Event_Handler_var ACE_Event_Handler p  ) 
 

Construct with a handler.

Definition at line 316 of file Event_Handler.cpp.

00317   : ptr_ (p)
00318 {
00319 }

ACE_Event_Handler_var::ACE_Event_Handler_var const ACE_Event_Handler_var b  ) 
 

Copy constructor.

Definition at line 321 of file Event_Handler.cpp.

References ACE_Event_Handler::add_reference().

00322   : ptr_ (b.ptr_)
00323 {
00324   if (this->ptr_ != 0)
00325     {
00326       this->ptr_->add_reference ();
00327     }
00328 }

ACE_Event_Handler_var::~ACE_Event_Handler_var void   ) 
 

Destructor.

Definition at line 330 of file Event_Handler.cpp.

References ACE_Event_Handler::remove_reference().

00331 {
00332   if (this->ptr_ != 0)
00333     {
00334       this->ptr_->remove_reference ();
00335     }
00336 }


Member Function Documentation

ACE_Event_Handler * ACE_Event_Handler_var::handler void   )  const
 

Access the handler.

Definition at line 378 of file Event_Handler.cpp.

Referenced by ACE_WFMO_Reactor_Handler_Repository::handler().

00379 {
00380   return this->ptr_;
00381 }

ACE_Event_Handler * ACE_Event_Handler_var::operator->  )  const
 

Overloaded "->".

Definition at line 372 of file Event_Handler.cpp.

00373 {
00374   return this->ptr_;
00375 }

ACE_Event_Handler_var & ACE_Event_Handler_var::operator= const ACE_Event_Handler_var b  ) 
 

Assignment to a ACE_Event_Handler_var.

Definition at line 353 of file Event_Handler.cpp.

References ACE_Event_Handler::add_reference(), ptr_, and ACE_Event_Handler::remove_reference().

00354 {
00355   if (this->ptr_ != b.ptr_)
00356     {
00357       if (this->ptr_ != 0)
00358         {
00359           this->ptr_->remove_reference ();
00360         }
00361 
00362       if ((this->ptr_ = b.ptr_) != 0)
00363         {
00364           this->ptr_->add_reference ();
00365         }
00366     }
00367 
00368   return *this;
00369 }

ACE_Event_Handler_var & ACE_Event_Handler_var::operator= ACE_Event_Handler p  ) 
 

Assignment to a handler.

Definition at line 339 of file Event_Handler.cpp.

References ACE_Event_Handler::remove_reference().

00340 {
00341   if (this->ptr_ == p)
00342     return *this;
00343 
00344   if (this->ptr_ != 0)
00345     this->ptr_->remove_reference ();
00346 
00347   this->ptr_ = p;
00348 
00349   return *this;
00350 }

ACE_Event_Handler * ACE_Event_Handler_var::release void   ) 
 

Release the handler.

Definition at line 384 of file Event_Handler.cpp.

Referenced by ACE_WFMO_Reactor_Handler_Repository::handler(), and ACE_Select_Reactor_Notify::notify().

00385 {
00386   ACE_Event_Handler *old = this->ptr_;
00387   this->ptr_ = 0;
00388   return old;
00389 }

void ACE_Event_Handler_var::reset ACE_Event_Handler p = 0  ) 
 

Reset the handler.

Definition at line 392 of file Event_Handler.cpp.

00393 {
00394   *this = p;
00395 }


Member Data Documentation

ACE_Event_Handler* ACE_Event_Handler_var::ptr_ [private]
 

Handler.

Definition at line 355 of file Event_Handler.h.

Referenced by operator=().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:22:07 2006 for ACE by doxygen 1.3.6