00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _NEUTRAL_H
00011 #define _NEUTRAL_H
00012
00013
00014 #ifdef CYMOOSE
00015
00016 #include "../basecode/ProcInfo.h"
00017
00018 class Cinfo;
00019
00020 #endif
00021
00022 class Neutral
00023 {
00024 public:
00025 friend istream& operator >>( istream& s, Neutral& d );
00026 friend ostream& operator <<( ostream& s, const Neutral& d );
00027 Neutral();
00028
00030
00032
00041 void setThis( Neutral v );
00042
00051 Neutral getThis() const;
00052
00056 void setName( const Eref& e, string name );
00057 string getName( const Eref& e ) const;
00058
00062 vector< ObjId > getOutgoingMsgs( const Eref& e ) const;
00063
00067 vector< ObjId > getIncomingMsgs( const Eref& e ) const;
00068
00075 vector< Id > getNeighbors( const Eref& e, string field ) const;
00076
00082 vector< ObjId > getMsgDests( const Eref& e, string src ) const;
00083
00089 vector< string > getMsgDestFunctions(
00090 const Eref& e, string src ) const;
00091
00095 ObjId getObjId( const Eref& e ) const;
00096
00100 ObjId getParent( const Eref& e ) const;
00101
00105 vector< Id > getChildren( const Eref& e ) const;
00106
00110 unsigned int buildTree( const Eref& e, vector< Id >& tree ) const;
00111
00115 string getPath( const Eref& e ) const;
00116
00120 string getClass( const Eref& e ) const;
00121
00125 void setNumData( const Eref& e, unsigned int num );
00126 unsigned int getNumData( const Eref& e ) const;
00127
00132 void setNumField( const Eref& e, unsigned int num );
00133 unsigned int getNumField( const Eref& e ) const;
00134
00142 void setTick( const Eref& e, int num );
00144 int getTick( const Eref& e ) const;
00145
00147 double getDt( const Eref& e ) const;
00148
00150 vector< string > getValueFields( const Eref& e ) const;
00152 vector< string > getSourceFields( const Eref& e ) const;
00154 vector< string > getDestFields( const Eref& e ) const;
00156
00158
00162 void destroy( const Eref& e, int stage );
00163
00168 void blockNodeBalance( const Eref& e,
00169 unsigned int, unsigned int, unsigned int );
00170
00175 void generalNodeBalance( const Eref& e,
00176 unsigned int myNode, vector< unsigned int > nodeAssignment );
00177
00178
00180
00182
00186 static Id child( const Eref& e, const string& name );
00187
00191 static ObjId parent( const Eref& e );
00192 static ObjId parent( ObjId id );
00193
00197 static bool isDescendant( Id me, Id ancestor );
00198
00203 static const Cinfo* initCinfo();
00204
00208 static void children( const Eref& e, vector< Id >& ret );
00209
00213 static string path( const Eref& e );
00214
00220 static bool isGlobalField( const string& field );
00221
00222 private:
00223
00224 };
00225
00226 #endif // _NEUTRAL_H