MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
LookupValueFinfo< T, L, F > Class Template Reference

#include <LookupValueFinfo.h>

+ Inheritance diagram for LookupValueFinfo< T, L, F >:
+ Collaboration diagram for LookupValueFinfo< T, L, F >:

Public Member Functions

 LookupValueFinfo (const string &name, const string &doc, void(T::*setFunc)(L, F), F(T::*getFunc)(L) const )
 
void registerFinfo (Cinfo *c)
 
string rttiType () const
 
bool strGet (const Eref &tgt, const string &field, string &returnValue) const
 
bool strSet (const Eref &tgt, const string &field, const string &arg) const
 
 ~LookupValueFinfo ()
 
- Public Member Functions inherited from LookupValueFinfoBase
 LookupValueFinfoBase (const string &name, const string &doc)
 
 ~LookupValueFinfoBase ()
 
- Public Member Functions inherited from Finfo
virtual bool addMsg (const Finfo *target, ObjId mid, Element *src) const
 
virtual bool checkTarget (const Finfo *target) const
 
const string & docs () const
 Returns documentation string. More...
 
 Finfo (const string &name, const string &doc)
 
virtual vector< string > innerDest () const
 
virtual vector< string > innerSrc () const
 
const string & name () const
 
virtual void postCreationFunc (Id newId, Element *newElm) const
 
virtual ~Finfo ()
 

Private Attributes

DestFinfoget_
 
DestFinfoset_
 

Additional Inherited Members

- Static Public Member Functions inherited from Finfo
static const CinfoinitCinfo ()
 

Detailed Description

template<class T, class L, class F>
class LookupValueFinfo< T, L, F >

This class manages field access for fields that have an index, or other lookup handle. Here T is the parent class L is the lookup class F is the field class.

Definition at line 34 of file LookupValueFinfo.h.

Constructor & Destructor Documentation

template<class T, class L, class F>
LookupValueFinfo< T, L, F >::~LookupValueFinfo ( )
inline

Definition at line 37 of file LookupValueFinfo.h.

References LookupValueFinfo< T, L, F >::get_, and LookupValueFinfo< T, L, F >::set_.

37  {
38  delete set_;
39  delete get_;
40  }
template<class T, class L, class F>
LookupValueFinfo< T, L, F >::LookupValueFinfo ( const string &  name,
const string &  doc,
void(T::*)(L, F)  setFunc,
F(T::*)(L) const  getFunc 
)
inline

Definition at line 42 of file LookupValueFinfo.h.

References LookupValueFinfo< T, L, F >::get_, Finfo::name(), and LookupValueFinfo< T, L, F >::set_.

45  : LookupValueFinfoBase( name, doc )
46  {
47  string setname = "set" + name;
48  setname[3] = std::toupper( setname[3] );
49  set_ = new DestFinfo(
50  setname,
51  "Assigns field value.",
52  new OpFunc2< T, L, F >( setFunc ) );
53 
54  string getname = "get" + name;
55  getname[3] = std::toupper( getname[3] );
56  get_ = new DestFinfo(
57  getname,
58  "Requests field value. The requesting Element must "
59  "provide a handler for the returned value.",
60  new GetOpFunc1< T, L, F >( getFunc ) );
61  }
const string & name() const
Definition: Finfo.cpp:80
Definition: OpFunc.h:40
LookupValueFinfoBase(const string &name, const string &doc)

+ Here is the call graph for this function:

Member Function Documentation

template<class T, class L, class F>
void LookupValueFinfo< T, L, F >::registerFinfo ( Cinfo c)
inlinevirtual

Returns string-ified form to handle template expectations for name field string getName() const; Assign function Ids, bindIndex and so on.

Implements Finfo.

Definition at line 64 of file LookupValueFinfo.h.

References LookupValueFinfo< T, L, F >::get_, Cinfo::registerFinfo(), and LookupValueFinfo< T, L, F >::set_.

64  {
65  c->registerFinfo( set_ );
66  c->registerFinfo( get_ );
67  }
void registerFinfo(Finfo *f)
Definition: Cinfo.cpp:114

+ Here is the call graph for this function:

template<class T, class L, class F>
string LookupValueFinfo< T, L, F >::rttiType ( ) const
inlinevirtual

Returns the documentation string for the Finfo string docs() const; Returns the RTTI type string for the finfo by referring to an internal virtual function. string type() const; Returns the list of subsidiary SrcFinfos. Used in Shared Finfos, empty otherwise. Goes via internal virtual function. vector< string > src() const; Returns the list of subsidiary destFinfos. Used in SharedFinfos and ValueFinfos, empty otherwise. Goes via internal virtual function. vector< string > dest() const; Returns an RTTI type string for this Finfo.

Reimplemented from Finfo.

Definition at line 85 of file LookupValueFinfo.h.

References Conv< T >::rttiType().

85  {
86  return Conv<L>::rttiType() + "," + Conv<F>::rttiType();
87  }
static string rttiType()
Definition: Conv.h:82

+ Here is the call graph for this function:

template<class T, class L, class F>
bool LookupValueFinfo< T, L, F >::strGet ( const Eref tgt,
const string &  field,
string &  returnValue 
) const
inlinevirtual

Function to return value of field into a string argument. Returns true on success. Normally called only from SetGet::strGet.

Implements Finfo.

Definition at line 77 of file LookupValueFinfo.h.

References LookupField< L, A >::innerStrGet(), and Eref::objId().

78  {
79  string fieldPart = field.substr( 0, field.find( "[" ) );
80  string indexPart = field.substr( field.find( "[" ) + 1, field.find( "]" ) );
82  fieldPart, indexPart, returnValue );
83  }
ObjId objId() const
Definition: Eref.cpp:57
static bool innerStrGet(const ObjId &dest, const string &field, const string &indexStr, string &str)
Definition: SetGet.h:602

+ Here is the call graph for this function:

template<class T, class L, class F>
bool LookupValueFinfo< T, L, F >::strSet ( const Eref tgt,
const string &  field,
const string &  arg 
) const
inlinevirtual

Function to set this field using a string argument. Returns true on success. Normally called only from SetGet::strSet.

Implements Finfo.

Definition at line 69 of file LookupValueFinfo.h.

References LookupField< L, A >::innerStrSet(), and Eref::objId().

70  {
71  string fieldPart = field.substr( 0, field.find( "[" ) );
72  string indexPart = field.substr( field.find( "[" ) + 1, field.find( "]" ) );
74  tgt.objId(), fieldPart, indexPart, arg );
75  }
static bool innerStrSet(const ObjId &dest, const string &field, const string &indexStr, const string &val)
Definition: SetGet.h:514
ObjId objId() const
Definition: Eref.cpp:57

+ Here is the call graph for this function:

Member Data Documentation


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