00001 /*******************************************************************\ 00002 00003 SESAME project software license 00004 00005 Copyright (C) 2002, 2003 University of Amsterdam 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00020 02111-1307, USA. 00021 00022 For information regarding the SESAME software project see 00023 http://sesamesim.sourceforge.net or email 00024 jcofflan@users.sourceforge.net 00025 00026 \*******************************************************************/ 00027 00036 #ifndef FILECHANNELMAPPING_H 00037 #define FILECHANNELMAPPING_H 00038 00039 #include "channelmapping.h" 00040 #include "basicmuxchannel.h" 00041 #include <sstream> 00042 #include <fstream> 00043 #include <netinet/in.h> 00044 00045 class BasicMsgQueueMUX; 00046 00047 class FileChannelMapping : public ChannelMapping { 00049 std::fstream traceFile; 00050 00051 public: 00052 FileChannelMapping(const char *name, 00053 BasicSmartPointer<InstructionContext> instrContext, 00054 int id); 00055 virtual ~FileChannelMapping(); 00056 00057 bool createChannel(std::string traceBaseName); 00058 bool openChannel(std::string traceBaseName); 00059 void closeChannel(); 00060 00061 // Begin TraceChannel interface 00062 virtual void send(trace_event_t &event); 00063 virtual trace_event_t next(); 00064 // End TraceChannel interface 00065 }; 00066 #endif