CLHEP/HepMC/CBInterface.h

00001 // $Id: CBInterface.h,v 1.1 2002/05/30 23:51:01 garren Exp $
00002 // ----------------------------------------------------------------------
00003 // CBInterface.h
00004 // ----------------------------------------------------------------------
00005 // Author:  Lynn Garren, Marc Paterno
00006 // 
00007 // This is the Fortran interface to a generic collection of common blocks
00008 // The singleton implementation allows you to both read and write
00009 //
00010 // ----------------------------------------------------------------------
00011 #ifndef CBINTERFACE_H
00012 #define CBINTERFACE_H
00013 
00014 namespace HepMC {
00015 
00016 template<class S>
00017 class CBInterface {
00018 
00019 public:
00020 
00021   static CBInterface< S > * instance()
00022   { 
00023       static CBInterface< S > me;
00024       return &me;
00025   }
00026   
00027   S* operator->() { return & myS; }
00028   S& operator*()  { return myS; }
00029   
00030 private:
00031   S myS;
00032 
00033 };      // CBInterface
00034 
00035 }       // HepMC
00036 
00037 #endif  // CBINTERFACE_H

Class Library for High Energy Physics (version 1.8)