MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SetGet.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-2009 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 _SETGET_H
11 #define _SETGET_H
12 
13 // Forward declaration needed for localGet()
14 template< class T, class A > class GetOpFunc;
15 
29 template< class T, class A >
30 A localGet( const Eref& er, string field )
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 }
49 
50 class SetGet
51 {
52  public:
54  {;}
55 
56  virtual ~SetGet()
57  {;}
58 
70  static const OpFunc* checkSet(
71  const string& field, ObjId& tgt, FuncId& fid );
72 
74 
78  static bool strGet( const ObjId& tgt, const string& field, string& ret );
79 
84  static bool strSet( const ObjId& dest, const string& field, const string& val );
85 
87  static const vector< double* >* dispatchGet(
88  const ObjId& tgt, FuncId tgtFid,
89  const double* arg, unsigned int size );
90 
91  virtual bool checkOpClass( const OpFunc* op ) const = 0;
92 };
93 
94 class SetGet0: public SetGet
95 {
96  public:
98  {;}
99 
103  static bool set( const ObjId& dest, const string& field )
104  {
105  FuncId fid;
106  ObjId tgt( dest ); // checkSet may change the tgt.
107  const OpFunc* func = checkSet( field, tgt, fid );
108  const OpFunc0Base* op =
109  dynamic_cast< const OpFunc0Base* >( func );
110  if ( op ) {
111  if ( tgt.isOffNode() ) {
112  const OpFunc* op2 = op->makeHopFunc(
113  HopIndex( op->opIndex(), MooseSetHop ) );
114  const OpFunc0Base* hop =
115  dynamic_cast< const OpFunc0Base* >( op2 );
116  assert( hop );
117  hop->op( tgt.eref() );
118  delete op2;
119  if ( tgt.isGlobal() )
120  op->op( tgt.eref() );
121  return true;
122  } else {
123  op->op( tgt.eref() );
124  return true;
125  }
126  }
127  return 0;
128  }
129 
133  static bool innerStrSet( const ObjId& dest, const string& field,
134  const string& val )
135  {
136  return set( dest, field );
137  }
138 
139  bool checkOpClass( const OpFunc* op ) const {
140  return dynamic_cast< const OpFunc0Base* >( op );
141  }
142 };
143 
144 template< class A > class SetGet1: public SetGet
145 {
146  public:
148  {;}
149 
153  static bool set( const ObjId& dest, const string& field, A arg )
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  }
178 
188  static bool setVec( ObjId destId, const string& field,
189  const vector< A >& arg )
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  }
209 
213  static bool setRepeat( ObjId destId, const string& field,
214  const A& arg )
215  {
216  vector< A >temp ( 1, arg );
217  return setVec( destId, field, temp );
218  }
219 
223  static bool innerStrSet( const ObjId& dest, const string& field,
224  const string& val )
225  {
226  A arg;
227  Conv< A >::str2val( arg, val );
228  return set( dest, field, arg );
229  }
230 
231  bool checkOpClass( const OpFunc* op ) const {
232  return dynamic_cast< const OpFunc1Base< A > * >( op );
233  }
234 };
235 
236 template< class A > class Field: public SetGet1< A >
237 {
238  public:
240  {;}
241 
245  static bool set( const ObjId& dest, const string& field, A arg )
246  {
247  string temp = "set" + field;
248  temp[3] = std::toupper( temp[3] );
249  return SetGet1< A >::set( dest, temp, arg );
250  }
251 
252  static bool setVec( ObjId destId, const string& field,
253  const vector< A >& arg )
254  {
255  string temp = "set" + field;
256  temp[3] = std::toupper( temp[3] );
257  return SetGet1< A >::setVec( destId, temp, arg );
258  }
259 
260  static bool setRepeat( ObjId destId, const string& field,
261  A arg )
262  {
263  string temp = "set" + field;
264  temp[3] = std::toupper( temp[3] );
265  return SetGet1< A >::setRepeat( destId, temp, arg );
266  }
267 
271  static bool innerStrSet( const ObjId& dest, const string& field,
272  const string& arg )
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  }
280 
282 
283  // Returns a field value.
284  static A get( const ObjId& dest, const string& field)
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  }
313 
317  static void getVec( ObjId dest, const string& field, vector< A >& vec)
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  }
340 
345  static bool innerStrGet( const ObjId& dest, const string& field,
346  string& str )
347  {
348  Conv< A >::val2str( str, get( dest, field ) );
349  return 1;
350  }
351 };
352 
356 template< class A1, class A2 > class SetGet2: public SetGet
357 {
358  public:
360  {;}
361 
365  static bool set( const ObjId& dest, const string& field,
366  A1 arg1, A2 arg2 )
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  }
391 
404  static bool setVec( Id destId, const string& field,
405  const vector< A1 >& arg1, const vector< A2 >& arg2 )
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  }
433 
437  static bool innerStrSet( const ObjId& dest, const string& field,
438  const string& val )
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  }
447 };
448 
457 template< class L, class A > class LookupField: public SetGet2< L, A >
458 {
459  public:
460  LookupField( const ObjId& dest )
461  : SetGet2< L, A >( dest )
462  {;}
463 
467  static bool set( const ObjId& dest, const string& field,
468  L index, A arg )
469  {
470  string temp = "set" + field;
471  temp[3] = std::toupper( temp[3] );
472  return SetGet2< L, A >::set( dest, temp, index, arg );
473  }
474 
479  static bool setVec( Id destId, const string& field,
480  const vector< L >& index, const vector< A >& arg )
481  {
482  string temp = "set" + field;
483  temp[3] = std::toupper( temp[3] );
484  return SetGet2< L, A >::setVec( destId, temp, index, arg );
485  }
486 
493  static bool setVec( ObjId dest, const string& field,
494  const vector< L >& index, const vector< A >& arg )
495  {
496  string temp = "set" + field;
497  temp[3] = std::toupper( temp[3] );
498  return SetGet2< L, A >::setVec( dest, temp, index, arg );
499  }
500 
504  static bool setRepeat( Id destId, const string& field,
505  const vector< L >& index, A arg )
506  {
507  vector< A > avec( index.size(), arg );
508  return setVec( destId, field, index, avec );
509  }
510 
514  static bool innerStrSet( const ObjId& dest, const string& field,
515  const string& indexStr, const string& val )
516  {
517  L index;
518  Conv< L >::str2val( index, indexStr );
519 
520  A arg;
521  // Do NOT add 'set_' to the field name, as the 'set' func
522  // does it anyway.
523  Conv< A >::str2val( arg, val );
524  return set( dest, field, index, arg );
525  }
526 
531  // Returns a field value.
532  static A get( const ObjId& dest, const string& field, L index )
533  {
534  ObjId tgt( dest );
535  FuncId fid;
536  string fullFieldName = "get" + field;
537  fullFieldName[3] = std::toupper( fullFieldName[3] );
538  const OpFunc* func = SetGet::checkSet( fullFieldName, tgt, fid);
539  const LookupGetOpFuncBase< L, A >* gof =
540  dynamic_cast< const LookupGetOpFuncBase< L, A >* >( func );
541  if ( gof ) {
542  if ( tgt.isDataHere() ) {
543  return gof->returnOp( tgt.eref(), index );
544  } else {
545  /*
546  const OpFunc* op2 = gof->makeHopFunc(
547  HopIndex( gof->opIndex(), MooseGetHop ), index );
548  const OpFunc1Base< A* >* hop =
549  dynamic_cast< const OpFunc1Base< A* >* >( op2 );
550  */
551  cout << "Warning: LookupField::get: cannot cross nodes yet\n";
552  return A();
553  /*
554  assert( hop );
555  // Blocking function.
556  hop->op( tgt.eref(), &ret );
557  delete op2;
558  return ret;
559  */
560  }
561  }
562  cout << "LookupField::get: Warning: Field::Get conversion error for " <<
563  dest.id.path() << "." << field << endl;
564  return A();
565  }
566 
573  static void getVec( Id dest, const string& field,
574  vector< L >& index, vector< A >& vec )
575  {
576  vec.resize( 0 );
577  ObjId tgt( dest );
578  FuncId fid;
579  string fullFieldName = "get" + field;
580  fullFieldName[3] = std::toupper( fullFieldName[3] );
581  const OpFunc* func = SetGet::checkSet( fullFieldName, tgt, fid );
582  const LookupGetOpFuncBase< L, A >* gof =
583  dynamic_cast< const LookupGetOpFuncBase< L, A >* >( func );
584  if ( gof ) {
585  Element* elm = dest.element();
586  unsigned int size = vec.size(); // temporary. See SetVec.
587  vec.resize( size );
588  for ( unsigned int i = 0; i < size; ++i ) {
589  Eref e( elm, i );
590  vec[i] = gof->returnOp( e, index );
591  }
592  return;
593  }
594  cout << "Warning: Field::getVec conversion error for " <<
595  dest.path() << endl;
596  }
597 
602  static bool innerStrGet( const ObjId& dest, const string& field,
603  const string& indexStr, string& str )
604  {
605  L index;
606  Conv< L >::str2val( index, indexStr );
607 
608  A ret = get( dest, field, index );
609  Conv<A>::val2str( str, ret );
610  return 1;
611  }
612 };
613 
617 template< class A1, class A2, class A3 > class SetGet3: public SetGet
618 {
619  public:
621  {;}
622 
626  static bool set( const ObjId& dest, const string& field,
627  A1 arg1, A2 arg2, A3 arg3 )
628  {
629  FuncId fid;
630  ObjId tgt( dest );
631  const OpFunc* func = checkSet( field, tgt, fid );
633  dynamic_cast< const OpFunc3Base< A1, A2, A3 >* >( func);
634  if ( op ) {
635  if ( tgt.isOffNode() ) {
636  const OpFunc* op2 = op->makeHopFunc(
637  HopIndex( op->opIndex(), MooseSetHop ) );
638  const OpFunc3Base< A1, A2, A3 >* hop =
639  dynamic_cast< const OpFunc3Base< A1, A2, A3 >* >(
640  op2 );
641  hop->op( tgt.eref(), arg1, arg2, arg3 );
642  delete op2;
643  if ( tgt.isGlobal() )
644  op->op( tgt.eref(), arg1, arg2, arg3 );
645  return true;
646  } else {
647  op->op( tgt.eref(), arg1, arg2, arg3 );
648  return true;
649  }
650  }
651  return 0;
652  }
653 
659  static bool innerStrSet( const ObjId& dest, const string& field,
660  const string& val )
661  {
662  A1 arg1;
663  A2 arg2;
664  A3 arg3;
665  string::size_type pos = val.find_first_of( "," );
666  Conv< A1 >::str2val( arg1, val.substr( 0, pos ) );
667  string temp = val.substr( pos + 1 );
668  pos = temp.find_first_of( "," );
669  Conv< A2 >::str2val( arg2, temp.substr( 0,pos ) );
670  Conv< A3 >::str2val( arg3, temp.substr( pos + 1 ) );
671  return set( dest, field, arg1, arg2, arg3 );
672  }
673 };
674 
678 template< class A1, class A2, class A3, class A4 > class SetGet4: public SetGet
679 {
680  public:
682  {;}
683 
687  static bool set( const ObjId& dest, const string& field,
688  A1 arg1, A2 arg2, A3 arg3, A4 arg4 )
689  {
690  FuncId fid;
691  ObjId tgt( dest );
692  const OpFunc* func = checkSet( field, tgt, fid );
694  dynamic_cast< const OpFunc4Base< A1, A2, A3, A4 >* >( func);
695  if ( op ) {
696  if ( tgt.isOffNode() ) {
697  const OpFunc* op2 = op->makeHopFunc(
698  HopIndex( op->opIndex(), MooseSetHop ) );
699  const OpFunc4Base< A1, A2, A3, A4 >* hop =
700  dynamic_cast< const OpFunc4Base< A1, A2, A3, A4 >* >( op2 );
701  hop->op( tgt.eref(), arg1, arg2, arg3, arg4 );
702  delete op2;
703  if ( tgt.isGlobal() )
704  op->op( tgt.eref(), arg1, arg2, arg3, arg4 );
705  return true;
706  } else {
707  op->op( tgt.eref(), arg1, arg2, arg3, arg4 );
708  return true;
709  }
710  }
711  return 0;
712  }
713 
719  static bool innerStrSet( const ObjId& dest, const string& field,
720  const string& val )
721  {
722  A1 arg1;
723  A2 arg2;
724  A3 arg3;
725  A4 arg4;
726  string::size_type pos = val.find_first_of( "," );
727  Conv< A1 >::str2val( arg1, val.substr( 0, pos ) );
728  string temp = val.substr( pos + 1 );
729  pos = temp.find_first_of( "," );
730  Conv< A2 >::str2val( arg2, temp.substr( 0, pos ) );
731  temp = temp.substr( pos + 1 );
732  pos = temp.find_first_of( "," );
733  Conv< A3 >::str2val( arg3, temp.substr( 0, pos ) );
734  Conv< A4 >::str2val( arg4, temp.substr( pos + 1 ) );
735  return set( dest, field, arg1, arg2, arg3, arg4 );
736  }
737 };
738 
742 template< class A1, class A2, class A3, class A4, class A5 > class SetGet5:
743  public SetGet
744 {
745  public:
747  {;}
748 
749  static bool set( const ObjId& dest, const string& field,
750  A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5 )
751  {
752  FuncId fid;
753  ObjId tgt( dest );
754  const OpFunc* func = checkSet( field, tgt, fid );
756  dynamic_cast< const OpFunc5Base< A1, A2, A3, A4, A5 >* >( func);
757  if ( op ) {
758  if ( tgt.isOffNode() ) {
759  const OpFunc* op2 = op->makeHopFunc(
760  HopIndex( op->opIndex(), MooseSetHop ) );
762  dynamic_cast< const OpFunc5Base< A1, A2, A3, A4, A5 >* >( op2 );
763  hop->op( tgt.eref(), arg1, arg2, arg3, arg4, arg5 );
764  delete op2;
765  if ( tgt.isGlobal() )
766  op->op( tgt.eref(), arg1, arg2, arg3, arg4, arg5 );
767  return true;
768  } else {
769  op->op( tgt.eref(), arg1, arg2, arg3, arg4, arg5 );
770  return true;
771  }
772  }
773  return 0;
774  }
775 
781  static bool innerStrSet( const ObjId& dest, const string& field,
782  const string& val )
783  {
784  A1 arg1;
785  A2 arg2;
786  A3 arg3;
787  A4 arg4;
788  A5 arg5;
789  string::size_type pos = val.find_first_of( "," );
790  Conv< A1 >::str2val( arg1, val.substr( 0, pos ) );
791  string temp = val.substr( pos + 1 );
792  pos = temp.find_first_of( "," );
793  Conv< A2 >::str2val( arg2, temp.substr( 0, pos ) );
794  temp = temp.substr( pos + 1 );
795  pos = temp.find_first_of( "," );
796  Conv< A3 >::str2val( arg3, temp.substr( 0, pos ) );
797  temp = temp.substr( pos + 1 );
798  pos = temp.find_first_of( "," );
799  Conv< A4 >::str2val( arg4, temp.substr( 0, pos ) );
800  Conv< A5 >::str2val( arg5, temp.substr( pos + 1 ) );
801  return set( dest, field, arg1, arg2, arg3, arg4, arg5 );
802  }
803 };
804 
808 template< class A1, class A2, class A3, class A4, class A5, class A6 > class SetGet6:
809  public SetGet
810 {
811  public:
813  {;}
814 
818  static bool set( const ObjId& dest, const string& field,
819  A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6 )
820  {
821  FuncId fid;
822  ObjId tgt( dest );
823  const OpFunc* func = checkSet( field, tgt, fid );
825  dynamic_cast< const OpFunc6Base< A1, A2, A3, A4, A5, A6 >* >( func);
826  if ( op ) {
827  if ( tgt.isOffNode() ) {
828  const OpFunc* op2 = op->makeHopFunc(
829  HopIndex( op->opIndex(), MooseSetHop ) );
831  dynamic_cast< const OpFunc6Base< A1, A2, A3, A4, A5, A6 >* >( op2 );
832  hop->op( tgt.eref(), arg1, arg2, arg3, arg4, arg5, arg6 );
833  delete op2;
834  if ( tgt.isGlobal() )
835  op->op( tgt.eref(), arg1, arg2, arg3, arg4, arg5, arg6 );
836  return true;
837  } else {
838  op->op( tgt.eref(), arg1, arg2, arg3, arg4, arg5, arg6);
839  return true;
840  }
841  }
842  return 0;
843  }
844 
848  static bool innerStrSet( const ObjId& dest, const string& field,
849  const string& val )
850  {
851  A1 arg1;
852  A2 arg2;
853  A3 arg3;
854  A4 arg4;
855  A5 arg5;
856  A6 arg6;
857  string::size_type pos = val.find_first_of( "," );
858  Conv< A1 >::str2val( arg1, val.substr( 0, pos ) );
859  string temp = val.substr( pos + 1 );
860  pos = temp.find_first_of( "," );
861  Conv< A2 >::str2val( arg2, temp.substr( 0, pos ) );
862  temp = temp.substr( pos + 1 );
863  pos = temp.find_first_of( "," );
864  Conv< A3 >::str2val( arg3, temp.substr( 0, pos ) );
865  temp = temp.substr( pos + 1 );
866  pos = temp.find_first_of( "," );
867  Conv< A4 >::str2val( arg4, temp.substr( 0, pos ) );
868  temp = temp.substr( pos + 1 );
869  pos = temp.find_first_of( "," );
870  Conv< A5 >::str2val( arg5, temp.substr( 0, pos ) );
871  Conv< A6 >::str2val( arg6, temp.substr( pos + 1 ) );
872  return set( dest, field, arg1, arg2, arg3, arg4, arg5, arg6 );
873  }
874 };
875 
876 #endif // _SETGET_H
const unsigned char MooseGetVecHop
Definition: OpFuncBase.cpp:16
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6) const =0
virtual void opVec(const Eref &e, const vector< A > &arg, const OpFunc1Base< A > *op) const
Definition: OpFuncBase.h:136
Definition: SetGet.h:50
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3, A4 arg4) const =0
static bool set(const ObjId &dest, const string &field, L index, A arg)
Definition: SetGet.h:467
static const OpFunc * checkSet(const string &field, ObjId &tgt, FuncId &fid)
Definition: SetGet.cpp:15
virtual A returnOp(const Eref &e) const =0
static bool setVec(Id destId, const string &field, const vector< A1 > &arg1, const vector< A2 > &arg2)
Definition: SetGet.h:404
SetGet()
Definition: SetGet.h:53
static double op(double x)
virtual void op(const Eref &e, A arg) const =0
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.h:719
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
bool checkOpClass(const OpFunc *op) const
Definition: SetGet.h:231
static bool setRepeat(ObjId destId, const string &field, A arg)
Definition: SetGet.h:260
virtual A returnOp(const Eref &e, const L &index) const =0
Definition: SetGet.h:236
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:330
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:299
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:183
SetGet0()
Definition: SetGet.h:97
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5, A6 arg6)
Definition: SetGet.h:818
SetGet1()
Definition: SetGet.h:147
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.h:223
Definition: ObjId.h:20
virtual bool checkOpClass(const OpFunc *op) const =0
Element * element() const
Definition: Eref.h:42
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5) const =0
static bool set(const ObjId &dest, const string &field, A arg)
Definition: SetGet.h:245
bool isDataHere() const
Definition: ObjId.cpp:95
void opGetVec(const Eref &e, vector< A > &ret, const GetOpFuncBase< A > *op) const
Definition: HopFunc.h:484
virtual void opVec(const Eref &e, const vector< A1 > &arg1, const vector< A2 > &arg2, const OpFunc2Base< A1, A2 > *op) const
Definition: OpFuncBase.h:182
virtual void op(const Eref &e) const =0
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.
const unsigned char MooseGetHop
Definition: OpFuncBase.cpp:15
static bool setVec(Id destId, const string &field, const vector< L > &index, const vector< A > &arg)
Definition: SetGet.h:479
static bool strSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.cpp:84
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.h:848
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:399
bool isGlobal() const
Returns true if the Element is global.
Definition: ObjId.cpp:100
static bool setRepeat(Id destId, const string &field, const vector< L > &index, A arg)
Definition: SetGet.h:504
A localGet(const Eref &er, string field)
Definition: SetGet.h:30
virtual void op(const Eref &e, A1 arg1, A2 arg2) const =0
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
static bool innerStrSet(const ObjId &dest, const string &field, const string &arg)
Definition: SetGet.h:271
static bool innerStrSet(const ObjId &dest, const string &field, const string &indexStr, const string &val)
Definition: SetGet.h:514
SetGet3()
Definition: SetGet.h:620
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.h:133
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.h:437
static bool innerStrGet(const ObjId &dest, const string &field, string &str)
Definition: SetGet.h:345
static bool strGet(const ObjId &tgt, const string &field, string &ret)
Definition: SetGet.cpp:72
static void getVec(Id dest, const string &field, vector< L > &index, vector< A > &vec)
Definition: SetGet.h:573
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
Definition: SetGet.h:687
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.h:659
bool checkOpClass(const OpFunc *op) const
Definition: SetGet.h:139
Definition: Eref.h:26
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:513
static bool innerStrGet(const ObjId &dest, const string &field, const string &indexStr, string &str)
Definition: SetGet.h:602
const Cinfo * cinfo() const
Definition: Element.cpp:66
const unsigned char MooseSetVecHop
Definition: OpFuncBase.cpp:14
const unsigned char MooseSetHop
Definition: OpFuncBase.cpp:13
static bool innerStrSet(const ObjId &dest, const string &field, const string &val)
Definition: SetGet.h:781
virtual void op(const Eref &e, A1 arg1, A2 arg2, A3 arg3) const =0
static void str2val(T &val, const string &s)
Definition: Conv.h:65
SetGet5()
Definition: SetGet.h:746
SetGet4()
Definition: SetGet.h:681
static bool setVec(ObjId destId, const string &field, const vector< A > &arg)
Definition: SetGet.h:252
Field()
Definition: SetGet.h:239
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:364
const OpFunc * getOpFunc() const
Definition: DestFinfo.cpp:40
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3, A4 arg4, A5 arg5)
Definition: SetGet.h:749
static bool set(const ObjId &dest, const string &field)
Definition: SetGet.h:103
SetGet2()
Definition: SetGet.h:359
static bool setVec(ObjId dest, const string &field, const vector< L > &index, const vector< A > &arg)
Definition: SetGet.h:493
Eref eref() const
Definition: ObjId.cpp:66
static bool set(const ObjId &dest, const string &field, A arg)
Definition: SetGet.h:153
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2, A3 arg3)
Definition: SetGet.h:626
virtual ~SetGet()
Definition: SetGet.h:56
Definition: Id.h:17
static void val2str(string &s, const T &val)
Definition: Conv.h:74
static void getVec(ObjId dest, const string &field, vector< A > &vec)
Definition: SetGet.h:317
unsigned int FuncId
Definition: header.h:42
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: HopFunc.h:269
SetGet6()
Definition: SetGet.h:812
static bool setVec(ObjId destId, const string &field, const vector< A > &arg)
Definition: SetGet.h:188
static bool setRepeat(ObjId destId, const string &field, const A &arg)
Definition: SetGet.h:213
LookupField(const ObjId &dest)
Definition: SetGet.h:460
Definition: SetGet.h:94
const OpFunc * makeHopFunc(HopIndex hopIndex) const
Definition: OpFuncBase.cpp:32
virtual void resize(unsigned int newNumData)=0
const Finfo * findFinfo(const string &name) const
Definition: Cinfo.cpp:224
Definition: Finfo.h:12
static bool set(const ObjId &dest, const string &field, A1 arg1, A2 arg2)
Definition: SetGet.h:365
unsigned int opIndex() const
Definition: OpFuncBase.h:66