Yate
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DurationUpdate Class Reference

An UI time updater. More...

#include <yatecbase.h>

Inheritance diagram for DurationUpdate:
RefObject GenObject

Public Member Functions

 DurationUpdate (ClientLogic *logic, bool owner, const char *id, const char *name, unsigned int start=Time::secNow())
 
virtual ~DurationUpdate ()
 
virtual const StringtoString () const
 
void setLogic (ClientLogic *logic=0, bool owner=true)
 
virtual unsigned int update (unsigned int secNow, const String *table=0, Window *wnd=0, Window *skip=0, bool force=false)
 
virtual unsigned int buildTimeParam (NamedList &dest, unsigned int secNow, bool force=false)
 
virtual unsigned int buildTimeString (String &dest, unsigned int secNow, bool force=false)
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static unsigned int buildTimeParam (NamedList &dest, const char *param, unsigned int secStart, unsigned int secNow, bool force=false)
 
static unsigned int buildTimeString (String &dest, unsigned int secStart, unsigned int secNow, bool force=false)
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- 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 ()
 

Protected Member Functions

virtual void destroyed ()
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 

Protected Attributes

String m_id
 
ClientLogicm_logic
 
String m_name
 
unsigned int m_startTime
 

Detailed Description

An UI time updater.

Class used to update UI durations. The string keeps the object's id. This object can be used to keep additional data associated with a client channel

Constructor & Destructor Documentation

DurationUpdate ( ClientLogic logic,
bool  owner,
const char *  id,
const char *  name,
unsigned int  start = Time::secNow() 
)
inline

Constructor. Add itself to logic's list

Parameters
logicThe client logic used to update this duration object
ownerTrue if the logic is owning this object
idObject id
nameObject name (widget or column name)
startStart time in seconds

References DurationUpdate::setLogic().

virtual ~DurationUpdate ( )
virtual

Destructor

Member Function Documentation

virtual unsigned int buildTimeParam ( NamedList dest,
unsigned int  secNow,
bool  force = false 
)
virtual

Build a duration string representation and add the parameter to a list

Parameters
destDestination list
secNowCurrent time in seconds
forceSet to true to add the parameter even if duration is 0
Returns
The duration
static unsigned int buildTimeParam ( NamedList dest,
const char *  param,
unsigned int  secStart,
unsigned int  secNow,
bool  force = false 
)
static

Build a duration string representation and add the parameter to a list

Parameters
destDestination list
paramParameter to add
secStartStarting time in seconds
secNowCurrent time in seconds
forceSet to true to add the parameter even if duration is 0
Returns
The duration
virtual unsigned int buildTimeString ( String dest,
unsigned int  secNow,
bool  force = false 
)
virtual

Build a duration string representation hh:mm:ss. The hours are added only if non 0

Parameters
destDestination string
secNowCurrent time in seconds
forceSet to true to build even if duration is 0
Returns
The duration
static unsigned int buildTimeString ( String dest,
unsigned int  secStart,
unsigned int  secNow,
bool  force = false 
)
static

Build a duration string representation hh:mm:ss. The hours are added only if non 0

Parameters
destDestination string
secStartStarting time in seconds
secNowCurrent time in seconds
forceSet to true to build even if duration is 0
Returns
The duration
virtual void destroyed ( )
protectedvirtual

Release memory. Remove from updater

Reimplemented from RefObject.

void setLogic ( ClientLogic logic = 0,
bool  owner = true 
)

Set the logic used to update this duration object. Remove from the old one

Parameters
logicThe client logic used to update this duration object
ownerTrue if the logic is owning this object

Referenced by DurationUpdate::DurationUpdate().

virtual const String& toString ( ) const
virtual

Get a string representation of this object

Returns
This duration's id

Reimplemented from GenObject.

virtual unsigned int update ( unsigned int  secNow,
const String table = 0,
Window wnd = 0,
Window skip = 0,
bool  force = false 
)
virtual

Update UI if duration is non 0

Parameters
secNowCurrent time in seconds
tableThe table to update. Set to 0 to update text widgets
wndOptional window to update
skipOptional window to skip if wnd is 0
forceSet to true to update even if duration is 0
Returns
The duration

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