MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ObjId.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-2010 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 _OBJ_ID_H
11 #define _OBJ_ID_H
12 
13 #include "Id.h"
14 
20 class ObjId
21 {
22  friend ostream& operator <<( ostream& s, const ObjId& i );
23  friend istream& operator >>( istream& s, ObjId& i );
24  public:
26  // ObjId creation
28 
32  : id(), dataIndex( 0 ), fieldIndex( 0 )
33  {;}
34 
38  ObjId( Id i, unsigned int d, unsigned int f = 0 )
39  : id( i ), dataIndex( d ), fieldIndex( f )
40  {;}
41 
42  ObjId( Id i )
43  : id( i ), dataIndex( 0 ), fieldIndex( 0 )
44  {;}
45 
50  ObjId( const string& path );
51 
55  string path() const;
56 
60  Eref eref() const;
61 
65  bool operator==( const ObjId& other ) const;
66  bool operator!=( const ObjId& other ) const;
67 
71  bool operator<( const ObjId& other ) const;
72 
77  bool isDataHere() const;
78 
80  bool isGlobal() const;
81 
83  bool isOffNode() const;
84 
88  char* data() const;
89 
93  Element* element() const;
94 
98  Id id;
99  unsigned int dataIndex;
100  unsigned int fieldIndex;
101 
108  bool bad() const;
109 
110  private:
111 };
112 
113 #endif // _OBJ_ID_H
bool operator!=(const ObjId &other) const
Definition: ObjId.cpp:77
char * data() const
Definition: ObjId.cpp:113
unsigned int fieldIndex
Definition: ObjId.h:100
bool bad() const
Definition: ObjId.cpp:18
Id id
Definition: ObjId.h:98
bool operator==(const ObjId &other) const
Definition: ObjId.cpp:71
bool operator<(const ObjId &other) const
Definition: ObjId.cpp:83
Definition: ObjId.h:20
bool isDataHere() const
Definition: ObjId.cpp:95
bool isGlobal() const
Returns true if the Element is global.
Definition: ObjId.cpp:100
bool isOffNode() const
Returns true if we need to go off-node for calling operations.
Definition: ObjId.cpp:105
string path() const
Definition: ObjId.cpp:119
ObjId(Id i, unsigned int d, unsigned int f=0)
Definition: ObjId.h:38
Definition: Eref.h:26
friend ostream & operator<<(ostream &s, const ObjId &i)
ObjId(Id i)
Definition: ObjId.h:42
Element * element() const
Definition: ObjId.cpp:124
ObjId()
Definition: ObjId.h:31
Eref eref() const
Definition: ObjId.cpp:66
Definition: Id.h:17
friend istream & operator>>(istream &s, ObjId &i)
unsigned int dataIndex
Definition: ObjId.h:99