SoDaRadio-5.0.3-master:8901fb5
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SoDa::PropTree Class Reference

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

#include <PropTree.hxx>

Public Member Functions

 PropTree (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. More...
 
 PropTree (PropTree *ptree, const std::string &path)
 Constructor – build a property tree widget that is a subtree of the mboard property tree. More...
 
 PropTree (PropTree &ptree, const std::string &path)
 Constructor – build a property tree widget that is a subtree of the mboard property tree. More...
 
bool hasProperty (const std::string &propname)
 does the property tree have this property name as a child? More...
 
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 (PropTree *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. More...
 
std::string fqpn
 
uhd::property_tree::sptr tree
 
std::string mb0_name
 

Detailed Description

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

Definition at line 44 of file PropTree.hxx.

Constructor & Destructor Documentation

◆ PropTree() [1/3]

SoDa::PropTree::PropTree ( 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 54 of file PropTree.hxx.

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

◆ PropTree() [2/3]

SoDa::PropTree::PropTree ( PropTree 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 80 of file PropTree.hxx.

References init().

◆ PropTree() [3/3]

SoDa::PropTree::PropTree ( PropTree 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 91 of file PropTree.hxx.

References init().

Member Function Documentation

◆ complain() [1/2]

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

Definition at line 208 of file PropTree.hxx.

References client_name.

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

◆ complain() [2/2]

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

Definition at line 216 of file PropTree.hxx.

References client_name.

◆ getBoolProp()

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

◆ getDoubleProp()

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

Definition at line 127 of file PropTree.hxx.

◆ getIntProp()

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

Definition at line 122 of file PropTree.hxx.

◆ getProperty() [1/2]

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

Definition at line 157 of file PropTree.hxx.

References complain(), fqpn, and tree.

Referenced by SoDa::TRControl::makeTRControl().

◆ getProperty() [2/2]

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

Definition at line 170 of file PropTree.hxx.

References complain(), fqpn, and tree.

◆ getPropNames()

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

Definition at line 112 of file PropTree.hxx.

References tree.

Referenced by SoDa::getUSRPFrontEnd(), and main().

◆ getStringProp()

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

◆ hasProperty()

bool SoDa::PropTree::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 100 of file PropTree.hxx.

References complain(), fqpn, and tree.

Referenced by SoDa::USRPCtrl::USRPCtrl().

◆ init()

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

Definition at line 195 of file PropTree.hxx.

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

Referenced by PropTree().

◆ setBoolProp()

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

Definition at line 152 of file PropTree.hxx.

Referenced by SoDa::USRPCtrl::setTXFrontEndEnable(), and SoDa::USRPCtrl::USRPCtrl().

◆ setDoubleProp()

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

Definition at line 147 of file PropTree.hxx.

◆ setIntProp()

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

Definition at line 142 of file PropTree.hxx.

◆ setProperty()

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

Definition at line 183 of file PropTree.hxx.

References complain(), fqpn, and tree.

◆ setStringProp()

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

Definition at line 137 of file PropTree.hxx.

Referenced by SoDa::USRPCtrl::USRPCtrl().

Member Data Documentation

◆ client_name

std::string SoDa::PropTree::client_name
private

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

Definition at line 226 of file PropTree.hxx.

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

◆ fqpn

std::string SoDa::PropTree::fqpn
private

Definition at line 227 of file PropTree.hxx.

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

◆ mb0_name

std::string SoDa::PropTree::mb0_name
private

Definition at line 229 of file PropTree.hxx.

Referenced by PropTree().

◆ tree

uhd::property_tree::sptr SoDa::PropTree::tree
private

Definition at line 228 of file PropTree.hxx.

Referenced by getProperty(), getPropNames(), hasProperty(), init(), PropTree(), and setProperty().


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