signon  8.58
SignonDaemonNS::SignonDisposable Class Reference

Base class for server objects that can be automatically destroyed after a certain period of inactivity. More...

#include <signondisposable.h>

Inheritance diagram for SignonDaemonNS::SignonDisposable:
Collaboration diagram for SignonDaemonNS::SignonDisposable:

Public Slots

static void destroyUnused ()
 Deletes all disposable object for which the inactivity time has elapsed. More...
 

Public Member Functions

 SignonDisposable (int maxInactivity, QObject *parent)
 Construct an object that can be automatically destroyed after having being unused for seconds. More...
 
virtual void destroy ()
 Performs any predestruction operations and the destruction itself. More...
 
void keepInUse () const
 Mark the object as used. More...
 
void setAutoDestruct (bool value=true) const
 Mark the object as used. More...
 

Static Public Member Functions

static void invokeOnIdle (int maxInactivity, QObject *object, const char *member)
 Invoke the specified method on when there are no disposable objects for more than seconds. More...
 

Protected Member Functions

virtual ~SignonDisposable ()
 

Detailed Description

Base class for server objects that can be automatically destroyed after a certain period of inactivity.

Definition at line 39 of file signondisposable.h.

Constructor & Destructor Documentation

SignonDaemonNS::SignonDisposable::~SignonDisposable ( )
protectedvirtual

Definition at line 52 of file signondisposable.cpp.

SignonDaemonNS::SignonDisposable::SignonDisposable ( int  maxInactivity,
QObject *  parent 
)

Construct an object that can be automatically destroyed after having being unused for seconds.

Parameters
maxInactivitythe number of seconds of inactivity.
parentthe parent object.

Definition at line 33 of file signondisposable.cpp.

References destroyUnused(), and keepInUse().

Member Function Documentation

virtual void SignonDaemonNS::SignonDisposable::destroy ( )
inlinevirtual

Performs any predestruction operations and the destruction itself.

Reimplement this for smoother control.

Reimplemented in SignonDaemonNS::SignonSessionCore, and SignonDaemonNS::SignonIdentity.

Definition at line 60 of file signondisposable.h.

References destroyUnused(), invokeOnIdle(), keepInUse(), and setAutoDestruct().

Referenced by destroyUnused().

void SignonDaemonNS::SignonDisposable::destroyUnused ( )
staticslot
void SignonDaemonNS::SignonDisposable::invokeOnIdle ( int  maxInactivity,
QObject *  object,
const char *  member 
)
static

Invoke the specified method on when there are no disposable objects for more than seconds.

To keep the implementation simpler, this function can be called only once, and the variable must still be accessible when the method will be invoked (use a static string).

Definition at line 81 of file signondisposable.cpp.

References destroyUnused().

Referenced by destroy(), and SignonDaemonNS::SignonDaemon::init().

void SignonDaemonNS::SignonDisposable::setAutoDestruct ( bool  value = true) const

Mark the object as used.

Calling this method enables/disables autodestruction.

Parameters
valueenable/disable autodestruction

Definition at line 75 of file signondisposable.cpp.

References keepInUse().

Referenced by SignonDaemonNS::SignonSessionCore::customEvent(), and destroy().


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