trace.h

Go to the documentation of this file.
00001 //    sampalib.org ESL library and tools
00002 //    Copyright (C) 2007  Thierry Grellier
00003 //
00004 //    This program is free software; you can redistribute it and/or modify
00005 //    it under the terms of the GNU General Public License version 2 as
00006 //    published by the Free Software Foundation.
00007 //
00008 //    This program is distributed in the hope that it will be useful,
00009 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 //    GNU General Public License for more details.
00012 //
00013 //    You should have received a copy of the GNU General Public License along
00014 //    with this program; if not, write to the Free Software Foundation, Inc.,
00015 //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016 //
00017 //    contact: www.sampalib.org
00018 
00019 #ifndef SAMPA_TRACE_H
00020 #define SAMPA_TRACE_H
00021 
00022 #include <cstdio>
00023 #include "sampa/core/time.h"
00024 #if SAMPA_CONFIG_DEBUG == SAMPA_ENABLED
00025 
00026 namespace Sampa {
00027 
00028 class Object;
00029 
00030 class Trace {
00031 public:
00032   void* operator new(size_t size);
00033   void* operator new(size_t size, size_t variable_size);
00034 protected:
00035   enum DateTag { DATE_TAG };
00036   virtual size_t store(FILE*) = 0;
00037 #if SAMPA_CONFIG_MULTI_THREADED == SAMPA_ENABLED
00038   void complete() {}
00039 #else
00040   void complete();
00041 #endif
00042   unsigned object_to_id(const Object*);
00043   unsigned function_to_id(const char*);
00044   friend class TraceLog;
00045   friend class Simulation;
00046   void* operator new(size_t size,DateTag);
00047 };
00048 
00049 }
00050 
00051 #endif // SAMPA_CONFIG_DEBUG == SAMPA_ENABLED
00052 
00053 #endif

Generated on Sat Feb 16 16:23:15 2008 for Sampa by  doxygen 1.5.3