Description
Keys and rules provide a mechanism for selectively accessing particular store buffers. When opening an arbitrated or transient store for 'write' access, or constructing a record within an 'opened' buffer, a writer can specify a 32 bit signed integer 'key' that will be associated with the buffer when closed. Readers can then specify conditions (called rules) that allow them to selectively read particular buffers. Readers can discriminate between buffers using the following rules;
CLP_NO_RULE
This rule is used for the non-discriminated case. The reader will have access to all buffers regardless of their key.
CLP_EQ_RULE
If this rule is specified, the reader will only have access to buffers whose keys match the readers specified key.
CLP_GT_RULE
If this rule is specified, the reader will only have access to a given buffer if its key is greater than the buffer's key.
CLP_GE_RULE
If this rule is specified, the reader will only have access to a given buffer if its key is greater than or equal to the buffer's key.
CLP_LT_RULE
If this rule is specified, the reader will only have access to a given buffer if its key is less than the buffer's key.
CLP_LE_RULE
If this rule is specified, the reader will only have access to a given buffer if its key is less than or equal the buffer's key.
CLP_NE_RULE
If this rule is specified, the reader will only have access to a given buffer if its key is not equal to the buffer's key.
CLP_AND_RULE
If this rule is specified, the reader will only have access to a given buffer if the bitwise AND of its key with the buffer's key is non-zero.
Manual Connections
If the writer is using a manual connection then the key can be set by the 'OpenWrite' call (see Arbitrated Store OpenWrite and Transient Store OpenWrite).
Automatic/Trigger Connections
If the writer is using an automatic or trigger connection then they will not execute an explicit 'OpenWrite' call and so the key cannot be dynamically set using that mechanism. If the key is constant then it can be set as a static connection attribute, but if the key is dynamic, then it needs to be set by the record's 'construct' call (see Store Records).
Notes
Keys and rules can only be specified by connections that are made directly with arbitrated and/or transient stores.
Example
See Keys and Rules