MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SingleMsg.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2009 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _SINGLE_MSG_H
11 #define _SINGLE_MSG_H
12 
20 class SingleMsg: public Msg
21 {
22  friend unsigned int Msg::initMsgManagers(); // for initializing Id.
23  public:
24  SingleMsg( const Eref& e1, const Eref& e2, unsigned int msgIndex );
25  ~SingleMsg();
26 
27  Eref firstTgt( const Eref& src ) const;
28 
29  void sources( vector< vector< Eref > >& v ) const;
30  void targets( vector< vector< Eref > >& v ) const;
31 
32  DataId i1() const;
33  DataId i2() const;
34 
35  // returns the id of the managing Element.
36  Id managerId() const;
37 
38  ObjId findOtherEnd( ObjId end ) const;
39 
40  Msg* copy( Id origSrc, Id newSrc, Id newTgt,
41  FuncId fid, unsigned int b, unsigned int n ) const;
42 
43  void setI1( DataId di );
44  DataId getI1() const;
45 
46  void setI2( DataId di );
47  DataId getI2() const;
48 
49  void setTargetField( unsigned int f );
50  unsigned int getTargetField() const;
51 
53  static unsigned int numMsg();
54  static char* lookupMsg( unsigned int index );
55 
56  static const Cinfo* initCinfo();
57  private:
60  unsigned int f2_; // Field for target. Note asymmetry
61  static Id managerId_;
62  static vector< SingleMsg* > msg_;
63 };
64 
65 #endif // _SINGLE_MSG_H
void setI2(DataId di)
Definition: SingleMsg.cpp:204
ObjId findOtherEnd(ObjId end) const
Definition: SingleMsg.cpp:96
Element * e2() const
Definition: Msg.h:68
DataId i2() const
Definition: SingleMsg.cpp:86
Eref firstTgt(const Eref &src) const
Definition: SingleMsg.cpp:46
void setI1(DataId di)
Definition: SingleMsg.cpp:192
Id managerId() const
Definition: SingleMsg.cpp:91
Definition: ObjId.h:20
DataId i1_
Definition: SingleMsg.h:58
void sources(vector< vector< Eref > > &v) const
Definition: SingleMsg.cpp:55
DataId getI1() const
Definition: SingleMsg.cpp:187
DataId i1() const
Definition: SingleMsg.cpp:81
static vector< SingleMsg * > msg_
Definition: SingleMsg.h:62
Definition: Eref.h:26
unsigned int getTargetField() const
Definition: SingleMsg.cpp:217
Definition: Msg.h:18
void targets(vector< vector< Eref > > &v) const
Definition: SingleMsg.cpp:62
Element * e1() const
Definition: Msg.h:61
DataId i2_
Definition: SingleMsg.h:59
static const Cinfo * initCinfo()
Definition: SingleMsg.cpp:148
static unsigned int initMsgManagers()
Definition: Msg.cpp:236
Msg * copy(Id origSrc, Id newSrc, Id newTgt, FuncId fid, unsigned int b, unsigned int n) const
Definition: SingleMsg.cpp:111
Definition: Id.h:17
void setTargetField(unsigned int f)
Definition: SingleMsg.cpp:211
static unsigned int numMsg()
Msg lookup functions.
Definition: SingleMsg.cpp:223
unsigned int FuncId
Definition: header.h:42
unsigned int f2_
Definition: SingleMsg.h:60
SingleMsg(const Eref &e1, const Eref &e2, unsigned int msgIndex)
Definition: SingleMsg.cpp:21
unsigned int DataId
Definition: header.h:47
Definition: Cinfo.h:18
static Id managerId_
Definition: SingleMsg.h:61
static char * lookupMsg(unsigned int index)
Static function for Msg access.
Definition: SingleMsg.cpp:229
DataId getI2() const
Definition: SingleMsg.cpp:199