Yate
RTPGroup Class Reference

A group of RTP processors handled by the same thread. More...

#include <yatertp.h>

Inheritance diagram for RTPGroup:
GenObject Mutex Thread Lockable Runnable

Public Member Functions

 RTPGroup (int msec=0, Priority prio=Normal, const String &affinity=String::empty())
 
virtual ~RTPGroup ()
 
virtual void cleanup ()
 
virtual void run ()
 
void join (RTPProcessor *proc)
 
void part (RTPProcessor *proc)
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
virtual void * getObject (const String &name) const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 
- Public Member Functions inherited from Mutex
 Mutex (bool recursive=false, const char *name=0)
 
 Mutex (const Mutex &original)
 
 ~Mutex ()
 
Mutexoperator= (const Mutex &original)
 
virtual bool lock (long maxwait=-1)
 
virtual bool unlock ()
 
virtual bool locked () const
 
const char * owner () const
 
bool recursive () const
 
- Public Member Functions inherited from Lockable
virtual ~Lockable ()
 
virtual bool check (long maxwait=-1)
 
virtual bool unlockAll ()
 
- Public Member Functions inherited from Thread
bool startup ()
 
bool error () const
 
bool running () const
 
int getAffinity (DataBlock &outCpuMask)
 
int setAffinity (const String &cpus)
 
int setAffinity (const DataBlock &mask)
 
int locks () const
 
bool locked () const
 
const char * name () const
 
void cancel (bool hard=false)
 
bool isCurrent () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 
- Public Member Functions inherited from Runnable
virtual ~Runnable ()
 

Static Public Member Functions

static void setMinSleep (int msec)
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 
- Static Public Member Functions inherited from Mutex
static int count ()
 
static int locks ()
 
static bool efficientTimedLock ()
 
- Static Public Member Functions inherited from Lockable
static void wait (unsigned long maxwait)
 
static unsigned long wait ()
 
static void startUsingNow ()
 
static void enableSafety (bool safe=true)
 
static bool safety ()
 
- Static Public Member Functions inherited from Thread
static const char * currentName ()
 
static int getCurrentAffinity (DataBlock &outCpuMask)
 
static int getCurrentAffinity (String &outCpus, bool hex=false)
 
static int setCurrentAffinity (const String &cpus)
 
static int setCurrentAffinity (const DataBlock &mask)
 
static bool parseCPUMask (const String &cpus, DataBlock &mask)
 
static void printCPUMask (const DataBlock &mask, String &str, bool hexa=true)
 
static void yield (bool exitCheck=false)
 
static void idle (bool exitCheck=false)
 
static void sleep (unsigned int sec, bool exitCheck=false)
 
static void msleep (unsigned long msec, bool exitCheck=false)
 
static void usleep (unsigned long usec, bool exitCheck=false)
 
static unsigned long idleUsec ()
 
static unsigned long idleMsec ()
 
static void idleMsec (unsigned long msec)
 
static Threadcurrent ()
 
static int count ()
 
static bool check (bool exitNow=true)
 
static void exit ()
 
static NamedCountergetCurrentObjCounter (bool always=false)
 
static NamedCountersetCurrentObjCounter (NamedCounter *counter)
 
static Priority priority (const char *name, Priority defvalue=Normal)
 
static const char * priority (Priority prio)
 
static void killall ()
 
static void preExec ()
 
static int lastError ()
 
static bool errorString (String &buffer)
 
static bool errorString (String &buffer, int code)
 

Friends

class RTPProcessor
 

Additional Inherited Members

- Public Types inherited from Thread
enum  Priority {
  Lowest , Low , Normal , High ,
  Highest
}
 
- Protected Member Functions inherited from Thread
 Thread (const char *name=0, Priority prio=Normal)
 
 Thread (const char *name, const char *prio)
 
virtual ~Thread ()
 

Detailed Description

A group of RTP processors handled by the same thread.

Several possibly related RTP processors share the same RTP group which holds the thread that keeps them running.

Constructor & Destructor Documentation

◆ RTPGroup()

RTPGroup ( int msec = 0,
Priority prio = Normal,
const String & affinity = String::empty() )

Constructor

Parameters
msecMinimum time to sleep in loop in milliseconds
prioThread priority to run this group
affinityComma-separated list of CPUs and/or CPU range on which the thread should run on

References String::empty().

◆ ~RTPGroup()

virtual ~RTPGroup ( )
virtual

Group destructor, removes itself from all remaining processors

Member Function Documentation

◆ cleanup()

virtual void cleanup ( )
virtual

Inherited thread cleanup

Reimplemented from Thread.

◆ join()

void join ( RTPProcessor * proc)

Add a RTP processor to this group

Parameters
procPointer to the RTP processor to add

◆ part()

void part ( RTPProcessor * proc)

Remove a RTP processor from this group

Parameters
procPointer to the RTP processor to remove

◆ run()

virtual void run ( )
virtual

Inherited thread run method

Implements Runnable.

◆ setMinSleep()

static void setMinSleep ( int msec)
static

Set the system global minimum time to sleep in loop

Parameters
msecMinimum time to sleep in loop in milliseconds

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