Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Init_ACE Class Reference

Initialize ACE library services. Can be called only once per program invocation. More...

#include <Init_ACE.h>

Inheritance diagram for ACE_Init_ACE:

Inheritance graph
[legend]
List of all members.

Static Public Methods

int init (void)
int fini (void)

Static Private Attributes

unsigned int init_fini_count_ = 0

Detailed Description

Initialize ACE library services. Can be called only once per program invocation.

Definition at line 34 of file Init_ACE.h.


Member Function Documentation

int ACE_Init_ACE::fini void    [static]
 

Shut down ACE library services. Can be called only once per program invocation.

Returns:
Returns 0 on success, -1 on failure, and 1 if it had already been called.

Definition at line 30 of file Init_ACE.cpp.

References ACE_TRACE, ACE_Object_Manager::fini, init_fini_count_, and ACE_Object_Manager::instance.

00031 {
00032   ACE_TRACE ("ACE_Init_ACE::fini");
00033 
00034   if (init_fini_count_ > 0)
00035     {
00036       if (--init_fini_count_ == 0)
00037         return ACE_Object_Manager::instance ()->fini ();
00038       else
00039         // Wait for remaining fini () calls.
00040         return 1;
00041     }
00042   else
00043     // More ACE_Init_ACE::fini () calls than ACE_Init_ACE::init () calls.  Bad
00044     // application!
00045     return -1;
00046 }

int ACE_Init_ACE::init void    [static]
 

This class implements the functions for the initialization and shutting down ACE. These functions are called only once per ACE invokation.

Returns:
Returns 0 on success, -1 on failure, and 1 if it had already been called.

Definition at line 18 of file Init_ACE.cpp.

References ACE_Object_Manager::init, init_fini_count_, and ACE_Object_Manager::instance.

00019 {
00020   // Don't use ACE_TRACE, because Object_Manager might not have been
00021   // instantiated yet.
00022   // ACE_TRACE ("ACE_Init_ACE::init");
00023 
00024   ++init_fini_count_;
00025 
00026   return ACE_Object_Manager::instance ()->init ();
00027 }


Member Data Documentation

unsigned int ACE_Init_ACE::init_fini_count_ = 0 [static, private]
 

Counter to match <init()>/<fini()> calls. <init()> must increment it; <fini()> must decrement it. <fini()> then does nothing until it reaches 0.

Definition at line 15 of file Init_ACE.cpp.

Referenced by fini, and init.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:49:01 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002