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

The SoDa Base class. More...

#include <SoDaBase.hxx>

Inheritance diagram for SoDa::SoDaBase:
SoDa::AudioIfc SoDa::HilbertTransformer SoDa::ReSample48to625 SoDa::ReSample625to48 SoDa::SoDaThread SoDa::AudioALSA SoDa::AudioPA SoDa::BaseBandRX SoDa::BaseBandTX SoDa::CWTX SoDa::GPSmon SoDa::TestServer SoDa::UI SoDa::USRPCtrl SoDa::USRPRX SoDa::USRPTX SoDaTest::MultiMBox_Test_Thread SoDaTest::ThN

Public Member Functions

 SoDaBase (const std::string &oname)
 The constructor – pass a name for the object. More...
 
std::string & getObjName ()
 get the name of this object More...
 
SoDaBasefindSoDaObject (const std::string &oname)
 find a SoDa Object by name. More...
 
double getTime ()
 Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS). More...
 

Private Attributes

std::string objname
 the name of the object More...
 

Static Private Attributes

static bool first_time = true
 have we seen the first call to getTime? More...
 
static double base_first_time
 time of first call to getTime from anyone. More...
 
static std::map< std::string, SoDaBase *> ObjectDirectory
 a class member – directory of all registered objects. More...
 

Detailed Description

The SoDa Base class.

All persistent soda objects of any size are given a NAME so that the SoDaException class can show who is complaining for a given exception.

Definition at line 167 of file SoDaBase.hxx.

Constructor & Destructor Documentation

◆ SoDaBase()

SoDa::SoDaBase::SoDaBase ( const std::string &  oname)

The constructor – pass a name for the object.

Parameters
onameThe name of the object. Uniqueness is helpful, but not necessary. The first object with a given name will be entered into the directory Objects can be retrieved from the directory by name with the findSoDaObject function.

Definition at line 37 of file SoDaBase.cxx.

References ObjectDirectory, and objname.

Member Function Documentation

◆ findSoDaObject()

SoDaBase * SoDa::SoDaBase::findSoDaObject ( const std::string &  oname)

find a SoDa Object by name.

Parameters
onamea string that names the object
Returns
a pointer to the SoDaBase object (NULL if the name isn't found)

Definition at line 45 of file SoDaBase.cxx.

References ObjectDirectory.

◆ getObjName()

std::string& SoDa::SoDaBase::getObjName ( )
inline

get the name of this object

Returns
the name of this object.

Definition at line 182 of file SoDaBase.hxx.

Referenced by SoDa::BaseBandRX::execGetCommand(), SoDa::USRPCtrl::USRPCtrl(), SoDa::AudioPA::wakeIn(), and SoDa::AudioALSA::wakeIn().

◆ getTime()

double SoDa::SoDaBase::getTime ( )

Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS).

Returns
a monotonically increasing timestamp in nS since an arbitrary time in the past.

Definition at line 56 of file SoDaBase.cxx.

References base_first_time, and first_time.

Member Data Documentation

◆ base_first_time

double SoDa::SoDaBase::base_first_time
staticprivate

time of first call to getTime from anyone.

Definition at line 204 of file SoDaBase.hxx.

Referenced by getTime().

◆ first_time

bool SoDa::SoDaBase::first_time = true
staticprivate

have we seen the first call to getTime?

Definition at line 203 of file SoDaBase.hxx.

Referenced by getTime().

◆ ObjectDirectory

std::map< std::string, SoDaBase * > SoDa::SoDaBase::ObjectDirectory
staticprivate

a class member – directory of all registered objects.

Definition at line 206 of file SoDaBase.hxx.

Referenced by findSoDaObject(), and SoDaBase().

◆ objname

std::string SoDa::SoDaBase::objname
private

the name of the object

Definition at line 201 of file SoDaBase.hxx.

Referenced by SoDaBase().


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