Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxImgSystem.h

00001 /*
00002  *  Copyright (c) 2000, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Edo Poll (poll@wins.uva.nl)
00008  *  Dennis Koelma (koelma@wins.uva.nl)
00009  */
00010 
00011 #ifndef HxImgSystem_h
00012 #define HxImgSystem_h
00013 
00014 #include "HxStd.h"
00015 #include "HxIoFwd.h"
00016 
00017 #include <list>
00018 
00019 class HxLogMessage;
00020 
00021 
00025 class L_HXIMAGEREP HxImgSystem {
00026 
00027 public:
00028 
00029                                     ~HxImgSystem();
00030     static HxImgSystem&             instance();
00031 
00032     HxLogMessage*                   allocated(size_t);
00033     HxLogMessage*                   deallocated(size_t);
00034     size_t                          memoryUsage() const;
00035 
00036     // Message log
00037 
00043     void                            pushMessage(HxLogMessage*);
00044 
00045     void                            setLogging(bool);
00046     bool                            isLogging() const;
00047     void                            verboseLogging(bool);
00048 
00049     void                            clearLog();
00050     STD_OSTREAM&                    printLog(STD_OSTREAM&) const;
00051 
00052 private:
00053                                     HxImgSystem();
00054                                     HxImgSystem(const HxImgSystem&);
00055     HxImgSystem&                    operator=(const HxImgSystem&);
00056 
00057     size_t                          _memUse;
00058 
00059     typedef HxLogMessage*           LogMsgPtr;
00060     typedef std::list<LogMsgPtr>    LogMsgList;
00061 
00062 #pragma warning(disable: 4251)
00063     LogMsgList                      _logMsgList;
00064 #pragma warning(default: 4251)
00065 
00066     bool                            _logOn;
00067     bool                            _logVerbose;
00068     HxLogMessage*                   _lastMsg;
00069 };
00070 
00071 inline bool
00072 HxImgSystem::isLogging() const
00073 {
00074     return _logOn;
00075 }
00076 
00077 #endif

Generated on Tue Feb 3 14:18:38 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001