cparsimcomm.h

00001 //=========================================================================
00002 //  CPARSIMCOMM.H - part of
00003 //
00004 //                  OMNeT++/OMNEST
00005 //           Discrete System Simulation in C++
00006 //
00007 //  Author: Andras Varga, 2003
00008 //          Dept. of Electrical and Computer Systems Engineering,
00009 //          Monash University, Melbourne, Australia
00010 //
00011 //=========================================================================
00012 
00013 /*--------------------------------------------------------------*
00014   Copyright (C) 2003-2008 Andras Varga
00015   Copyright (C) 2006-2008 OpenSim Ltd.
00016 
00017   This file is distributed WITHOUT ANY WARRANTY. See the file
00018   `license' for details on this and other legal matters.
00019 *--------------------------------------------------------------*/
00020 
00021 
00022 #ifndef __CPARSIMCOMM_H__
00023 #define __CPARSIMCOMM_H__
00024 
00025 #include "cobject.h"
00026 
00027 NAMESPACE_BEGIN
00028 
00029 // forward declaration:
00030 class cCommBuffer;
00031 
00032 #define PARSIM_ANY_TAG  -1
00033 
00034 
00045 class SIM_API cParsimCommunications : public cObject
00046 {
00047   public:
00051     virtual ~cParsimCommunications() {}
00052 
00064     virtual void init() = 0;
00065 
00069     virtual void shutdown() = 0;
00071 
00073 
00076     virtual int getNumPartitions() const = 0;
00077 
00081     virtual int getProcId() const = 0;
00082 
00088     virtual cCommBuffer *createCommBuffer() = 0;
00089 
00093     virtual void recycleCommBuffer(cCommBuffer *buffer) = 0;
00094 
00098     virtual void send(cCommBuffer *buffer, int tag, int destination) = 0;
00099 
00104     virtual void broadcast(cCommBuffer *buffer, int tag);
00105 
00110     virtual bool receiveBlocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) = 0;
00111 
00117     virtual bool receiveNonblocking(int filtTag, cCommBuffer *buffer, int& receivedTag, int& sourceProcId) = 0;
00119 };
00120 
00121 NAMESPACE_END
00122 
00123 
00124 #endif
00125 
Generated on Tue Dec 2 11:16:27 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3