Functions



checkForWork

Abstract: Pure Virtual member function used by IOWorkLoop for work scheduling.
protected:

virtual bool checkForWork() = 0;

This function will be called to request a subclass to check it's internal state for any work to do and then to call out the owner/action.

Result: Return true if this function needs to be called again before all its outstanding events have been processed.

disable

Abstract: Disable event source.
public:

virtual void disable();

A subclass implementation is expected to respect the enabled state when checkForWork is called.


enable

Abstract: Enable event source.
public:

virtual void enable();

A subclass implementation is expected to respect the enabled state when checkForWork is called. Calling this function will cause the work-loop to be signalled so that a checkForWork is performed.


getAction

Abstract: Get'ter for $link action variable.
public:

virtual IOEventSource::Action getAction() const;

Result: value of action.

getNext

Abstract: Get'ter for $link eventChainNext variable.
protected:

virtual IOEventSource *getNext() const;

Result: value of eventChainNext.

getWorkLoop

Abstract: Get'ter for $link workLoop variable.
public:

virtual IOWorkLoop *getWorkLoop() const;

Result: value of workLoop.

init

Abstract: Primary initialiser for the IOEventSource class.
protected:

virtual bool init(OSObject *owner, IOEventSource::Action action = 0);

Parameters

NameDescription
ownerOwner of this instance of an event source. Used as the first parameter of the action callout. Owner will generally be an OSObject it doesn't have to be as no member functions will be called directly in it. It can just be a refcon for a client routine.
actionPointer to C call out function. Action is a pointer to a C function that gets called when this event source has outstanding work. It will usually be called by the checkForWork member function. The first parameter of the action call out will always be the owner, this allows C++ member functions to be used as actions. Defaults to 0.
Result: true if the inherited classes and this instance initialise successfully.

isEnabled

Abstract: Get'ter for $link enable variable.
public:

virtual bool isEnabled() const;

Result: true if enabled.

onThread

Abstract: Convenience function for workLoop->onThread.
public:

virtual bool onThread() const;

Result: true if called on the work-loop thread.

setAction

Abstract: Set'ter for $link action variable.
public:

virtual void setAction(IOEventSource::Action action);

Parameters

NameDescription
actionPointer to a C function of type IOEventSource::Action.

setNext

Abstract: Set'ter for $link eventChainNext variable.
protected:

virtual void setNext(IOEventSource *next);

Parameters

NameDescription
nextPointer to another IOEventSource instance.

setWorkLoop

Abstract: Set'ter for $link workLoop variable.
protected:

virtual void setWorkLoop(IOWorkLoop *workLoop);

Parameters

NameDescription
workLoopTarget work-loop of this event source instance. A subclass of IOWorkLoop that at least reacts to signalWorkAvailable() and onThread functions.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)