00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Init_ACE.h 00006 * 00007 * $Id: Init_ACE.h 88794 2010-02-01 19:15:36Z schmidt $ 00008 * 00009 * Initialize and finalize the ACE library services. You can 00010 * generally execute the @a ACE::init() and @a ACE::fini() sequence 00011 * multiple times, but be aware that nothing that ACE controls (e.g., 00012 * singletons, thread-specific services, loaded services, etc.) will 00013 * survive the @a ACE::fini(). 00014 */ 00015 //============================================================================= 00016 00017 00018 #ifndef ACE_INIT_ACE_H 00019 #define ACE_INIT_ACE_H 00020 00021 #include /**/ "ace/pre.h" 00022 00023 #include /**/ "ace/ACE_export.h" 00024 00025 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00026 # pragma once 00027 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00028 00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 namespace ACE 00032 { 00033 /** 00034 * This method initializes the ACE library services and initializes 00035 * ACE's internal resources. Applications should not instantiate 00036 * ACE classes or call methods on objects of these classes until @a 00037 * ACE::init() returns successfully. 00038 00039 * @return Returns 0 on success, -1 on failure, and 1 if it had 00040 * already been called. 00041 */ 00042 extern ACE_Export int init (void); 00043 00044 /** 00045 * Finalize the ACE library services and releases ACE's internal 00046 * resources. In general, do not instantiate ACE classes or call 00047 * methods on objects of these classes after @a ACE::fini() has been 00048 * called. 00049 * 00050 * @return Returns 0 on success, -1 on failure, and 1 if it had already been 00051 * called. 00052 */ 00053 extern ACE_Export int fini (void); 00054 00055 // private: 00056 // Used internally, so not exported. 00057 00058 /** 00059 * Counter to match <init()>/<fini()> calls. <init()> must increment it; 00060 * <fini()> must decrement it. <fini()> then does nothing until it 00061 * reaches 0. 00062 */ 00063 extern unsigned int init_fini_count_; 00064 } 00065 00066 ACE_END_VERSIONED_NAMESPACE_DECL 00067 00068 #include /**/ "ace/post.h" 00069 00070 #endif /* ACE_INIT_ACE_H */