sipxportlib  Version 3.3
OsNameDbInit.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 Jaroslav Libak
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007 SIPez LLC.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // Copyright (C) 2004-2007 SIPfoundry Inc.
9 // Licensed by SIPfoundry under the LGPL license.
10 //
11 // $$
13 
14 #ifndef OsNameDbInit_h__
15 #define OsNameDbInit_h__
16 
17 // SYSTEM INCLUDES
18 // APPLICATION INCLUDES
19 // DEFINES
20 
21 // Be sure to include all dependencies in the right order!
22 #include "utl/UtlInit.h" // OsNameDb uses Utl
23 
24 // MACROS
25 // EXTERNAL FUNCTIONS
26 // EXTERNAL VARIABLES
27 // CONSTANTS
28 // FORWARD DECLARATIONS
29 // STRUCTS
30 // TYPEDEFS
31 
45 {
46 /* //////////////////////////// PUBLIC //////////////////////////////////// */
47 public:
48 /* ============================ CREATORS ================================== */
50 
51 
53  OsNameDBInit(void);
54 
56  ~OsNameDBInit(void);
58 
59 /* //////////////////////////// PROTECTED ///////////////////////////////// */
60 protected:
61 
62 /* //////////////////////////// PRIVATE /////////////////////////////////// */
63 private:
64  static unsigned int msCount;
65 };
66 
67 /*
68 * This fixes constructor/destructor ordering by declaring a static instance
69 * of this Init class in every cpp file where this .h file is included.
70 * Thus constructor of this class will be run first, and destructor as the last.
71 */
72 static OsNameDBInit gOsNameDBInit;
73 
74 #endif // OsNameDbInit_h__
~OsNameDBInit(void)
Destructor.
Definition: OsNameDbInit.cpp:43
OsNameDB initializer class. Solves the problem with ordering of constructors & destructors.
Definition: OsNameDbInit.h:44
OsNameDBInit(void)
Constructor.
Definition: OsNameDbInit.cpp:35