Public Member Functions | Private Attributes

ACE_Thread_Exit_Maybe Class Reference

A version of ACE_Thread_Exit that is created dynamically under the hood if the flag is set to TRUE. More...

#include <Thread_Exit.h>

Collaboration diagram for ACE_Thread_Exit_Maybe:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ACE_Thread_Exit_Maybe (int flag=0)
 Don't create an ACE_Thread_Exit instance by default.
 ~ACE_Thread_Exit_Maybe (void)
 Destroys the underlying ACE_Thread_Exit instance if it exists.
ACE_Thread_Exitoperator-> (void) const
 Delegates to underlying instance.
ACE_Thread_Exitinstance (void) const
 Returns the underlying instance.

Private Attributes

ACE_Thread_Exitinstance_
 Holds the underlying instance.

Detailed Description

A version of ACE_Thread_Exit that is created dynamically under the hood if the flag is set to TRUE.

Allows the appearance of a "smart pointer", but is not always created.

Definition at line 86 of file Thread_Exit.h.


Constructor & Destructor Documentation

ACE_Thread_Exit_Maybe::ACE_Thread_Exit_Maybe ( int  flag = 0  ) 

Don't create an ACE_Thread_Exit instance by default.

Definition at line 97 of file Thread_Exit.cpp.

  : instance_ (0)
{
  if (flag)
    {
      ACE_NEW (instance_, ACE_Thread_Exit);
    }
}

ACE_Thread_Exit_Maybe::~ACE_Thread_Exit_Maybe ( void   ) 

Destroys the underlying ACE_Thread_Exit instance if it exists.

Definition at line 106 of file Thread_Exit.cpp.

{
  delete this->instance_;
}


Member Function Documentation

ACE_Thread_Exit * ACE_Thread_Exit_Maybe::instance ( void   )  const

Returns the underlying instance.

Definition at line 118 of file Thread_Exit.cpp.

{
  return this->instance_;
}

ACE_Thread_Exit * ACE_Thread_Exit_Maybe::operator-> ( void   )  const

Delegates to underlying instance.

Definition at line 112 of file Thread_Exit.cpp.

{
  return this->instance_;
}


Member Data Documentation

Holds the underlying instance.

Definition at line 104 of file Thread_Exit.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines