Classes | Typedefs | Functions
test_singleton.cxx File Reference
#include "WireCellUtil/Singleton.h"
#include "WireCellUtil/Testing.h"
#include "WireCellUtil/Logging.h"

Go to the source code of this file.

Classes

class  Foo
 Foo. More...
 

Typedefs

typedef WireCell::Singleton< FooOnlyFoo
 

Functions

int main ()
 

Typedef Documentation

Definition at line 14 of file test_singleton.cxx.

Function Documentation

int main ( void  )

Definition at line 16 of file test_singleton.cxx.

17 {
18  info("First time:");
19  Foo* foo1 = &OnlyFoo::Instance();
20  Foo* foo2 = &OnlyFoo::Instance();
21 
22  Assert(foo1 == foo2);
23 
24  OnlyFoo::Instance().chirp();
25  info("Second time:");
26  OnlyFoo::Instance().chirp();
27 
29  Assert(foo3 == foo1);
30 
31 }
static T & Instance()
Definition: Singleton.h:10
#define Assert
Definition: Testing.h:7