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.public:
virtual void disable();
A subclass implementation is expected to respect the enabled state when checkForWork is called.
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.
Result: value of action.public:
virtual IOEventSource::Action getAction() const;
Result: value of eventChainNext.protected:
virtual IOEventSource *getNext() const;
Result: value of workLoop.public:
virtual IOWorkLoop *getWorkLoop() const;
protected:
virtual bool init(OSObject *owner, IOEventSource::Action action = 0);
Result: true if the inherited classes and this instance initialise successfully.
Name Description owner Owner 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. action Pointer 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 enabled.public:
virtual bool isEnabled() const;
Result: true if called on the work-loop thread.public:
virtual bool onThread() const;
public:
virtual void setAction(IOEventSource::Action action);
Name Description action Pointer to a C function of type IOEventSource::Action.
protected:
virtual void setNext(IOEventSource *next);
Name Description next Pointer to another IOEventSource instance.
protected:
virtual void setWorkLoop(IOWorkLoop *workLoop);
Name Description workLoop Target 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)