Lock – step 0031 – February 2010

1 Purpose of SrrLock

SrrLock is one of the main prototypes to implement the “keys concept” (the other one is SrrKeyContainer).

SrrLock provides all the functionality of a SrrKeyContainer plus the ability to be unlocked by “carried keys” and “contained keys”. Therefore a list of “fitting keys” has to be specified by means of their global key id (see description of SrrKeyContainer).

The contents of the key container (containedKeys) are kept synchronized among all scene instances via an internal network sensor with streamName/networkSensorId=”Srr-<moduleName>-<objId>”.

2 User Interface of SrrLock (uiObj)

SrrLock is an external prototype that is available at the directory srr/.

<ProtoDeclare name='SrrLock'>

<ProtoInterface>

<field accessType='inputOutput' name='objType' type='SFString' value='SrrLock'/>

<field accessType='inputOutput' name='version' type='SFFloat' value='0.0022'/>

<field accessType='inputOutput' name='quasiModule' type='SFString'/>

<field accessType='inputOutput' name='objId' type='SFString'/>

<field accessType='inputOutput' name='initialKeys' type='MFString'/>

<field accessType='inputOutput' name='modParam' type='SFNode'/>

<field accessType='inputOutput' name='enabled' type='SFBool' value="true"/>

<field accessType='outputOnly' name='initialized' type='SFNode'/>

<field accessType='inputOutput' name='fittingKeys' type='MFString'/>

<field accessType='inputOutput' name='keyMustBeContained' type='SFBool' value='false'/>

<field accessType='inputOnly' name='set_bind' type='SFBool'/>

<field accessType='outputOnly' name='containedKeys' type='MFString'/>

<field accessType='inputOnly' name='takeKeys' type='MFString'/>

<field accessType='outputOnly' name='locked' type='SFBool' value='true'/>

</ProtoInterface>

objType, version, objId, quasiModule, enabled, initialKeys, modParam, initialized, set_bind, containedKeys, and takeKeys provide the same services as SrrKeyContainer provides.

A lock can be unlocked either by “carried keys” or by “contained keys”.

If keyMustBeContained is 'true', then the key must be contained to unlock the lock. Only carrying will not unlock the lock in this case.

The field fittingKeys has to be set to define a set of keys, that can unlock the lock (by being carried and/or by being contained).

The field locked  indicates the locked/unlocked state of the lock.