$extrastylesheet
libMesh::ParameterPointer< T > Class Template Reference

#include <parameter_pointer.h>

Inheritance diagram for libMesh::ParameterPointer< T >:

List of all members.

Public Member Functions

 ParameterPointer (T *param_ptr)
virtual void set (const T &new_value)
virtual const T & get () const
virtual void operator= (T *new_ptr)
ParameterProxy< T > operator* ()
ConstParameterProxy< T > operator* () const

Private Attributes

T * _ptr

Detailed Description

template<typename T = Number>
class libMesh::ParameterPointer< T >

Accessor object allowing reading and modification of the independent variables in a parameter sensitivity calculation.

This is the "default" ParameterAccessor subclass: it simply stores a user-provided pointer to the parameter, and modifies the value at that location in memory.

Definition at line 40 of file parameter_pointer.h.


Constructor & Destructor Documentation

template<typename T = Number>
libMesh::ParameterPointer< T >::ParameterPointer ( T *  param_ptr) [inline]

Constructor: take the raw pointer to the parameter

Definition at line 46 of file parameter_pointer.h.

: _ptr(param_ptr) {}

Member Function Documentation

template<typename T = Number>
virtual const T& libMesh::ParameterPointer< T >::get ( ) const [inline, virtual]

Getter: get the value of the parameter we access.

Implements libMesh::ParameterAccessor< T >.

Definition at line 55 of file parameter_pointer.h.

References libMesh::ParameterPointer< T >::_ptr, and libMesh::libmesh_assert().

{ libmesh_assert(_ptr); return *_ptr; }
template<typename T = Number>
ParameterProxy<T> libMesh::ParameterAccessor< T >::operator* ( ) [inline, inherited]

Proxy: for backward compatibility, we allow codes to treat a ParameterAccessor as if it were a simple pointer-to-value. We can't safely allow "Number *n = parameter_vector[p]" to compile, but we can allow "*parameter_vector[p] += deltap" to work.

Definition at line 80 of file parameter_accessor.h.

{ return ParameterProxy<T>(*this); }
template<typename T = Number>
ConstParameterProxy<T> libMesh::ParameterAccessor< T >::operator* ( ) const [inline, inherited]

Definition at line 82 of file parameter_accessor.h.

{ return ConstParameterProxy<T>(*this); }
template<typename T = Number>
virtual void libMesh::ParameterPointer< T >::operator= ( T *  new_ptr) [inline, virtual]

Reseater: change the location of the parameter we access. This is included for backward compatibility, but is deprecated.

Reimplemented from libMesh::ParameterAccessor< T >.

Definition at line 61 of file parameter_pointer.h.

References libMesh::ParameterPointer< T >::_ptr.

{ libmesh_deprecated(); _ptr = new_ptr; }
template<typename T = Number>
virtual void libMesh::ParameterPointer< T >::set ( const T &  new_value) [inline, virtual]

Setter: change the value of the parameter we access.

Implements libMesh::ParameterAccessor< T >.

Definition at line 50 of file parameter_pointer.h.

References libMesh::ParameterPointer< T >::_ptr, and libMesh::libmesh_assert().

{ libmesh_assert(_ptr); *_ptr = new_value; }

Member Data Documentation


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