MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SetGet2< A1, A2 > Class Template Reference

#include <SetGet.h>

+ Inheritance diagram for SetGet2< A1, A2 >:
+ Collaboration diagram for SetGet2< A1, A2 >:

Public Member Functions

 SetGet2 ()
 
- Public Member Functions inherited from SetGet
virtual bool checkOpClass (const OpFunc *op) const =0
 
 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, A1 arg1, A2 arg2)
 
static bool setVec (Id destId, const string &field, const vector< A1 > &arg1, const vector< A2 > &arg2)
 
- 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 A1, class A2>
class SetGet2< A1, A2 >

SetGet2 handles 2-argument Sets. It does not deal with Gets.

Definition at line 356 of file SetGet.h.

Constructor & Destructor Documentation

template<class A1, class A2>
SetGet2< A1, A2 >::SetGet2 ( )
inline

Definition at line 359 of file SetGet.h.

360  {;}

Member Function Documentation

template<class A1, class A2>
static bool SetGet2< A1, A2 >::innerStrSet ( const ObjId dest,
const string &  field,
const string &  val 
)
inlinestatic

Blocking call using string conversion.

Definition at line 437 of file SetGet.h.

439  {
440  A1 arg1;
441  A2 arg2;
442  string::size_type pos = val.find_first_of( "," );
443  Conv< A1 >::str2val( arg1, val.substr( 0, pos ) );
444  Conv< A2 >::str2val( arg2, val.substr( pos + 1 ) );
445  return set( dest, field, arg1, arg2 );
446  }
static void str2val(T &val, const string &s)
Definition: Conv.h:65
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365
template<class A1, class A2>
static bool SetGet2< A1, A2 >::set ( const ObjId dest,
const string &  field,
A1  arg1,
A2  arg2 
)
inlinestatic

Blocking, typed 'Set' call

Definition at line 365 of file SetGet.h.

Referenced by Synapse::addMsgCallback(), addSpine(), benchmarkMsg(), ReadKkit::buildEnz(), Shell::doMove(), Shell::doStart(), SetGet2< L, A >::innerStrSet(), makeStandardElements(), Neuron::scaleBufAndRates(), Neuron::scaleHeadDiffusion(), Neuron::scaleShaftDiffusion(), LookupField< L, A >::set(), setDestFinfo1(), Spine::setHeadDiameter(), Spine::setHeadLength(), Spine::setHeadVolume(), Spine::setShaftDiameter(), Spine::setShaftLength(), ReadKkit::setupSlaveMsg(), testCalcJunction(), testReMesh(), testRunGsolve(), and testRunKsolve().

367  {
368  FuncId fid;
369  ObjId tgt( dest );
370  const OpFunc* func = checkSet( field, tgt, fid );
371  const OpFunc2Base< A1, A2 >* op =
372  dynamic_cast< const OpFunc2Base< A1, A2 >* >( func );
373  if ( op ) {
374  if ( tgt.isOffNode() ) {
375  const OpFunc* op2 = op->makeHopFunc(
376  HopIndex( op->opIndex(), MooseSetHop ) );
377  const OpFunc2Base< A1, A2 >* hop =
378  dynamic_cast< const OpFunc2Base< A1, A2 >* >( op2 );
379  hop->op( tgt.eref(), arg1, arg2 );
380  delete op2;
381  if ( tgt.isGlobal() )
382  op->op( tgt.eref(), arg1, arg2 );
383  return true;
384  } else {
385  op->op( tgt.eref(), arg1, arg2 );
386  return true;
387  }
388  }
389  return false;
390  }
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
Definition: SetGet.cpp:15
static double op(double x)
Definition: ObjId.h:20
virtual void op(const Eref &e, A1 arg1, A2 arg2) const =0
const unsigned char MooseSetHop
Definition: OpFuncBase.cpp:13
unsigned int FuncId
Definition: header.h:42
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:269
unsigned int opIndex() const
Definition: OpFuncBase.h:66

+ Here is the caller graph for this function:

template<class A1, class A2>
static bool SetGet2< A1, A2 >::setVec ( Id  destId,
const string &  field,
const vector< A1 > &  arg1,
const vector< A2 > &  arg2 
)
inlinestatic

Assign a vector of targets, using matching vectors of arguments arg1 and arg2. Specifically, index i on the target receives arguments arg1[i], arg2[i]. Note that there is no requirement for the size of the argument vectors to be equal to the size of the target array of objects. If there are fewer arguments then the index cycles back, so as to tile the target array with as many arguments as we have.

Not yet implemented correct handling for FieldElements.

Definition at line 404 of file SetGet.h.

Referenced by LookupField< L, A >::setVec(), and test2ArgSetVec().

406  {
407  ObjId tgt( destId, 0 );
408  FuncId fid;
409  const OpFunc* func = checkSet( field, tgt, fid );
410  const OpFunc2Base< A1, A2 >* op =
411  dynamic_cast< const OpFunc2Base< A1, A2 >* >( func );
412  if ( op ) {
413  /*
414  unsigned int size = tgt.element()->numData();
415  // total # of entries on element and maybe to include fields
416  for ( unsigned int i = 0; i < size; ++i ) {
417  Eref er( tgt.element(), i );
418  op->op( er, arg1[ i % arg1.size() ],
419  arg2[ i % arg2.size() ] );
420  }
421  return true;
422  */
423  const OpFunc* op2 = op->makeHopFunc(
424  HopIndex( op->opIndex(), MooseSetVecHop ) );
425  const OpFunc2Base< A1, A2 >* hop =
426  dynamic_cast< const OpFunc2Base< A1, A2 >* >( op2 );
427  hop->opVec( tgt.eref(), arg1, arg2, op );
428  delete op2;
429  return true;
430  }
431  return false;
432  }
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
Definition: SetGet.cpp:15
static double op(double x)
Definition: ObjId.h:20
virtual void opVec(const Eref &e, const vector< A1 > &arg1, const vector< A2 > &arg2, const OpFunc2Base< A1, A2 > *op) const
Definition: OpFuncBase.h:182
const unsigned char MooseSetVecHop
Definition: OpFuncBase.cpp:14
unsigned int FuncId
Definition: header.h:42
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:269
unsigned int opIndex() const
Definition: OpFuncBase.h:66

+ Here is the caller graph for this function:


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