Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Implements a switch statement. More...
#include <ilviews/protos/condacc.h>
Public Member Functions | |
IlvSwitchAccessor (const char *name, const IlvValueTypeClass *type, IlvDisplay *display, const char *test, IlUInt numValues, const char **values) | |
Creates a new switch accessor. | |
Protected Member Functions | |
virtual IlBoolean | changeValue (IlvAccessorHolder *object, const IlvValue &val) |
Called by the method IlvAccessible::changeValue for each IlvAccessor attached to the IlvAccessorHolder . |
Implements a switch statement.
Library: ilvproto
Depending on the value of the first parameter, one of the attributes is triggered. When a changeValue()
call to this behavior is made, the first parameter is evaluated and cast into an integer value,
If the i
th + 1 parameter represents the name of an attribute of the prototype, then, it is assigned the value of the attribute. If there are less than i+1
parameters, then the last parameter is assigned the value of the second parameter. Hence, the last parameter serves as a "default" statement.
As an example, see the Traffic light prototype in the Samples library.
IlvSwitchAccessor::IlvSwitchAccessor | ( | const char * | name, | |
const IlvValueTypeClass * | type, | |||
IlvDisplay * | display, | |||
const char * | test, | |||
IlUInt | numValues, | |||
const char ** | values | |||
) |
Creates a new switch accessor.
name | Name of the attribute. | |
type | Type of the attribute. Used only for initialization purposes. | |
display | A display used to initialize attributes that might be display-dependent. | |
test | Expression that should return an integer. | |
numValues | Number of possible cases. There should be at least one case. | |
values | Array of numValues attribute names. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.