Changing Actions Midstream
Because the Objection appoint()
and
ignore()
operations return the previous value of
the action associated with that Objection,
a user can change an action for a particular
section of a program, saving the previous value,
and then restore the old value at
a later point.
For instance, suppose a client programmer wants to invoke the default
action for the Stack::overflow
Objection just for
the duration of some subroutine.
The subroutine can then be written as follows:
int subroutine()
{
Objection_action* save_action;
save_action = Stack::overflow.appoint();
// body of the function
Stack::overflow.appoint(save_action);
}
Next topic:
Setjmp and Longjmp with Objections
Previous topic:
Superseding an Objection
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004