MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SetGet.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Field< A >
 
class  GetOpFunc< T, A >
 
class  LookupField< L, A >
 
class  SetGet
 
class  SetGet0
 
class  SetGet1< A >
 
class  SetGet2< A1, A2 >
 
class  SetGet3< A1, A2, A3 >
 
class  SetGet4< A1, A2, A3, A4 >
 
class  SetGet5< A1, A2, A3, A4, A5 >
 
class  SetGet6< A1, A2, A3, A4, A5, A6 >
 

Functions

template<class T , class A >
localGet (const Eref &er, string field)
 

Function Documentation

template<class T , class A >
A localGet ( const Eref er,
string  field 
)

Similar to Field< A >::fastGet(), except that an existing Msg is not needed.

Instant-return call for a single value. Bypasses all the queueing stuff. It is hardcoded so type safety will have to be coded in too: the dynamic_cast will catch it only at runtime.

Perhaps analogous localSet(), localLookupGet(), localGetVec(), etc. should also be added.

Also, will be nice to change this to Field< A >::localGet() to make things more uniform.

Definition at line 30 of file SetGet.h.

References Element::cinfo(), Eref::element(), Cinfo::findFinfo(), DestFinfo::getOpFunc(), and op().

31 {
32  string fullFieldName = "get" + field;
33  fullFieldName[3] = std::toupper( fullFieldName[3] );
34  const Finfo* finfo = er.element()->cinfo()->findFinfo( fullFieldName );
35  assert( finfo );
36 
37  const DestFinfo* dest = dynamic_cast< const DestFinfo* >( finfo );
38  assert( dest );
39 
40  const OpFunc* op = dest->getOpFunc();
41  assert( op );
42 
43  const GetOpFunc< T, A >* gop =
44  dynamic_cast< const GetOpFunc< T, A >* >( op );
45  assert( gop );
46 
47  return gop->reduceOp( er );
48 }
static double op(double x)
Element * element() const
Definition: Eref.h:42
const Cinfo * cinfo() const
Definition: Element.cpp:66
const OpFunc * getOpFunc() const
Definition: DestFinfo.cpp:40
const Finfo * findFinfo(const string &name) const
Definition: Cinfo.cpp:224
Definition: Finfo.h:12

+ Here is the call graph for this function: