MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SetGet1< A > Class Template Reference

#include <SetGet.h>

+ Inheritance diagram for SetGet1< A >:
+ Collaboration diagram for SetGet1< A >:

Public Member Functions

bool checkOpClass (const OpFunc *op) const
 
 SetGet1 ()
 
- Public Member Functions inherited from SetGet
 SetGet ()
 
virtual ~SetGet ()
 

Static Public Member Functions

static bool innerStrSet (const ObjId &dest, const string &field, const string &val)
 
static bool set (const ObjId &dest, const string &field, A arg)
 
static bool setRepeat (ObjId destId, const string &field, const A &arg)
 
static bool setVec (ObjId destId, const string &field, const vector< A > &arg)
 
- Static Public Member Functions inherited from SetGet
static const OpFunccheckSet (const string &field, ObjId &tgt, FuncId &fid)
 
static const vector< double * > * dispatchGet (const ObjId &tgt, FuncId tgtFid, const double *arg, unsigned int size)
 Sends out request for data, and awaits its return. More...
 
static bool strGet (const ObjId &tgt, const string &field, string &ret)
 
static bool strSet (const ObjId &dest, const string &field, const string &val)
 

Detailed Description

template<class A>
class SetGet1< A >

Definition at line 144 of file SetGet.h.

Constructor & Destructor Documentation

template<class A>
SetGet1< A >::SetGet1 ( )
inline

Definition at line 147 of file SetGet.h.

148  {;}

Member Function Documentation

template<class A>
bool SetGet1< A >::checkOpClass ( const OpFunc op) const
inlinevirtual

Implements SetGet.

Definition at line 231 of file SetGet.h.

References op().

231  {
232  return dynamic_cast< const OpFunc1Base< A > * >( op );
233  }
static double op(double x)

+ Here is the call graph for this function:

template<class A>
static bool SetGet1< A >::innerStrSet ( const ObjId dest,
const string &  field,
const string &  val 
)
inlinestatic

Blocking call using string conversion

Definition at line 223 of file SetGet.h.

References SetGet1< A >::set(), and Conv< T >::str2val().

225  {
226  A arg;
227  Conv< A >::str2val( arg, val );
228  return set( dest, field, arg );
229  }
static void str2val(T &val, const string &s)
Definition: Conv.h:65
static bool set(const ObjId &dest, const string &field, A arg)
Definition: SetGet.h:153

+ Here is the call graph for this function:

template<class A>
static bool SetGet1< A >::set ( const ObjId dest,
const string &  field,
arg 
)
inlinestatic

Blocking, typed 'Set' call

Definition at line 153 of file SetGet.h.

References SetGet::checkSet(), ObjId::eref(), ObjId::isGlobal(), ObjId::isOffNode(), OpFunc1Base< A >::makeHopFunc(), MooseSetHop, OpFunc1Base< A >::op(), op(), and OpFunc::opIndex().

Referenced by ReadKkit::assignPoolCompartments(), Shell::doDelete(), SetGet1< A >::innerStrSet(), Field< A >::set(), setDestFinfo(), testGetMsg(), testMpiFibonacci(), and testShellSetGet().

154  {
155  FuncId fid;
156  ObjId tgt( dest );
157  const OpFunc* func = checkSet( field, tgt, fid );
158  const OpFunc1Base< A >* op =
159  dynamic_cast< const OpFunc1Base< A >* >( func );
160  if ( op ) {
161  if ( tgt.isOffNode() ) {
162  const OpFunc* op2 = op->makeHopFunc(
163  HopIndex( op->opIndex(), MooseSetHop ) );
164  const OpFunc1Base< A >* hop =
165  dynamic_cast< const OpFunc1Base< A >* >( op2 );
166  hop->op( tgt.eref(), arg );
167  delete op2;
168  if ( tgt.isGlobal() )
169  op->op( tgt.eref(), arg );
170  return true;
171  } else {
172  op->op( tgt.eref(), arg );
173  return true;
174  }
175  }
176  return false;
177  }
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
Definition: SetGet.cpp:15
static double op(double x)
virtual void op(const Eref &e, A arg) const =0
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:183
Definition: ObjId.h:20
const unsigned char MooseSetHop
Definition: OpFuncBase.cpp:13
unsigned int FuncId
Definition: header.h:42
unsigned int opIndex() const
Definition: OpFuncBase.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class A>
static bool SetGet1< A >::setRepeat ( ObjId  destId,
const string &  field,
const A &  arg 
)
inlinestatic

Sets all target array values to the single value

Definition at line 213 of file SetGet.h.

References SetGet1< A >::setVec().

Referenced by Field< A >::setRepeat(), and testSparseMsg().

215  {
216  vector< A >temp ( 1, arg );
217  return setVec( destId, field, temp );
218  }
static bool setVec(ObjId destId, const string &field, const vector< A > &arg)
Definition: SetGet.h:188

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class A>
static bool SetGet1< A >::setVec ( ObjId  destId,
const string &  field,
const vector< A > &  arg 
)
inlinestatic

setVec assigns all the entries in the target Id to the specified vector of values. If the target is a FieldElement it assigns the entries on the specific DataIndex provided in the ObjId argument. The vector is used as a circular buffer: if the number of targets exceeds the vector size, it rolls over.

Definition at line 188 of file SetGet.h.

References SetGet::checkSet(), ObjId::eref(), OpFunc1Base< A >::makeHopFunc(), MooseSetVecHop, op(), OpFunc::opIndex(), and OpFunc1Base< A >::opVec().

Referenced by benchmarkMsg(), SetGet1< A >::setRepeat(), Field< A >::setVec(), testAssortedMsg(), testCopyMsgOps(), testShellAddMsg(), and testShellSetGet().

190  {
191  if ( arg.size() == 0 ) return 0;
192 
193  ObjId tgt( destId );
194  FuncId fid;
195 
196  const OpFunc* func = checkSet( field, tgt, fid );
197  const OpFunc1Base< A >* op = dynamic_cast< const OpFunc1Base< A >* >( func );
198  if ( op ) {
199  const OpFunc* op2 = op->makeHopFunc(
200  HopIndex( op->opIndex(), MooseSetVecHop ) );
201  const OpFunc1Base< A >* hop =
202  dynamic_cast< const OpFunc1Base< A >* >( op2 );
203  hop->opVec( tgt.eref(), arg, op );
204  delete op2;
205  return true;
206  }
207  return false;
208  }
virtual void opVec(const Eref &e, const vector< A > &arg, const OpFunc1Base< A > *op) const
Definition: OpFuncBase.h:136
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
Definition: SetGet.cpp:15
static double op(double x)
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:183
Definition: ObjId.h:20
const unsigned char MooseSetVecHop
Definition: OpFuncBase.cpp:14
unsigned int FuncId
Definition: header.h:42
unsigned int opIndex() const
Definition: OpFuncBase.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: