EpcTools
An event based multi-threaded C++ development framework.
estatic.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2009-2019 Brian Waters
3 * Copyright (c) 2019 Sprint
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 
18 #ifndef __estatic_h_included
19 #define __estatic_h_included
20 
26 
27 #include "ebase.h"
28 #include "egetopt.h"
29 
32 enum
33 {
35  STATIC_INIT_TYPE_SHARED_OBJECT_MANAGER,
36  STATIC_INIT_TYPE_PRIORITY,
37  STATIC_INIT_TYPE_THREADS, // initialized thread info
38 
39  STATIC_INIT_TYPE_STRING_MANAGER,
40  STATIC_INIT_TYPE_FILE_MANAGER,
41  STATIC_INIT_TYPE_DLLS,
42  STATIC_INIT_TYPE_BEFORE_OTHER,
43  STATIC_INIT_TYPE_OTHER,
44  STATIC_INIT_TYPE_AFTER_ALL //For anything that relies upon others
46 };
47 
51 class EStatic
52 {
53 public:
54  static Void Initialize(EGetOpt &opt);
55  static Void UnInitialize();
56 
57  virtual Int getInitType() { return STATIC_INIT_TYPE_OTHER; }
58 
61  virtual Void init(EGetOpt &opt) {}
63  virtual Void uninit() {}
64 
66  EStatic();
67  virtual ~EStatic();
69 
70 protected:
72  static EStatic *m_pFirst;
73  EStatic *m_pNext;
75 };
76 
77 #endif // #define __estatic_h_included
EStatic::uninit
virtual Void uninit()
Performs uninitialization at system shutdown.
Definition: estatic.h:63
ebase.h
Macros for various standard C library functions and standard includes.
EStatic
Any EpcTools that needs to have initialization performed as part of EpcTools::Initialize() should der...
Definition: estatic.h:51
EStatic::Initialize
static Void Initialize(EGetOpt &opt)
Definition: estatic.cpp:24
EGetOpt
Definition: egetopt.h:31
EStatic::UnInitialize
static Void UnInitialize()
Definition: estatic.cpp:36
egetopt.h
Manages configuration parameters from a file and the command line.
EStatic::init
virtual Void init(EGetOpt &opt)
Performs class specific initialization.
Definition: estatic.h:61
EStatic::getInitType
virtual Int getInitType()
Definition: estatic.h:57