USRP Hardware Driver and Device Manual  Version: 4.11.0.0-0-g0d7ed3b1
UHD and USRP Manual
uhd::rfnoc::property_t< data_t > Class Template Reference

#include <uhd/rfnoc/property.hpp>

Inheritance diagram for uhd::rfnoc::property_t< data_t >:
uhd::rfnoc::property_base_t

Detailed Description

template<typename data_t>
class uhd::rfnoc::property_t< data_t >

An encapsulation class for a block property.

Public Types

using value_type = data_t
 We want to be good C++ citizens. More...
 
- Public Types inherited from uhd::rfnoc::property_base_t
enum  access_t { NONE , RO = 0x1 , RW = 0x3 , RWLOCKED = 0x5 }
 

Public Member Functions

 property_t (const std::string &id, data_t &&value, const res_source_info &source_info)
 
 property_t (const std::string &id, const data_t &value, const res_source_info &source_info)
 
 property_t (const std::string &id, const res_source_info &source_info)
 
 property_t (const property_t< data_t > &prop)=default
 
bool is_dirty () const override
 Returns the dirty state of this property. More...
 
bool is_valid () const override
 Query this property's valid flag. More...
 
bool equal (property_base_t *rhs) const override
 Return true if rhs has the same type and value. More...
 
std::unique_ptr< property_base_t > clone (res_source_info new_src_info) override
 Create a copy of this property. More...
 
void set_from_str (const std::string &new_val_str) override
 
void set (const data_t &value)
 Set the value of this property. More...
 
void force_dirty () override
 
const data_t & get () const
 Get the value of this property. More...
 
 operator const data_t & () const
 
bool operator== (const data_t &rhs)
 
property_t< data_t > & operator= (const data_t &value)
 
- Public Member Functions inherited from uhd::rfnoc::property_base_t
 property_base_t (const std::string &id, const res_source_info &source_info)
 
virtual ~property_base_t ()
 
const std::string & get_id () const
 Gets the ID (name) of this property. More...
 
const res_source_info & get_src_info () const
 Return the source info for this property. More...
 
bool read_access_granted () const
 Returns true if this property can be read. More...
 
bool write_access_granted () const
 Returns true if this property can be written to. More...
 
access_t get_access_mode () const
 Return the current access mode. More...
 

Member Typedef Documentation

◆ value_type

template<typename data_t >
using uhd::rfnoc::property_t< data_t >::value_type = data_t

We want to be good C++ citizens.

Constructor & Destructor Documentation

◆ property_t() [1/4]

template<typename data_t >
uhd::rfnoc::property_t< data_t >::property_t ( const std::string &  id,
data_t &&  value,
const res_source_info &  source_info 
)

◆ property_t() [2/4]

template<typename data_t >
uhd::rfnoc::property_t< data_t >::property_t ( const std::string &  id,
const data_t &  value,
const res_source_info &  source_info 
)

◆ property_t() [3/4]

template<typename data_t >
uhd::rfnoc::property_t< data_t >::property_t ( const std::string &  id,
const res_source_info &  source_info 
)

◆ property_t() [4/4]

template<typename data_t >
uhd::rfnoc::property_t< data_t >::property_t ( const property_t< data_t > &  prop)
default

Member Function Documentation

◆ clone()

template<typename data_t >
std::unique_ptr<property_base_t> uhd::rfnoc::property_t< data_t >::clone ( res_source_info  )
inlineoverridevirtual

Create a copy of this property.

The copy must have the same type, value, and ID. However, it is often desirable to have a new source information, so that can be overridden.

The cleanliness state of original is not preserved. The new property will have the same cleanliness state as any other new property.

Reimplemented from uhd::rfnoc::property_base_t.

◆ equal()

template<typename data_t >
bool uhd::rfnoc::property_t< data_t >::equal ( property_base_t *  rhs) const
inlineoverridevirtual

Return true if rhs has the same type and value.

Implements uhd::rfnoc::property_base_t.

◆ force_dirty()

template<typename data_t >
void uhd::rfnoc::property_t< data_t >::force_dirty ( )
inlineoverridevirtual

◆ get()

template<typename data_t >
const data_t& uhd::rfnoc::property_t< data_t >::get ( void  ) const
inline

Get the value of this property.

Exceptions
uhd::access_errorif either the property is flagged as invalid, or if no read access was granted.

◆ is_dirty()

template<typename data_t >
bool uhd::rfnoc::property_t< data_t >::is_dirty ( ) const
inlineoverridevirtual

Returns the dirty state of this property.

If true, this means the value was recently changed, but it wasn't marked clean yet.

Implements uhd::rfnoc::property_base_t.

◆ is_valid()

template<typename data_t >
bool uhd::rfnoc::property_t< data_t >::is_valid ( ) const
inlineoverridevirtual

Query this property's valid flag.

If it's false, that means this property has a default value that should NOT be used.

Implements uhd::rfnoc::property_base_t.

◆ operator const data_t &()

template<typename data_t >
uhd::rfnoc::property_t< data_t >::operator const data_t & ( ) const
inline

◆ operator=()

template<typename data_t >
property_t<data_t>& uhd::rfnoc::property_t< data_t >::operator= ( const data_t &  value)
inline

◆ operator==()

template<typename data_t >
bool uhd::rfnoc::property_t< data_t >::operator== ( const data_t &  rhs)
inline

◆ set()

template<typename data_t >
void uhd::rfnoc::property_t< data_t >::set ( const data_t &  value)
inline

Set the value of this property.

Exceptions
uhd::access_errorif the current access mode is not RW or RWLOCKED
uhd::resolve_errorif the property is RWLOCKED but the new value doesn't match

◆ set_from_str()

template<typename data_t >
void uhd::rfnoc::property_t< data_t >::set_from_str ( const std::string &  new_val_str)
inlineoverridevirtual

Set this property's value using a string

This requires the underlying property type to be convertible from a string.

Exceptions
uhd::runtime_errorif the underlying type has no conversion from a string

Implements uhd::rfnoc::property_base_t.


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