Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Xyce::Device::Entry< T > Class Template Reference

Class Entry<T> defines the parameter member variable access for parameter member variable of type T. More...

#include <N_DEV_Pars.h>

Public Member Functions

 Entry (T ParameterBase::*member_value_ptr, const T &default_value=T())
 Constructs an Entry. More...
 
virtual ~Entry ()
 Destroys the entry. More...
 
virtual const std::type_info & type () const
 Returns type_info of this entry. More...
 
T ParameterBase::* getMemberPtr () const
 Return the member pointer to the data member variable that holds the value associated with this parameter. More...
 
const T & getValue (const ParameterBase &entity) const
 Return the value of the entity's parameter. More...
 
T & getValue (ParameterBase &entity) const
 Return the value of the entity's parameter. More...
 
void setValue (ParameterBase &entity, const T &value) const
 Sets the value of the entity's parameter. More...
 
const T & getDefaultValue () const
 Return the default value of the parameter. More...
 
void setDefaultValue (const T &value)
 Sets the parameter's default value. More...
 

Private Member Functions

 Entry (const Entry &)
 No copying. More...
 
Entryoperator= (const Entry &)
 No assignment. More...
 
virtual std::ostream & doPrint (std::ostream &os) const
 Prints the value of the entry to the output stream. More...
 

Private Attributes

defaultValue_
 Default value of parameter. More...
 
T ParameterBase::* memberValuePtr_
 Member pointer containing value. More...
 

Detailed Description

template<class T>
class Xyce::Device::Entry< T >

Class Entry<T> defines the parameter member variable access for parameter member variable of type T.

The pointer to the parameter member variable and the default value to set are contained in this class.

Definition at line 223 of file N_DEV_Pars.h.

Constructor & Destructor Documentation

template<class T>
Xyce::Device::Entry< T >::Entry ( T ParameterBase::*  member_value_ptr,
const T &  default_value = T() 
)
inline

Constructs an Entry.

Initializes the parameter member variable pointer of type T. Note the member variable pointer are actually offsets into an object where the data for the member exists. So, by storing this pointer the value of any object of type can be retrieved.

The default value ot type T is also contained here.

Parameters
member_value_ptrparameter member variable pointer
default_valueDefault value of parameter

Definition at line 339 of file N_DEV_Pars.h.

template<class T>
virtual Xyce::Device::Entry< T >::~Entry ( )
inlinevirtual

Destroys the entry.

Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:30:29 2013

Definition at line 350 of file N_DEV_Pars.h.

template<class T>
Xyce::Device::Entry< T >::Entry ( const Entry< T > &  )
private

No copying.

Member Function Documentation

template<class T>
virtual std::ostream& Xyce::Device::Entry< T >::doPrint ( std::ostream &  os) const
inlineprivatevirtual

Prints the value of the entry to the output stream.

Parameters
osoutput stream to write to
Returns
reference to the output stream
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:29:29 2013

Definition at line 379 of file N_DEV_Pars.h.

template<class T>
const T& Xyce::Device::Entry< T >::getDefaultValue ( ) const
inline

Return the default value of the parameter.

All parameters provide a default value when created. The parameter is set to this value and the given flag is cleared on construction. If the value is provided by the net list, the parameter's value is set accordingly and given flag is set to true.

Returns
const reference to the parameter's default value
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:35:18 2013

Definition at line 457 of file N_DEV_Pars.h.

template<class T>
T ParameterBase::* Xyce::Device::Entry< T >::getMemberPtr ( ) const
inline

Return the member pointer to the data member variable that holds the value associated with this parameter.

Returns
member pointer to the data member variable
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:31:21 2013

Definition at line 394 of file N_DEV_Pars.h.

template<class T>
const T& Xyce::Device::Entry< T >::getValue ( const ParameterBase entity) const
inline

Return the value of the entity's parameter.

Parameters
entitydevice class or device instance
Returns
const reference to the value of the entity's parameter
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:32:58 2013

Definition at line 409 of file N_DEV_Pars.h.

template<class T>
T& Xyce::Device::Entry< T >::getValue ( ParameterBase entity) const
inline

Return the value of the entity's parameter.

Parameters
entitydevice class or device instance
Returns
reference to the value of the entity's parameter
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:32:58 2013

Definition at line 424 of file N_DEV_Pars.h.

template<class T>
Entry& Xyce::Device::Entry< T >::operator= ( const Entry< T > &  )
private

No assignment.

template<class T>
void Xyce::Device::Entry< T >::setDefaultValue ( const T &  value)
inline

Sets the parameter's default value.

All parameters provide a default value when created. The parameter is set to this value and the given flag is cleared on construction. If the value is provided by the net list, the parameter's value is set accordingly and given flag is set to true.

Parameters
valuedefault value of the parameter
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:37:50 2013

Definition at line 476 of file N_DEV_Pars.h.

template<class T>
void Xyce::Device::Entry< T >::setValue ( ParameterBase entity,
const T &  value 
) const
inline

Sets the value of the entity's parameter.

Parameters
entitydevice class or device instance
valuevalue to set the entity's parameter to
Author
David G. Baur Raytheon Sandia National Laboratories 1355
Date
Wed Aug 7 11:32:58 2013

Definition at line 438 of file N_DEV_Pars.h.

template<class T>
virtual const std::type_info& Xyce::Device::Entry< T >::type ( ) const
inlinevirtual

Returns type_info of this entry.

Returns
const reference to type_info of this entry

Definition at line 363 of file N_DEV_Pars.h.

Member Data Documentation

template<class T>
T Xyce::Device::Entry< T >::defaultValue_
private

Default value of parameter.

Definition at line 482 of file N_DEV_Pars.h.

template<class T>
T ParameterBase::* Xyce::Device::Entry< T >::memberValuePtr_
private

Member pointer containing value.

Definition at line 483 of file N_DEV_Pars.h.


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