protected:
virtual bool checkForWork();
Result: Returns a pointer to the new command gate if sucessful, 0 otherwise.public:
static IOCommandGate *commandGate(OSObject *owner, Action action = 0);
public:
virtual bool init(OSObject *owner, Action action = 0);
Initialiser for IOCommandGate operates only on newly 'newed' objects. Shouldn't be used to re-init an existing instance.
Result: True if inherited classes initialise successfully.
Name Description owner Owner of this, newly created, instance of the IOCommandGate. This argument will be used as the first parameter in the action callout. action Pointer to a C function that is called whenever a client of the IOCommandGate calls runCommand. NB Can be a C++ member function but caller must cast the member function to $link IOCommandGate::Action and they will get a compiler warning. Defaults to zero, see $link IOEventSource::setAction.
public:
virtual IOReturn runAction(Action action, void *arg0 = 0, void *arg1 = 0, void *arg2 = 0, void *arg3 = 0);
Client function that causes the given action to be called in a single threaded manner. Beware the work-loop's gate is recursive and command gates can cause direct or indirect re-entrancy. When the executing on a client's thread runCommand will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources.
Result: kIOReturnSuccess if successful. kIOReturnBadArgument if action is not defined, kIOReturnNoResources if no action available.
Name Description action Pointer to function to be executed in work-loop context. arg0 Parameter for action of command gate, defaults to 0. arg1 Parameter for action of command gate, defaults to 0. arg2 Parameter for action of command gate, defaults to 0. arg3 Parameter for action of command gate, defaults to 0.
public:
virtual IOReturn runCommand(void *arg0 = 0, void *arg1 = 0, void *arg2 = 0, void *arg3 = 0);
Client function that causes the current action to be called in a single threaded manner. Beware the work-loop's gate is recursive and command gates can cause direct or indirect re-entrancy. When the executing on a client's thread runCommand will sleep until the work-loop's gate opens for execution of client actions, the action is single threaded against all other work-loop event sources.
Result: kIOReturnSuccess if successful. kIOReturnNotPermitted if this event source is currently disabled, kIOReturnNoResources if no action available.
Name Description arg0 Parameter for action of command gate, defaults to 0. arg1 Parameter for action of command gate, defaults to 0. arg2 Parameter for action of command gate, defaults to 0. arg3 Parameter for action of command gate, defaults to 0.
public:typedef IOReturn (*Action)(OSObject *owner, void *arg0, void *arg1, void *arg2, void *arg3);
Type and arguments of callout C function that is used when a runCommand is executed by a client. Cast to this type when you want a C++ member function to be used. Note the arg1 - arg3 parameters are straight pass through from the runCommand to the action callout.
Name Description owner Target of the function, can be used as a refcon. The owner is set during initialisation of the IOCommandGate instance. Note if a C++ function was specified this parameter is implicitly the first paramter in the target member function's parameter list. arg0 Argument to action from run operation. arg1 Argument to action from run operation. arg2 Argument to action from run operation. arg3 Argument to action from run operation.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)