SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
SoDa::USRPPropTree Class Reference

USRPPropTree class encapsulates the USRP property tree functions to allow better trap and error recovery management. More...

#include <USRPPropTree.hxx>

Public Member Functions

 USRPPropTree (const uhd::usrp::multi_usrp::sptr usrp, const std::string &requester, int mb_index=0)
 Constructor – build a property tree widget rooted at the first motherboard in this multi-usrp.
 USRPPropTree (USRPPropTree *ptree, const std::string &path)
 Constructor – build a property tree widget that is a subtree of the mboard property tree.
 USRPPropTree (USRPPropTree &ptree, const std::string &path)
 Constructor – build a property tree widget that is a subtree of the mboard property tree.
bool hasProperty (const std::string &propname)
 does the property tree have this property name as a child?
std::vector< std::string > getPropNames (const std::string &path=std::string(""))
std::string getStringProp (const std::string &propname, const std::string defval=std::string("None"))
int getIntProp (const std::string &propname, const int defval=0)
int getDoubleProp (const std::string &propname, const double defval=0.0)
bool getBoolProp (const std::string &propname, const bool defval=false)
void setStringProp (const std::string &propname, const std::string val=std::string("None"))
void setIntProp (const std::string &propname, const int val=0)
void setDoubleProp (const std::string &propname, const double val=0.0)
void setBoolProp (const std::string &propname, const bool val=false)
template<typename T>
getProperty (const std::string &propname, const T defval)
template<typename T>
getProperty (const std::string &propname)
template<typename T>
void setProperty (const std::string &propname, const T val)

Private Member Functions

void init (USRPPropTree *ptree, const std::string &path)
void complain (const std::string &explain_string, std::runtime_error &e, bool continue_p=true)
void complain (const std::string &explain_string, const std::string &path, std::runtime_error &e, bool continue_p=true)

Private Attributes

std::string client_name
 the name of the runtime object/thread that created this tree.
std::string fqpn
uhd::property_tree::sptr tree
std::string mb0_name

Detailed Description

USRPPropTree class encapsulates the USRP property tree functions to allow better trap and error recovery management.

Definition at line 44 of file USRPPropTree.hxx.

Constructor & Destructor Documentation

◆ USRPPropTree() [1/3]

SoDa::USRPPropTree::USRPPropTree ( const uhd::usrp::multi_usrp::sptr usrp,
const std::string & requester,
int mb_index = 0 )
inline

Constructor – build a property tree widget rooted at the first motherboard in this multi-usrp.

Parameters
usrpto which USRP unit is this connected?
requestername of object that is creating this tree
mb_indexwhich motherboard are we interested in?

Definition at line 55 of file USRPPropTree.hxx.

References client_name, complain(), fqpn, mb0_name, and tree.

Referenced by USRPPropTree(), USRPPropTree(), and init().

◆ USRPPropTree() [2/3]

SoDa::USRPPropTree::USRPPropTree ( USRPPropTree * ptree,
const std::string & path )
inline

Constructor – build a property tree widget that is a subtree of the mboard property tree.

Parameters
ptreepointer to ancestor property tree
pathpath to this property tree.

Definition at line 86 of file USRPPropTree.hxx.

References USRPPropTree(), and init().

◆ USRPPropTree() [3/3]

SoDa::USRPPropTree::USRPPropTree ( USRPPropTree & ptree,
const std::string & path )
inline

Constructor – build a property tree widget that is a subtree of the mboard property tree.

Parameters
ptreeancestor property tree
pathpath to this property tree.

Definition at line 98 of file USRPPropTree.hxx.

References USRPPropTree(), and init().

Member Function Documentation

◆ complain() [1/2]

void SoDa::USRPPropTree::complain ( const std::string & explain_string,
const std::string & path,
std::runtime_error & e,
bool continue_p = true )
inlineprivate

Definition at line 243 of file USRPPropTree.hxx.

References client_name.

◆ complain() [2/2]

void SoDa::USRPPropTree::complain ( const std::string & explain_string,
std::runtime_error & e,
bool continue_p = true )
inlineprivate

Definition at line 230 of file USRPPropTree.hxx.

References client_name.

Referenced by USRPPropTree(), getProperty(), getProperty(), hasProperty(), init(), and setProperty().

◆ getBoolProp()

bool SoDa::USRPPropTree::getBoolProp ( const std::string & propname,
const bool defval = false )
inline

Definition at line 143 of file USRPPropTree.hxx.

References getProperty().

◆ getDoubleProp()

int SoDa::USRPPropTree::getDoubleProp ( const std::string & propname,
const double defval = 0.0 )
inline

Definition at line 138 of file USRPPropTree.hxx.

References getProperty().

◆ getIntProp()

int SoDa::USRPPropTree::getIntProp ( const std::string & propname,
const int defval = 0 )
inline

Definition at line 133 of file USRPPropTree.hxx.

References getProperty().

◆ getProperty() [1/2]

template<typename T>
T SoDa::USRPPropTree::getProperty ( const std::string & propname)
inline

Definition at line 185 of file USRPPropTree.hxx.

References complain(), fqpn, and tree.

◆ getProperty() [2/2]

template<typename T>
T SoDa::USRPPropTree::getProperty ( const std::string & propname,
const T defval )
inline

Definition at line 169 of file USRPPropTree.hxx.

References complain(), fqpn, and tree.

Referenced by getBoolProp(), getDoubleProp(), getIntProp(), and getStringProp().

◆ getPropNames()

std::vector< std::string > SoDa::USRPPropTree::getPropNames ( const std::string & path = std::string(""))
inline

Definition at line 123 of file USRPPropTree.hxx.

References tree.

◆ getStringProp()

std::string SoDa::USRPPropTree::getStringProp ( const std::string & propname,
const std::string defval = std::string("None") )
inline

Definition at line 128 of file USRPPropTree.hxx.

References getProperty().

◆ hasProperty()

bool SoDa::USRPPropTree::hasProperty ( const std::string & propname)
inline

does the property tree have this property name as a child?

Parameters
propnamethe name of a property
Returns
true if the property is found.

Definition at line 108 of file USRPPropTree.hxx.

References complain(), fqpn, and tree.

◆ init()

void SoDa::USRPPropTree::init ( USRPPropTree * ptree,
const std::string & path )
inlineprivate

Definition at line 215 of file USRPPropTree.hxx.

References USRPPropTree(), client_name, complain(), fqpn, and tree.

Referenced by USRPPropTree(), and USRPPropTree().

◆ setBoolProp()

void SoDa::USRPPropTree::setBoolProp ( const std::string & propname,
const bool val = false )
inline

Definition at line 163 of file USRPPropTree.hxx.

References setProperty().

◆ setDoubleProp()

void SoDa::USRPPropTree::setDoubleProp ( const std::string & propname,
const double val = 0.0 )
inline

Definition at line 158 of file USRPPropTree.hxx.

References setProperty().

◆ setIntProp()

void SoDa::USRPPropTree::setIntProp ( const std::string & propname,
const int val = 0 )
inline

Definition at line 153 of file USRPPropTree.hxx.

References setProperty().

◆ setProperty()

template<typename T>
void SoDa::USRPPropTree::setProperty ( const std::string & propname,
const T val )
inline

Definition at line 201 of file USRPPropTree.hxx.

References complain(), fqpn, and tree.

Referenced by setBoolProp(), setDoubleProp(), setIntProp(), and setStringProp().

◆ setStringProp()

void SoDa::USRPPropTree::setStringProp ( const std::string & propname,
const std::string val = std::string("None") )
inline

Definition at line 148 of file USRPPropTree.hxx.

References setProperty().

Member Data Documentation

◆ client_name

std::string SoDa::USRPPropTree::client_name
private

the name of the runtime object/thread that created this tree.

Definition at line 259 of file USRPPropTree.hxx.

Referenced by USRPPropTree(), complain(), complain(), and init().

◆ fqpn

std::string SoDa::USRPPropTree::fqpn
private

Definition at line 260 of file USRPPropTree.hxx.

Referenced by USRPPropTree(), getProperty(), getProperty(), hasProperty(), init(), and setProperty().

◆ mb0_name

std::string SoDa::USRPPropTree::mb0_name
private

Definition at line 262 of file USRPPropTree.hxx.

Referenced by USRPPropTree().

◆ tree

uhd::property_tree::sptr SoDa::USRPPropTree::tree
private

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