Share via


IKnowledgeBuilder2::AddRange

Adds a range and its associated clock vector to the set of ranges that is used to build the knowledge.

Syntax

HRESULT AddRange(
  BYTE* pItemId,
  BYTE* pChangeUnitId,
  IClockVector* piClockVector);

Parameters

Term

Definition

pItemId

[in] The closed lower bound of item IDs in this range.

pChangeUnitId

[in, unique] The ID of the change unit that this range applies to. When this value is NULL, this range applies to all change units that are not otherwise specified in another knowledge fragment.

piClockVector

[in] The clock vector that defines what is known about the items in the range.

Return Value

  • S_OK.

  • E_INVALIDARG when pItemId is not larger than all other ranges set for pChangeUnitId. Ranges must be added in order by item ID.

  • E_POINTER.

  • SYNC_E_ID_FORMAT_MISMATCH when pItemId or pChangeUnitId is not of the format that the format schema of the provider specified.

  • SYNC_E_INVALID_OPERATION if the IKnowledgeBuilder2 object is in an improper state, such as when IKnowledgeBuilder::Initialize has not been called.

  • SYNC_E_INVALID_VERSION when the version of the knowledge being built is not compatible with ranges.

Remarks

Ranges must be added in order by item ID. The item ID that defines the closed lower bound for a range also defines the open upper bound of the previous range. If a range is added out of order, E_INVALIDARG is returned.

An ISyncKnowledge object in Sync Framework 2.0 and later versions contains a set of ICoreFragment objects. Each ICoreFragment object is associated with a set of change units and contains a set of ranges. Each range in an ICoreFragment object is associated with a clock vector that defines what is known about the items in the range. Typically, one of the ICoreFragment objects contains no change unit IDs. The knowledge that is contained in the ICoreFragment object that contains no change unit IDs applies to all change unit IDs that are not otherwise contained in another ICoreFragment object. To add a range to this fragment, specify NULL for pChangeUnitId.

See Also

Reference

IKnowledgeBuilder2 Interface

ICoreFragment Interface