ReorderIndex Class Reference

A class that holds entries for an index table that will be temporally reordered. More...

#include <index.h>

Inheritance diagram for ReorderIndex:

RefCount IRefCount List of all members.

Public Member Functions

 ReorderIndex (int UseIndexEntrySize)
 Initialise the ReorderIndex.
bool SetEntry (Position Pos, UInt8 Flags, Int8 AnchorOffset, UInt8 *Tables=NULL)
 Add a new entry to the table (setting flags and anchor offset).
bool SetStreamOffset (Position Pos, Position StreamOffset)
 Add a new entry to the table.
bool SetTemporalOffset (Position Pos, Int8 TemporalOffset)
 Set the temporal offset for an entry in the table.
Int32 GetEntryCount (void)
 Get the number of entries in the table.
Int32 CommitEntries (IndexTablePtr Index, Int32 Count=-1)
 Commit entries to the specified index table.

Protected Attributes

DataChunk IndexEntries
 Data chunk holding the actual entries.
int CompleteEntryCount
 Number of entries including all details (but not necessarily a temporal offset).
int EntryCount
 Number of entries containing a either full details or a temporal offset.
Position FirstPosition
 The edit unit number of the first position in this index table.
UInt32 IndexEntrySize
 The size of each index entry.

Detailed Description

A class that holds entries for an index table that will be temporally reordered.

Temporal offsets need to be written to entries that are either complete already or have not yet been filled in. Once the entries have been written including their temporal offsets they can be added to a proper index table


Constructor & Destructor Documentation

ReorderIndex ( int  UseIndexEntrySize  )  [inline]

Initialise the ReorderIndex.


Member Function Documentation

bool SetEntry ( Position  Pos,
UInt8  Flags,
Int8  AnchorOffset,
UInt8 Tables = NULL 
)

Add a new entry to the table (setting flags and anchor offset).

bool SetStreamOffset ( Position  Pos,
Position  StreamOffset 
)

Add a new entry to the table.

bool SetTemporalOffset ( Position  Pos,
Int8  TemporalOffset 
)

Set the temporal offset for an entry in the table.

Int32 GetEntryCount ( void   )  [inline]

Get the number of entries in the table.

Int32 CommitEntries ( IndexTablePtr  Index,
Int32  Count = -1 
)

Commit entries to the specified index table.

If Count == -1 all entries are comitted

Note:
There is no way for this function to know for sure which entries have their TemporalOffsets set so the caller must ensure it only asks us to commit those entries that are certain to be totally complete. One possible strategy is to always leave at least 128 entries in the table until the end of processing as the temporal offsets cannot reach further than 128 backwards.


Member Data Documentation

DataChunk IndexEntries [protected]

Data chunk holding the actual entries.

int CompleteEntryCount [protected]

Number of entries including all details (but not necessarily a temporal offset).

int EntryCount [protected]

Number of entries containing a either full details or a temporal offset.

This is actually the index of the highest used entry plus one, so there may be some entries that don't contain anything that come before the last counted entry. For example, if the only complete entry is entry[0], and entry[0] and entry[2] both contain a temporal offset then CompleteEntryCount = 1 and EntryCount = 3

Position FirstPosition [protected]

The edit unit number of the first position in this index table.

UInt32 IndexEntrySize [protected]

The size of each index entry.


The documentation for this class was generated from the following files:
Generated on Mon Apr 2 15:20:59 2007 for MXFLib by  doxygen 1.5.1-p1