Struct opae::fpga::types::pvalue¶
template <typename T typename T>
ClassList > opae > fpga > types > pvalue
Wraps OPAE properties defined in the OPAE C API by associating an fpga_properties reference with the getters and setters defined for a property.More...
#include <pvalue.h>
Public Types¶
| Type | Name |
|---|---|
| typedef std::conditional< std::is_same< T, char * >::value, typename std::string, T >::type | copy_t Define the type of our copy variable For char* types use std::string as the copy. |
| typedef std::conditional< std::is_same< T, char * >::value, fpga_result(*)(fpga_properties, T), fpga_result(*)(fpga_properties, T *)>::type | getter_t Define getter function as getter_t For char* types, do not use T* as the second argument but instead use T. |
| typedef fpga_result(* | setter_t Define the setter function as setter_t. |
Public Functions¶
| Type | Name |
|---|---|
| fpga_result | get_value (T & value) const |
| void | invalidate () Invalidate the cached local copy of the pvalue. |
| bool | is_set () const Tracks whether the cached local copy of the pvalue is valid. |
| operator copy_t () Implicit converter operator - calls the wrapped getter. |
|
| pvalue< T > & | operator= (const T & v) Overload of = operator that calls the wrapped setter. |
| bool | operator== (const T & other) Compare a property for equality with a value. |
| pvalue () |
|
| pvalue (fpga_properties * p, getter_t g, setter_t s) pvalue contructor that takes in a reference to fpga_properties and corresponding accessor methods for a property |
|
| void | update () |
| void | update () Template specialization of char* type property updater. |
Detailed Description¶
Template parameters:
TThe type of the property value being wrapped
Public Types Documentation¶
typedef copy_t¶
typedef std::conditional<std::is_same<T, char *>::value, typename std::string, T>::type opae::fpga::types::pvalue< T >::copy_t;
typedef getter_t¶
typedef std::conditional< std::is_same<T, char *>::value, fpga_result (*)(fpga_properties, T), fpga_result (*)(fpga_properties, T *)>::type opae::fpga::types::pvalue< T >::getter_t;
typedef setter_t¶
Public Functions Documentation¶
function get_value¶
function invalidate¶
function is_set¶
function operator copy_t¶
Implicit converter operator - calls the wrapped getter.
Returns:
The property value after calling the getter or a default value of the value type
function operator=¶
Overload of = operator that calls the wrapped setter.
Parameters:
vThe value to set
Returns:
A reference to itself
function operator==¶
Compare a property for equality with a value.
Parameters:
otherThe value being compared to
Returns:
Whether or not the property is equal to the value
function pvalue [½]¶
function pvalue [2/2]¶
pvalue contructor that takes in a reference to fpga_properties and corresponding accessor methods for a property
Parameters:
pA reference to an fpga_propertiesgThe getter functionsThe setter function
function update [½]¶
function update [2/2]¶
Template specialization of char* type property updater.
Returns:
The result of the property getter function.
## Friends Documentation
friend operator<<¶
Stream overalod operator.
inline std::ostream & opae::fpga::types::pvalue::operator<< (
std::ostream & ostr,
const pvalue < T > & p
)
Parameters:
ostrThe output streampA reference to a pvalue<T> object
Returns:
The stream operator after streaming the property value
The documentation for this class was generated from the following file docs/sw/include/opae/cxx/core/pvalue.h