点击或拖拽改变大小

WrapperRDD 类

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.
继承层次
Object
  WrapperRDD

命名空间:  XSharp.RDD
程序集:  XSharp.Core (在 XSharp.Core.dll 中) 版本:2.22 GA
语法
 CLASS WrapperRDD IMPLEMENTS IRdd
查看代码

WrapperRDD 类型公开以下成员。

构造函数
  名称说明
公共方法WrapperRDD
初始化 WrapperRDD 类的一个新实例
Top
属性
  名称说明
公共属性Alias
Retrieve the alias name.
公共属性Area
Retrieve the Workarea number.
公共属性BoF
Is the table at the logical beginning-of-file.
公共属性Deleted
Is the current row deleted?
公共属性Driver
Driver (RDD) name of the object.
公共属性EoF
Is the table at the logical end-of-file.
公共属性Exclusive
Is the Workarea opened Exclusively
公共属性FieldCount
The # of fields in the current Workarea.
公共属性FilterText
The filter condition as a string.
公共属性Found
The outcome of the last search operation.
公共属性RecCount
The number of rows.
公共属性RecId
The row identifier at the current cursor position.
公共属性RecNo
The physical row identifier at the current cursor position.
公共属性Shared
Is the current Workarea opened Shared?
Top
方法
  名称说明
公共方法AddField
Add a column.
公共方法Append
Append a blank row and position the cursor to the new row.
公共方法AppendLock
Add a newly appended row to the list of locked rows.
公共方法BlobInfo
Retrieve information about a memo column.
公共方法ChildEnd
Report the initialization of a relation.
公共方法ChildStart
Report the initialization of a relation.
公共方法ChildSync
Post a pending relational movement, indicating that the specified child work area has been affected by a parental movement.
公共方法ClearFilter
Clear the active filter condition.
公共方法ClearRel
Clear relations.
公共方法ClearScope
Clear the active locate condition.
公共方法Close
Close a table.
公共方法CloseMemFile
Close the memo file
公共方法Compile
Compile an expression.
公共方法Continue
Goto the next record based on the corrent locate condition.
公共方法Create
Create a table.
公共方法CreateFields
Add columns defined in an array.
公共方法CreateMemFile
Create the memo file
公共方法DbEval
Evaluate a code block for each row.
公共方法DebuggerDisplay
公共方法Delete
Mark the row at the current cursor position for deletion.
公共方法EvalBlock
Evaluate a code block.
公共方法FieldIndex
Return the ONE based field index for a field name.
公共方法FieldInfo
Retrieve and optionally change information about a column.
公共方法FieldName
Retrieve a column name based on its ONE based column number.
公共方法Flush
Flush the changes to the table, its indexes and memo file.
公共方法ForceRel
Force all pending relational seeks to be performed.
公共方法GetField
Retrieve the field information for a column based on its ONE based column number.
公共方法GetRec
Retrieve the RDD's record buffer as array of bytes.
公共方法GetScope
Retrieve the active locate condition.
公共方法GetValue
Get a value for the specified column.
公共方法GetValueFile
Get the value for a column and write (export) it to an external file.
公共方法GetValueLength
Get the length of the for the specified column.
公共方法GoBottom
Position the cursor to the last logical row.
公共方法GoCold
Write the contents of a work area's memory to the data store (usually a disk).
公共方法GoHot
Mark a data buffer as hot, indicating that it needs to be written to the data store.
公共方法GoTo
Position the cursor to a specific, physical row.
公共方法GoToId
Position the cursor to a specific, physical identity.
公共方法GoTop
Position the cursor to the first logical row.
公共方法HeaderLock
Lock or unlock the header of a database file.
公共方法Info
Retrieve and optionally change information about a work area.
公共方法Lock
Perform a lock.
公共方法Open
Open a table.
公共方法OpenMemFile
Open the memo file
公共方法OrderCondition
Set the condition for the next Index Creation
公共方法OrderCreate
Create a new index or tag.
公共方法OrderDestroy
Delete an index or tag.
公共方法OrderInfo
Retrieve information about an index.
公共方法OrderListAdd
Open an index file and add to the list of open indexes for the current Workarea.
公共方法OrderListDelete
Close an index file and remove it from the list of open indexes for the current Workarea.
公共方法OrderListFocus
Set focus to another index in the list open indexes for the current Workarea.
公共方法OrderListRebuild
Rebuild all indexes for the current Workarea.
公共方法Pack
Physically remove rows marked for deletion.
公共方法PutRec
Replace the row at the current cursor position with the contents of a byte array.
公共方法PutValue
Write a value for a specified column
公共方法PutValueFile
Read (Import) a value from an external file and write it to the specified column.
公共方法Recall
Remove the deletion marker from the row at the current cursor position.
公共方法RecInfo
Retrieve and optionally change information about a row.
公共方法Refresh
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.
公共方法RelArea
Retrieve the logical number of a related work area.
公共方法RelEval
Evaluate a code block against the relation in a work area.
公共方法RelText
Retrieve the key expression of a relation.
公共方法Seek
Perform a seek operation on the current selected index for the current Workarea.
公共方法SetFieldExtent
Set the Number of Fields the AddField Method will add.
公共方法SetFilter
Set the filter condition.
公共方法SetRel
Set a relation.
公共方法SetScope
Set the locate condition.
公共方法Skip
Position the cursor relative to its current position.
公共方法SkipFilter
Position the cursor, respecting scope and filter conditions.
公共方法SkipRaw
Position the cursor regardless of scope and filter conditions.
公共方法SkipScope
Position the cursor relative to its current position within the current scope.
公共方法Sort
Physically reorder a table.
公共方法SyncChildren
Force relational movement in child work areas to synchronize them with the parent work area.
公共方法Trans
Copy one or more rows from one work area to another.
公共方法TransRec
Copy a single row from one work area to another.
公共方法UnLock
Release locks.
公共方法Zap
Physically remove all rows from a table.
Top
示例
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
参见