Click or drag to resize

WrapperRDD Class

X#
This class can be used to wrap an existing RDD and add some functionality to it, such as logging, encryption etc.
To use it, create a subclass of this class and implement the methods that you want to override.
The constructor of this class takes an existing RDD object and automatically replaces it in the Workarea table.
Inheritance Hierarchy
Object
  WrapperRDD

Namespace:  XSharp.RDD
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 CLASS WrapperRDD IMPLEMENTS IRdd
Request Example View Source

The WrapperRDD type exposes the following members.

Constructors
  NameDescription
Public methodWrapperRDD
Initializes a new instance of the WrapperRDD class
Top
Properties
  NameDescription
Public propertyAlias
Retrieve the alias name.
Public propertyArea
Retrieve the Workarea number.
Public propertyBoF
Is the table at the logical beginning-of-file.
Public propertyDeleted
Is the current row deleted?
Public propertyDriver
Driver (RDD) name of the object.
Public propertyEoF
Is the table at the logical end-of-file.
Public propertyExclusive
Is the Workarea opened Exclusively
Public propertyFieldCount
The # of fields in the current Workarea.
Public propertyFilterText
The filter condition as a string.
Public propertyFound
The outcome of the last search operation.
Public propertyRecCount
The number of rows.
Public propertyRecId
The row identifier at the current cursor position.
Public propertyRecNo
The physical row identifier at the current cursor position.
Public propertyShared
Is the current Workarea opened Shared?
Top
Methods
  NameDescription
Public methodAddField
Add a column.
Public methodAppend
Append a blank row and position the cursor to the new row.
Public methodAppendLock
Add a newly appended row to the list of locked rows.
Public methodBlobInfo
Retrieve information about a memo column.
Public methodChildEnd
Report the initialization of a relation.
Public methodChildStart
Report the initialization of a relation.
Public methodChildSync
Post a pending relational movement, indicating that the specified child work area has been affected by a parental movement.
Public methodClearFilter
Clear the active filter condition.
Public methodClearRel
Clear relations.
Public methodClearScope
Clear the active locate condition.
Public methodClose
Close a table.
Public methodCloseMemFile
Close the memo file
Public methodCompile
Compile an expression.
Public methodContinue
Goto the next record based on the corrent locate condition.
Public methodCreate
Create a table.
Public methodCreateFields
Add columns defined in an array.
Public methodCreateMemFile
Create the memo file
Public methodDbEval
Evaluate a code block for each row.
Public methodDebuggerDisplay
Public methodDelete
Mark the row at the current cursor position for deletion.
Public methodEvalBlock
Evaluate a code block.
Public methodFieldIndex
Return the ONE based field index for a field name.
Public methodFieldInfo
Retrieve and optionally change information about a column.
Public methodFieldName
Retrieve a column name based on its ONE based column number.
Public methodFlush
Flush the changes to the table, its indexes and memo file.
Public methodForceRel
Force all pending relational seeks to be performed.
Public methodGetField
Retrieve the field information for a column based on its ONE based column number.
Public methodGetRec
Retrieve the RDD's record buffer as array of bytes.
Public methodGetScope
Retrieve the active locate condition.
Public methodGetValue
Get a value for the specified column.
Public methodGetValueFile
Get the value for a column and write (export) it to an external file.
Public methodGetValueLength
Get the length of the for the specified column.
Public methodGoBottom
Position the cursor to the last logical row.
Public methodGoCold
Write the contents of a work area's memory to the data store (usually a disk).
Public methodGoHot
Mark a data buffer as hot, indicating that it needs to be written to the data store.
Public methodGoTo
Position the cursor to a specific, physical row.
Public methodGoToId
Position the cursor to a specific, physical identity.
Public methodGoTop
Position the cursor to the first logical row.
Public methodHeaderLock
Lock or unlock the header of a database file.
Public methodInfo
Retrieve and optionally change information about a work area.
Public methodLock
Perform a lock.
Public methodOpen
Open a table.
Public methodOpenMemFile
Open the memo file
Public methodOrderCondition
Set the condition for the next Index Creation
Public methodOrderCreate
Create a new index or tag.
Public methodOrderDestroy
Delete an index or tag.
Public methodOrderInfo
Retrieve information about an index.
Public methodOrderListAdd
Open an index file and add to the list of open indexes for the current Workarea.
Public methodOrderListDelete
Close an index file and remove it from the list of open indexes for the current Workarea.
Public methodOrderListFocus
Set focus to another index in the list open indexes for the current Workarea.
Public methodOrderListRebuild
Rebuild all indexes for the current Workarea.
Public methodPack
Physically remove rows marked for deletion.
Public methodPutRec
Replace the row at the current cursor position with the contents of a byte array.
Public methodPutValue
Write a value for a specified column
Public methodPutValueFile
Read (Import) a value from an external file and write it to the specified column.
Public methodRecall
Remove the deletion marker from the row at the current cursor position.
Public methodRecInfo
Retrieve and optionally change information about a row.
Public methodRefresh
Discard all changes to the current record and reread the buffer from disk. When the current buffer is in Append mode then the server will move to the bottom of the file.
Public methodRelArea
Retrieve the logical number of a related work area.
Public methodRelEval
Evaluate a code block against the relation in a work area.
Public methodRelText
Retrieve the key expression of a relation.
Public methodSeek
Perform a seek operation on the current selected index for the current Workarea.
Public methodSetFieldExtent
Set the Number of Fields the AddField Method will add.
Public methodSetFilter
Set the filter condition.
Public methodSetRel
Set a relation.
Public methodSetScope
Set the locate condition.
Public methodSkip
Position the cursor relative to its current position.
Public methodSkipFilter
Position the cursor, respecting scope and filter conditions.
Public methodSkipRaw
Position the cursor regardless of scope and filter conditions.
Public methodSkipScope
Position the cursor relative to its current position within the current scope.
Public methodSort
Physically reorder a table.
Public methodSyncChildren
Force relational movement in child work areas to synchronize them with the parent work area.
Public methodTrans
Copy one or more rows from one work area to another.
Public methodTransRec
Copy a single row from one work area to another.
Public methodUnLock
Release locks.
Public methodZap
Physically remove all rows from a table.
Top
Examples
X#
 1CLASS MyRDD Inherit XSharp.RDD.WrapperRDD
 2
 3CONSTRUCTOR(oRdd as XSharp.RDD.IRDD)
 4   SUPER(oRdd)
 5
 6VIRTUAL METHOD GetValue(nFldPos AS LONG)        AS OBJECT
 7   Log("Reading field "+nFldPos:ToString())
 8   RETURN SUPER:GetValue(nFldPos)
 9
10VIRTUAL METHOD PutValue(nFldPos AS LONG, oValue AS OBJECT) AS LOGIC
11   Log("Writing field "+nFldPos:ToString()+" value "+oValue:ToString())
12   RETURN SUPER:PutValue(nFldPos, oValue)
13END CLASS
14
15FUNCTION Start() AS VOID
16   // Open customer table
17   USE Customer NEW
18
19   // Get current RDD for the selected Workarea
20   VAR oRdd := XSharp.RuntimeState.Workareas:GetRDD(Select())
21
22   // Create Wrapper RDD. This automatically replaces the RDD in the Workarea table
23   oRdd := MyRDD{oRdd}
24
25   ? FieldGet(1)           // This should also call Log() to show reading the value
26   ? FieldPut(1,"Jones")   // This should also call Log() to show writing the value
27   DbCloseArea()
28   RETURN
29
30Function Log(cMessage as STRING) AS VOID
31   ? cMessage
32   RETURN
See Also