ACE_Service_Config_Guard Class Reference

A guard class, designed to be instantiated on the stack. More...

#include <Service_Config.h>

Collaboration diagram for ACE_Service_Config_Guard:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Service_Config_Guard (ACE_Service_Gestalt *psg)
 ~ACE_Service_Config_Guard (void)

Private Member Functions

 ACE_Service_Config_Guard (const ACE_Service_Config_Guard &)
ACE_Service_Config_Guardoperator= (const ACE_Service_Config_Guard &)

Private Attributes

ACE_Service_Gestaltsaved_

Detailed Description

A guard class, designed to be instantiated on the stack.

Instantiating it with a specific configuration ensures any references to ACE_Service_Config::instance(), even when occuring in static constructors, will allways access the designated configuration instance. This comes very handy when a dynamic service also registers any static services of its own and their static factories.

Definition at line 603 of file Service_Config.h.


Constructor & Destructor Documentation

ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Service_Config_Guard::ACE_Service_Config_Guard ACE_Service_Gestalt psg  ) 
 

Definition at line 41 of file Service_Config.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, ACE_Service_Config::current(), ACE::debug(), LM_DEBUG, ACE_Service_Gestalt::repo_, and saved_.

00042   : saved_ (ACE_Service_Config::current ())
00043 {
00044   if (ACE::debug ())
00045     ACE_DEBUG ((LM_DEBUG,
00046                 ACE_LIB_TEXT ("(%P|%t) SCG::ctor, repo=%@ - guard with %@\n"),
00047                 this->saved_->repo_,
00048                 psg->repo_));
00049 
00050   // Modify the TSS - no locking needed
00051   if (saved_ != psg)
00052       (void)ACE_Service_Config::current (psg);
00053 }

ACE_Service_Config_Guard::~ACE_Service_Config_Guard void   ) 
 

Definition at line 56 of file Service_Config.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, ACE_Service_Config::current(), ACE::debug(), and LM_DEBUG.

00057 {
00058   ACE_Service_Config::current (this->saved_);
00059 
00060   if (ACE::debug ())
00061     ACE_DEBUG ((LM_DEBUG,
00062                 ACE_LIB_TEXT ("(%P|%t) SCG::dtor, repo=%@ - un-guard\n"),
00063                 this->saved_->repo_));
00064 }

ACE_Service_Config_Guard::ACE_Service_Config_Guard const ACE_Service_Config_Guard  )  [private]
 


Member Function Documentation

ACE_Service_Config_Guard& ACE_Service_Config_Guard::operator= const ACE_Service_Config_Guard  )  [private]
 


Member Data Documentation

ACE_Service_Gestalt* ACE_Service_Config_Guard::saved_ [private]
 

Definition at line 615 of file Service_Config.h.

Referenced by ACE_Service_Config_Guard().


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