Simpatico  v1.10
util/misc/initStatic.cpp
1 /*
2 * Util Package - C++ Utilities for Scientific Computation
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include "initStatic.h"
9 #include <util/global.h>
10 
11 #include <util/misc/Log.h>
12 #include <util/misc/Memory.h>
13 #include <util/format/Format.h>
14 #include <util/param/ParamComponent.h>
15 #include <util/math/Constants.h>
16 #include <util/space/Vector.h>
17 #include <util/space/IntVector.h>
18 #include <util/space/Tensor.h>
19 
20 namespace Util
21 {
22 
23  /*
24  * Initialize all static class members in Util namespace.
25  */
26  void initStatic()
27  {
28  // Precondition: This function can only be called once.
29  static int nCall = 0;
30  if (nCall == 0) {
31  // Call initStatic() methods of all relevant classes.
40  }
41  ++nCall;
42  }
43 
44 }
static void initStatic()
Call to guarantee initialization of Zero and Identity tensors.
Definition: Tensor.cpp:27
static void initStatic()
Call this just to guarantee initialization of static memory.
Definition: Memory.cpp:28
File containing preprocessor macros for error handling.
static void initStatic()
Initialize static echo member to false.
static void initStatic()
Initialize Zero Vector.
Definition: Vector.cpp:119
void initStatic()
Guarantee initialization of all static class members in Util namespace.
static void initStatic()
Initialize static members.
Definition: Log.cpp:23
Utility classes for scientific computation.
Definition: accumulators.mod:1
static void initStatic()
Initialize static constants.
Definition: Constants.cpp:22
static void initStatic()
Initialize static IntVector::Zero.
Definition: IntVector.cpp:113
static void initStatic()
Initialize or reset default width and precision values.
Definition: Format.cpp:47