00001 /********************************************************************** 00002 ** Messaging Object Oriented Simulation Environment. 00003 ** Copyright (C) 2003-2010 Upinder S. Bhalla. and NCBS 00004 ** It is made available under the terms of the 00005 ** GNU Lesser General Public License version 2.1 00006 ** See the file COPYING.LIB for the full notice. 00007 **********************************************************************/ 00008 00009 #ifndef _DIAGONAL_MSG_H 00010 #define _DIAGONAL_MSG_H 00011 00028 class DiagonalMsg: public Msg 00029 { 00030 friend unsigned int Msg::initMsgManagers(); // for initializing Id. 00031 public: 00032 DiagonalMsg( Element* e1, Element* e2, unsigned int msgIndex ); 00033 ~DiagonalMsg(); 00034 00035 Eref firstTgt( const Eref& src ) const; 00036 00037 void sources( vector< vector< Eref > >& v ) const; 00038 void targets( vector< vector< Eref > >& v ) const; 00039 00040 Id managerId() const; 00041 00042 ObjId findOtherEnd( ObjId end ) const; 00043 00044 Msg* copy( Id origSrc, Id newSrc, Id newTgt, 00045 FuncId fid, unsigned int b, unsigned int n ) const; 00046 00053 void setStride( int stride ); 00054 00061 int getStride() const; 00062 00064 static unsigned int numMsg(); 00065 static char* lookupMsg( unsigned int index ); 00066 00068 static const Cinfo* initCinfo(); 00069 private: 00070 int stride_; // Increment between targets. 00071 static Id managerId_; 00072 static vector< DiagonalMsg* > msg_; 00073 }; 00074 00075 #endif // _DIAGONAL_MSG_H