// Init.h
// ----------------------------------------------------------------
// COMP 290-001: Algorithm Library Design, Lutz Kettner, 01/11/2000
// Example of a C++ Library with initialization and housekeeping.
// See Stroustrup, C++ Progr. Lang. 3rd Ed., page 640.
// Common prefix EX for Examples.

// This header needs to be included by all other header files that
// depend on the library being initialized.

#ifndef EX_INIT_H
#define EX_INIT_H

// Library initialization and housekeeping. Is triggered whenever
// libExample is linked to a program, here only output to cerr.
class EX_Init {
    static unsigned int count;
public:
    EX_Init();
    ~EX_Init();
};

// Trigger constructor and destructor calls in each compilation unit.
// Unnamed namespace can be used to avoid name collisions.
namespace {
    static EX_Init EX__init_var; 
};

#endif // EX_INIT_H //
// EOF //

