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

#include <SetGet.h>

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

Public Member Functions

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

Static Public Member Functions

static A get (const ObjId &dest, const string &field)
 
static void getVec (ObjId dest, const string &field, vector< A > &vec)
 
static bool innerStrGet (const ObjId &dest, const string &field, string &str)
 
static bool innerStrSet (const ObjId &dest, const string &field, const string &arg)
 
static bool set (const ObjId &dest, const string &field, A arg)
 
static bool setRepeat (ObjId destId, const string &field, A arg)
 
static bool setVec (ObjId destId, const string &field, const vector< A > &arg)
 
- Static Public Member Functions inherited from SetGet1< A >
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 Field< A >

Definition at line 236 of file SetGet.h.

Constructor & Destructor Documentation

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

Definition at line 239 of file SetGet.h.

240  {;}

Member Function Documentation

template<class A>
static A Field< A >::get ( const ObjId dest,
const string &  field 
)
inlinestatic

Definition at line 284 of file SetGet.h.

References SetGet::checkSet(), ObjId::eref(), ObjId::isDataHere(), GetOpFuncBase< A >::makeHopFunc(), MooseGetHop, OpFunc1Base< A >::op(), OpFunc::opIndex(), and GetOpFuncBase< A >::returnOp().

Referenced by ReadCell::addCaConc(), ReadCell::addChannelMessage(), addSpine(), all_elements(), ReadCell::buildCompartment(), Dsolve::buildMeshJunctions(), Dsolve::buildNeuroMeshJunctions(), ReadKkit::buildSumTotal(), checkOutput(), ReadKkit::convertEnzRatesToConcUnits(), ReadKkit::convertMMenzRatesToConcUnits(), ReadKkit::convertPoolAmountToConcUnits(), ReadKkit::convertReacRatesToConcUnits(), coordSystem(), HSolveActive::createLookupTables(), estimateDefaultVol(), estimateSimTimes(), Neuron::evalExprForElist(), fillSegIndex(), fillSegments(), HSolveUtils::gates(), get_Id_attr(), getLookupField(), Stoich::getProxyPools(), HSolvePassive::initialize(), NeuroMesh::insertDummyNodes(), Stoich::installAndUnschedFunc(), Stoich::installAndUnschedFuncRate(), Stoich::installAndUnschedFuncReac(), ReadKkit::loadTab(), makeCompt(), makeReacTest(), mapVoxelsBetweenMeshes(), Dsolve::mapXfersBetweenDsolves(), moose_copy(), moose_ElementField_getattro(), moose_ElementField_getItem(), moose_ElementField_getLen(), moose_ElementField_getNum(), moose_ElementField_getSlice(), moose_ElementField_setattro(), moose_getField(), moose_Id_getattro(), moose_Id_repr(), moose_Id_setattro(), moose_ObjId_getattro(), moose_ObjId_getFieldNames(), moose_ObjId_init_from_path(), moose_ObjId_repr(), moose_ObjId_str(), NeuroNode::NeuroNode(), oid_to_element(), FuncRate::operator()(), positionCompt(), printGrid(), Stoich::printRates(), SteadyState::randomizeInitialCondition(), HSolveUtils::rates(), HSolveActive::readCalcium(), HSolveActive::readGates(), HSolveActive::readHHChannels(), moose::VClamp::reinit(), Neuron::scaleHeadDiffusion(), Dsolve::setCompartment(), moose::CompartmentBase::setGeomAndElec(), Spine::setHeadDiameter(), Spine::setHeadLength(), Spine::setHeadVolume(), setLookupField(), Dsolve::setPath(), Spine::setShaftDiameter(), Spine::setShaftLength(), ZombieFunction::setSolver(), SteadyState::setStoich(), Dsolve::setStoich(), SteadyState::settle(), ReadKkit::setupSlaveMsg(), SteadyState::setupSSmatrix(), SpineEntry::SpineEntry(), storeCplxEnzMsgs(), storeMMenzMsgs(), HSolvePassive::storeTree(), testBuildStoich(), testCalcJunction(), testCellDiffn(), testCinfoElements(), testCopy(), testCopyFieldElement(), testCopyMsgOps(), testCylDiffn(), testCylDiffnWithStoich(), testGet(), testGetMsg(), testMove(), testObjIdToAndFromPath(), testPoolVolumeScaling(), testReacVolumeScaling(), ReadCspace::testReadModel(), testReMesh(), testSendSpike(), testSetGet(), testSetGetDouble(), testSetGetExtField(), testSetGetSynapse(), testShellAddMsg(), testShellSetGet(), testSmallCellDiffn(), testSparseMsg(), testStats(), testTaperingCylDiffn(), testTreeTraversal(), testVolScaling(), traverseCumulativeDistance(), trimPath(), Stoich::updateRatesAfterRemesh(), Neuron::updateSegmentLengths(), NeuroMesh::updateShaftParents(), writeEnz(), writeGroup(), writeKkit(), writePool(), writeReac(), Stoich::zombifyModel(), and Stoich::zombifyPoolFuncWithScaling().

285  {
286  ObjId tgt( dest );
287  FuncId fid;
288  string fullFieldName = "get" + field;
289  fullFieldName[3] = std::toupper( fullFieldName[3] );
290  const OpFunc* func = SetGet::checkSet( fullFieldName, tgt, fid );
291  const GetOpFuncBase< A >* gof =
292  dynamic_cast< const GetOpFuncBase< A >* >( func );
293  if ( gof ) {
294  if ( tgt.isDataHere() ) {
295  return gof->returnOp( tgt.eref() );
296  } else {
297  const OpFunc* op2 = gof->makeHopFunc(
298  HopIndex( gof->opIndex(), MooseGetHop ) );
299  const OpFunc1Base< A* >* hop =
300  dynamic_cast< const OpFunc1Base< A* >* >( op2 );
301  assert( hop );
302  // Blocking function.
303  A ret;
304  hop->op( tgt.eref(), &ret );
305  delete op2;
306  return ret;
307  }
308  }
309  cout << "Warning: Field::Get conversion error for " <<
310  dest.id.path() << "." << field << endl;
311  return A();
312  }
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
Definition: SetGet.cpp:15
virtual A returnOp(const Eref &e) const =0
virtual void op(const Eref &e, A arg) const =0
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
Id id
Definition: ObjId.h:98
Definition: ObjId.h:20
const unsigned char MooseGetHop
Definition: OpFuncBase.cpp:15
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:513
unsigned int FuncId
Definition: header.h:42
unsigned int opIndex() const
Definition: OpFuncBase.h:66

+ Here is the call graph for this function:

template<class A>
static void Field< A >::getVec ( ObjId  dest,
const string &  field,
vector< A > &  vec 
)
inlinestatic

Returns a vector of values

Definition at line 317 of file SetGet.h.

References SetGet::checkSet(), ObjId::eref(), GetOpFuncBase< A >::makeHopFunc(), MooseGetVecHop, GetHopFunc< A >::opGetVec(), OpFunc::opIndex(), and ObjId::path().

Referenced by benchmarkMsg(), moose_ElementField_getattro(), moose_Id_getattro(), testCellDiffn(), testCopyFieldElement(), testCylDiffn(), testCylDiffnWithStoich(), testMpiFibonacci(), testSetGetVec(), testSetRepeat(), testShellAddMsg(), testShellSetGet(), testSmallCellDiffn(), and testTaperingCylDiffn().

318  {
319 
320  vec.resize( 0 );
321  ObjId tgt( dest );
322  FuncId fid;
323  string fullFieldName = "get" + field;
324  fullFieldName[3] = std::toupper( fullFieldName[3] );
325  const OpFunc* func = SetGet::checkSet( fullFieldName, tgt, fid );
326  const GetOpFuncBase< A >* gof =
327  dynamic_cast< const GetOpFuncBase< A >* >( func );
328  if ( gof ) {
329  const OpFunc* op2 = gof->makeHopFunc(
330  HopIndex( gof->opIndex(), MooseGetVecHop ) );
331  const GetHopFunc< A >* hop =
332  dynamic_cast< const GetHopFunc< A >* >( op2 );
333  hop->opGetVec( tgt.eref(), vec, gof );
334  delete op2;
335  return;
336  }
337  cout << "Warning: Field::getVec conversion error for " <<
338  dest.path() << endl;
339  }
const unsigned char MooseGetVecHop
Definition: OpFuncBase.cpp:16
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
Definition: SetGet.cpp:15
Definition: ObjId.h:20
void opGetVec(const Eref &e, vector< A > &ret, const GetOpFuncBase< A > *op) const
Definition: HopFunc.h:484
string path() const
Definition: ObjId.cpp:119
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:513
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 Field< A >::innerStrGet ( const ObjId dest,
const string &  field,
string &  str 
)
inlinestatic

Blocking call for finding a value and returning in a string.

Definition at line 345 of file SetGet.h.

References Conv< T >::val2str().

Referenced by ElementValueFinfo< T, F >::strGet(), ValueFinfo< T, F >::strGet(), ReadOnlyElementValueFinfo< T, F >::strGet(), and ReadOnlyValueFinfo< T, F >::strGet().

347  {
348  Conv< A >::val2str( str, get( dest, field ) );
349  return 1;
350  }
static void val2str(string &s, const T &val)
Definition: Conv.h:74

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Blocking call using string conversion

Definition at line 271 of file SetGet.h.

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

Referenced by ElementValueFinfo< T, F >::strSet(), and ValueFinfo< T, F >::strSet().

273  {
274  A val;
275  // Do NOT add 'set_' to the field name, as the 'set' func
276  // does it anyway.
277  Conv< A >::str2val( val, arg );
278  return set( dest, field, val );
279  }
static bool set(const ObjId &dest, const string &field, A arg)
Definition: SetGet.h:245
static void str2val(T &val, const string &s)
Definition: Conv.h:65

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Blocking, typed 'Set' call

Definition at line 245 of file SetGet.h.

References SetGet1< A >::set().

Referenced by ReadCell::addCaConc(), ReadCell::addCanonicalChannel(), ReadCell::addSpikeGen(), assignParam(), assignSingleCompartmentParams(), benchmarkMsg(), ReadKkit::buildChan(), ReadCell::buildChannels(), ReadCell::buildCompartment(), ReadKkit::buildEnz(), ReadKkit::buildInfo(), ReadKkit::buildPool(), ReadKkit::buildReac(), ReadKkit::buildStim(), ReadKkit::buildSumTotal(), ReadKkit::buildTable(), ReadKkit::call(), ReadKkit::convertEnzRatesToConcUnits(), ReadKkit::convertMMenzRatesToConcUnits(), ReadKkit::convertPoolAmountToConcUnits(), ReadKkit::convertReacRatesToConcUnits(), ReadCspace::deployParameters(), Field< A >::innerStrSet(), ReadKkit::loadTab(), makeCompt(), makeReacTest(), moose_ObjId_setattro(), positionCompt(), ReadKkit::read(), ReadCspace::readModelString(), reorientSpine(), ChemCompt::setChildConcs(), moose::CompartmentBase::setGeomAndElec(), ReadKkit::setupSlaveMsg(), testBuildStoich(), testCalcJunction(), testCellDiffn(), testChildren(), testClock(), testCopyFieldElement(), testCylDiffn(), testCylDiffnWithStoich(), testMMenzProcess(), testMpiFibonacci(), testObjIdToAndFromPath(), testPoolVolumeScaling(), testReacVolumeScaling(), testReMesh(), testRunGsolve(), testRunKsolve(), testSendSpike(), testSetGet(), testSetGetDouble(), testSetGetExtField(), testSmallCellDiffn(), testStats(), testSyncSynapseSize(), testTaperingCylDiffn(), testTreeTraversal(), testVolScaling(), testWildcard(), and Stoich::zombifyModel().

246  {
247  string temp = "set" + field;
248  temp[3] = std::toupper( temp[3] );
249  return SetGet1< A >::set( dest, temp, arg );
250  }
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 Field< A >::setRepeat ( ObjId  destId,
const string &  field,
arg 
)
inlinestatic

Definition at line 260 of file SetGet.h.

References SetGet1< A >::setRepeat().

Referenced by testCopyFieldElement(), and testSetRepeat().

262  {
263  string temp = "set" + field;
264  temp[3] = std::toupper( temp[3] );
265  return SetGet1< A >::setRepeat( destId, temp, arg );
266  }
static bool setRepeat(ObjId destId, const string &field, const A &arg)
Definition: SetGet.h:213

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 252 of file SetGet.h.

References SetGet1< A >::setVec().

Referenced by moose_ElementField_setattro(), moose_Id_setattro(), testCopyFieldElement(), testSetGetExtField(), testSetGetSynapse(), testSetGetVec(), testSetRepeat(), testSparseMsg(), and testSyncSynapseSize().

254  {
255  string temp = "set" + field;
256  temp[3] = std::toupper( temp[3] );
257  return SetGet1< A >::setVec( destId, temp, arg );
258  }
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:


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