00001 /********************************************************************** 00002 ** This program is part of 'MOOSE', the 00003 ** Messaging Object Oriented Simulation Environment. 00004 ** Copyright (C) 2003-2009 Upinder S. Bhalla. and NCBS 00005 ** It is made available under the terms of the 00006 ** GNU Lesser General Public License version 2.1 00007 ** See the file COPYING.LIB for the full notice. 00008 **********************************************************************/ 00009 00010 #ifndef _SINGLE_MSG_H 00011 #define _SINGLE_MSG_H 00012 00020 class SingleMsg: public Msg 00021 { 00022 friend unsigned int Msg::initMsgManagers(); // for initializing Id. 00023 public: 00024 SingleMsg( const Eref& e1, const Eref& e2, unsigned int msgIndex ); 00025 ~SingleMsg(); 00026 00027 Eref firstTgt( const Eref& src ) const; 00028 00029 void sources( vector< vector< Eref > >& v ) const; 00030 void targets( vector< vector< Eref > >& v ) const; 00031 00032 DataId i1() const; 00033 DataId i2() const; 00034 00035 // returns the id of the managing Element. 00036 Id managerId() const; 00037 00038 ObjId findOtherEnd( ObjId end ) const; 00039 00040 Msg* copy( Id origSrc, Id newSrc, Id newTgt, 00041 FuncId fid, unsigned int b, unsigned int n ) const; 00042 00043 void setI1( DataId di ); 00044 DataId getI1() const; 00045 00046 void setI2( DataId di ); 00047 DataId getI2() const; 00048 00049 void setTargetField( unsigned int f ); 00050 unsigned int getTargetField() const; 00051 00053 static unsigned int numMsg(); 00054 static char* lookupMsg( unsigned int index ); 00055 00056 static const Cinfo* initCinfo(); 00057 private: 00058 DataId i1_; 00059 DataId i2_; 00060 unsigned int f2_; // Field for target. Note asymmetry 00061 static Id managerId_; 00062 static vector< SingleMsg* > msg_; 00063 }; 00064 00065 #endif // _SINGLE_MSG_H