00001 //========================================================================= 00002 // CFILECOMM.H - part of 00003 // 00004 // OMNeT++/OMNEST 00005 // Discrete System Simulation in C++ 00006 // 00007 // Written by: Andras Varga, 2003 00008 // 00009 //========================================================================= 00010 00011 /*--------------------------------------------------------------* 00012 Copyright (C) 2003-2005 Andras Varga 00013 Monash University, Dept. of Electrical and Computer Systems Eng. 00014 Melbourne, Australia 00015 00016 This file is distributed WITHOUT ANY WARRANTY. See the file 00017 `license' for details on this and other legal matters. 00018 *--------------------------------------------------------------*/ 00019 00020 00021 #include "cparsimcomm.h" 00022 #include "util.h" 00023 00024 #ifndef __CFILECOMM_H__ 00025 #define __CFILECOMM_H__ 00026 00027 00037 class cFileCommunications : public cParsimCommunications 00038 { 00039 protected: 00040 int numPartitions; 00041 int myProcId; 00042 00043 int seqNum; 00044 opp_string commDirPrefix; 00045 opp_string readDirPrefix; 00046 bool preserveReadFiles; 00047 00048 public: 00052 cFileCommunications(); 00053 00057 virtual ~cFileCommunications(); 00058 00064 virtual void init(); 00065 00069 virtual void shutdown(); 00070 00074 virtual int getNumPartitions(); 00075 00079 virtual int getProcId(); 00080 00084 virtual cCommBuffer *createCommBuffer(); 00085 00089 virtual void recycleCommBuffer(cCommBuffer *buffer); 00090 00094 virtual void send(cCommBuffer *buffer, int tag, int destination); 00095 00100 virtual bool receiveBlocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId); 00101 00107 virtual bool receiveNonblocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId); 00109 }; 00110 00111 #endif 00112 00113