Init_ACE.cpp

Go to the documentation of this file.
00001 #include "ace/Init_ACE.h"
00002 
00003 #include "ace/Object_Manager.h"
00004 
00005 ACE_RCSID (ace,
00006            Init_ACE,
00007            "$Id: Init_ACE.cpp 80826 2008-03-04 14:51:23Z wotte $")
00008 
00009 
00010 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00011 
00012 unsigned int ACE::init_fini_count_ = 0;
00013 
00014 int
00015 ACE::init (void)
00016 {
00017   // Don't use ACE_TRACE, because Object_Manager might not have been
00018   // instantiated yet.
00019   // ACE_TRACE ("ACE::init");
00020 
00021   ++ACE::init_fini_count_;
00022 
00023   return ACE_Object_Manager::instance ()->init ();
00024 }
00025 
00026 int
00027 ACE::fini (void)
00028 {
00029   ACE_TRACE ("ACE::fini");
00030 
00031   if (ACE::init_fini_count_ > 0)
00032     {
00033       if (--ACE::init_fini_count_ == 0)
00034         return ACE_Object_Manager::instance ()->fini ();
00035       else
00036         // Wait for remaining fini () calls.
00037         return 1;
00038     }
00039   else
00040     // More ACE::fini () calls than ACE::init () calls.  Bad
00041     // application!
00042     return -1;
00043 }
00044 
00045 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:18:39 2010 for ACE by  doxygen 1.4.7