00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Init_ACE.h 00006 * 00007 * $Id: Init_ACE.h 74005 2006-08-14 11:30:00Z johnnyw $ 00008 * 00009 * Initialize ACE library services. Can be called only once per 00010 * program invocation. 00011 */ 00012 //============================================================================= 00013 00014 00015 #ifndef ACE_INIT_ACE_H 00016 #define ACE_INIT_ACE_H 00017 00018 #include /**/ "ace/pre.h" 00019 00020 #include /**/ "ace/ACE_export.h" 00021 00022 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00023 # pragma once 00024 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00025 00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00027 00028 namespace ACE 00029 { 00030 /** 00031 * This class implements the functions for the initialization and 00032 * shutting down ACE. These functions are called only once per ACE 00033 * invokation. 00034 * @return Returns 0 on success, -1 on failure, and 1 if it had already been 00035 * called. 00036 */ 00037 extern ACE_Export int init (void); 00038 00039 /** 00040 * Shut down ACE library services. Can be called only once per 00041 * program invocation. 00042 * @return Returns 0 on success, -1 on failure, and 1 if it had already been 00043 * called. 00044 */ 00045 extern ACE_Export int fini (void); 00046 00047 // private: 00048 // Used internally, so not exported. 00049 00050 /** 00051 * Counter to match <init()>/<fini()> calls. <init()> must increment it; 00052 * <fini()> must decrement it. <fini()> then does nothing until it 00053 * reaches 0. 00054 */ 00055 extern unsigned int init_fini_count_; 00056 } 00057 00058 ACE_END_VERSIONED_NAMESPACE_DECL 00059 00060 #include /**/ "ace/post.h" 00061 00062 #endif /* ACE_INIT_ACE_H */