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

The SoDa Base class. More...

#include <SoDaBase.hxx>

Inheritance diagram for SoDa::Base:
SoDa::HilbertTransformer SoDa::Spectrogram SoDa::Thread CommandMonitor IFServer SimpleAccessory SoDa::AudioQt SoDa::BaseBandRX SoDa::BaseBandTX SoDa::CWTX SoDa::IFRecorder SoDa::RadioControl SoDa::RadioRX SoDa::RadioTX SoDa::UI

Public Member Functions

 Base (const std::string &oname)
 The constructor – pass a name for the object.
void registerSelf (BasePtr ptr)
std::string & getObjName ()
 get the name of this object
BasePtr findSoDaObject (const std::string &oname)
 find a SoDa Object by name.
double getTime ()
 Get a time stamp in nS resolution that monotonically increases and that is very inexpensive (typically < 100nS).
BasePtr getSelfPtr ()
 get a pointer to myself.

Private Attributes

std::string objname
 the name of the object
std::weak_ptr< Baseself

Static Private Attributes

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

Detailed Description

The SoDa Base class.

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

Definition at line 105 of file SoDaBase.hxx.

Constructor & Destructor Documentation

◆ Base()

SoDa::Base::Base ( 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.

Member Function Documentation

◆ findSoDaObject()

BasePtr SoDa::Base::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)

◆ getObjName()

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

get the name of this object

Returns
the name of this object.

Definition at line 122 of file SoDaBase.hxx.

References objname.

Referenced by SoDa::Thread::run().

◆ getSelfPtr()

BasePtr SoDa::Base::getSelfPtr ( )
inline

get a pointer to myself.

Definition at line 144 of file SoDaBase.hxx.

References self.

◆ getTime()

double SoDa::Base::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.

◆ registerSelf()

void SoDa::Base::registerSelf ( BasePtr ptr)

Member Data Documentation

◆ base_first_time

double SoDa::Base::base_first_time
staticprivate

time of first call to getTime from anyone.

Definition at line 151 of file SoDaBase.hxx.

◆ first_time

bool SoDa::Base::first_time
staticprivate

have we seen the first call to getTime?

Definition at line 150 of file SoDaBase.hxx.

◆ object_directory

std::map<std::string, BasePtr > SoDa::Base::object_directory
staticprivate

a class member – directory of all registered objects.

Definition at line 153 of file SoDaBase.hxx.

◆ objname

std::string SoDa::Base::objname
private

the name of the object

Definition at line 147 of file SoDaBase.hxx.

Referenced by getObjName().

◆ self

std::weak_ptr<Base> SoDa::Base::self
private

Definition at line 148 of file SoDaBase.hxx.

Referenced by getSelfPtr().


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