Windows2003-3790/admin/cys/inc/init.h
2020-09-30 16:53:55 +02:00

38 lines
902 B
C++

// Copyright (c) 2002 Microsoft Corporation
//
// File: init.h
//
// Synopsis: Declares an initialization guard
// to ensure that all resources are freed
//
// History: 03/26/2002 JeffJon Created
#ifndef __CYSINIT_H
#define __CYSINIT_H
// For an explanation of the initialization guard thing, see Meyers,
// Scott. "Effective C++ pp. 178-182 Addison-Wesley 1992. Basically, it
// guarantees that this library is properly initialized before any code
// that uses it is called.
class CYSInitializationGuard
{
public:
CYSInitializationGuard();
~CYSInitializationGuard();
private:
static unsigned counter;
// not defined
CYSInitializationGuard(const CYSInitializationGuard&);
const CYSInitializationGuard& operator=(const CYSInitializationGuard&);
};
static CYSInitializationGuard cysguard;
#endif // __CYSINIT_H