-
Notifications
You must be signed in to change notification settings - Fork 0
Usage creation step for step
jurihock edited this page Oct 4, 2012
·
1 revision
- Specify an unique usage identifier in the
Usage_Code_Pointenumerator. - An usage class must implement the
IUsageinterface.- There are certain properties that returns constant values:
-
CodePoint: returns the correspondingUsage_Code_Pointvalue, -
Name: returns an user defined value, -
KindId: returns a system-wide unique int value, -
DataModel: returns the used data model, e.g.DICTIONARY.
-
- Other properties returns dynamically determined values:
-
ResourceName: is known at a later date, -
Length: is generally set at a later date.
-
- Implement the Create method to retrieve the resource name stored in
arguments[0]and the usage specific data stored inarguments[...]. - Methods
FromReaderand dump are used to de-/serialize the usage instance. - Method
AppProceduremust at least clear the passedkindResponselist. -
Encapsulatereturns the usage instance wrapped intoStoredDataValue. -
Reportreturns the arbitrary summary of the usage data.
- There are certain properties that returns constant values:
- Additionally the usage class must implement a constructor with signature
MyUsage(UsageManager). - Register declared usage at
Machine.InitUsageManager().
There are no restrictions about the serialization format or order. All values (incl. resource name) should be represent as a byte array. Because not all usage values are fixed-length values, e.g. strings, it is recommended to consequently attach a separate length field for each serialized value.
The total length of the serialized usage (Length property) can be computed during initialization (Create method) and after deserialization (FromReader method).
Finally the declared usage can be applied for Store or Fetch procedures by specifying its Usage_Code_Point identifier.