class AppContext

AppContext provides a run() method to act as the main loop of an event driven program. More...

Definition#include <sysadm/AppContext.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods


Detailed Description

AppContext provides a run() method to act as the main loop of an event driven program. Methods are called for getting notification of file descriptor and timer-based events, which are used to set parameters to be passed to select(2) in run().

 AppContext ()

AppContext ()

[virtual]

typedef  void (*MonitorCallback)(void* clientData, int id, int fd)

Callback type for getting events about file descriptors.

enum EAccess {INPUT, OUTPUT }

int  registerMonitor (int fd, MonitorCallback callback, void * clientData, EAccess access = INPUT)

[virtual]

Register for events on a file descriptor. It is an error to add more than one monitor with the same access for one file descriptor. It's OK to monitor a single file descriptor for both INPUT and OUTPUT (by calling registerMonitor() twice).

void  unregisterMonitor (int id)

[virtual]

Unregister for events on a file descriptor.

typedef  void (*TimerCallback)(void* clientData, int id)

Timers are fired once, then removed. They can be reasserted if an interval is required.

int  registerTimer (unsigned long seconds, TimerCallback callback, void * client_data)

[virtual]

Register a timer.

void  unregisterTimer (int id)

[virtual]

Unregister a timer.

int  run ()

[virtual]

Main select loop. Runs until exit() is called. Returns exitCode passed to exit().

void  exit (int exitCode)

[virtual]

Terminate the main loop.

void  setProperty (String key, String value)

[virtual]

Set a property for this application.

String  getProperty (String key)

[virtual]

Get a property for this application.

int  getPropertyNum (String key)

[virtual]

Get the number of a property. This can be used to determine the order in which two properties were set.

AppContext&  getAppContext ()

[static]

Get access to an instance of AppContext.


Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36.