Skip to content

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:

  • T The 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

typedef fpga_result(* opae::fpga::types::pvalue< T >::setter_t) (fpga_properties, T);

Public Functions Documentation

function get_value

inline fpga_result opae::fpga::types::pvalue::get_value (
    T & value
) const

function invalidate

inline void opae::fpga::types::pvalue::invalidate () 

function is_set

inline bool opae::fpga::types::pvalue::is_set () const

function operator copy_t

Implicit converter operator - calls the wrapped getter.

inline opae::fpga::types::pvalue::operator copy_t () 

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.

inline pvalue < T > & opae::fpga::types::pvalue::operator= (
    const T & v
) 

Parameters:

  • v The value to set

Returns:

A reference to itself

function operator==

Compare a property for equality with a value.

inline bool opae::fpga::types::pvalue::operator== (
    const T & other
) 

Parameters:

  • other The value being compared to

Returns:

Whether or not the property is equal to the value

function pvalue [½]

inline opae::fpga::types::pvalue::pvalue () 

function pvalue [2/2]

pvalue contructor that takes in a reference to fpga_properties and corresponding accessor methods for a property

inline opae::fpga::types::pvalue::pvalue (
    fpga_properties * p,
    getter_t g,
    setter_t s
) 

Parameters:

  • p A reference to an fpga_properties
  • g The getter function
  • s The setter function

function update [½]

inline void opae::fpga::types::pvalue::update () 

function update [2/2]

Template specialization of char* type property updater.

inline void opae::fpga::types::pvalue::update () 

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:

  • ostr The output stream
  • p A 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