00001 /* 00002 **************************************************************************** 00003 * 00004 * simulavr - A simulator for the Atmel AVR family of microcontrollers. 00005 * Copyright (C) 2001, 2002, 2003 Klaus Rudolph 00006 * Copyright (C) 2009 Onno Kortmann 00007 * 00008 * This program is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program 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 this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 * 00022 **************************************************************************** 00023 * 00024 * $Id$ 00025 */ 00026 00027 /*@file special memory types which are rarely used 00028 are defined here. */ 00029 #ifndef SPECIALMEM 00030 #define SPECIALMEM 00031 00032 #include <fstream> 00033 #include "rwmem.h" 00034 00036 00039 class RWWriteToFile: public RWMemoryMember { 00040 public: 00043 RWWriteToFile(TraceValueRegister *registry, 00044 const std::string &tracename, 00045 const std::string &filename); 00046 protected: 00047 unsigned char get() const; 00048 void set(unsigned char); 00049 00050 std::ostream &os; 00051 std::ofstream ofs; 00052 }; 00053 00055 00058 class RWReadFromFile: public RWMemoryMember { 00059 public: 00062 RWReadFromFile(TraceValueRegister *registry, 00063 const std::string &tracename, 00064 const std::string &filename); 00065 protected: 00066 unsigned char get() const; 00067 void set(unsigned char); 00068 00069 std::istream &is; 00070 mutable std::ifstream ifs; 00071 }; 00072 00074 00077 class RWExit: public RWMemoryMember { 00078 public: 00079 RWExit(TraceValueRegister *registry, const std::string &tracename=""); 00080 protected: 00081 unsigned char get() const; 00082 void set(unsigned char); 00083 }; 00084 00086 00087 class RWAbort: public RWMemoryMember { 00088 public: 00089 RWAbort(TraceValueRegister *registry, const std::string &tracename=""); 00090 protected: 00091 unsigned char get() const; 00092 void set(unsigned char); 00093 }; 00094 00095 #endif