OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
StaticInitializer< T > Struct Template Reference

#include <StaticInitializer.hpp>

Public Member Functions

 StaticInitializer ()
 

Static Public Member Functions

static void do_initialize ()
 

Detailed Description

template<typename T>
struct StaticInitializer< T >

This template should be used as a base class for a class that has static data to initialize.

There is no thread safe way in windows to initialize static data except to do it before main runs, or under some other controlled condition. This template ensures that the static member function initialize() of the derived class is called before main begins. This code is not necessary with GCC because GCC puts static initializers in critical sections

Constructor & Destructor Documentation

template<typename T>
StaticInitializer< T >::StaticInitializer ( )
inline

Member Function Documentation

template<typename T>
static void StaticInitializer< T >::do_initialize ( )
inlinestatic