CoCoALib-0.9905 date: 23 May 2007


GlobalManager.H

Go to the documentation of this file.
00001 #ifndef CoCoA_GlobalManager_H
00002 #define CoCoA_GlobalManager_H
00003 
00004 //   Copyright (c)  2007  John Abbott
00005 
00006 //   This file is part of the source of CoCoALib, the CoCoA Library.
00007 
00008 //   CoCoALib is free software; you can redistribute it and/or modify
00009 //   it under the terms of the GNU General Public License (version 2)
00010 //   as published by the Free Software Foundation.  A copy of the full
00011 //   licence may be found in the file COPYING in this directory.
00012 
00013 //   CoCoALib is distributed in the hope that it will be useful,
00014 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 //   GNU General Public License for more details.
00017 
00018 //   You should have received a copy of the GNU General Public License
00019 //   along with CoCoA; if not, write to the Free Software
00020 //   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 
00022 
00023 #include <memory>
00024 // using std::auto_ptr
00025 
00026 namespace CoCoA
00027 {
00028 
00029   class ring;          // fwd decl -- defined in ring.H
00030   class FractionField; // fwd decl -- defined in FractionField.H
00031 
00032   // At most one instance of this class may exist at any given time.
00033   class GlobalManager
00034   {
00035   public:
00036     GlobalManager();
00037     ~GlobalManager();
00038   private: // disable copy ctor and assignment
00039     GlobalManager(const GlobalManager&);            ///< NEVER DEFINED -- disable copy ctor
00040     GlobalManager& operator=(const GlobalManager&); ///< NEVER DEFINED -- disable assignment
00041   private:
00042     static const GlobalManager* ourGlobalDataPtr; ///< NULL or addr of unique existing GlobalManager
00043     friend const ring& RingZ(); // defined in RingZ.C
00044     friend const FractionField& RingQ(); // defined in RingQ.C
00045   private: // data members
00046     std::auto_ptr<ring> myRingZPtr;
00047     std::auto_ptr<FractionField> myRingQPtr;
00048   };
00049 
00050 } // end of namespace CoCoA
00051 
00052 
00053 
00054 // RCS header/log in the next few lines.
00055 // $Header: /Volumes/Home/cocoa/cvs-repository/CoCoALib-0.99/include/CoCoA/GlobalManager.H,v 1.1.1.1 2007/03/09 15:16:11 abbott Exp $
00056 // $Log: GlobalManager.H,v $
00057 // Revision 1.1.1.1  2007/03/09 15:16:11  abbott
00058 // Imported files
00059 //
00060 // Revision 1.2  2007/03/05 21:33:13  cocoa
00061 // Improved/cleaned GlobalManager; added doc too.
00062 //
00063 // Revision 1.1  2007/03/03 14:02:11  bigatti
00064 // -- "foundations" renamed into "GlobalManager"
00065 //
00066 // Revision 1.1  2007/03/02 16:46:28  cocoa
00067 // New foundations object which calls ctors and dtors of global objects.
00068 //
00069 
00070 #endif

Generated on Wed May 23 13:43:34 2007 for CoCoALib by  doxygen 1.4.6