#include <IVOSDiskPage.h>
|
| enum | { kDefaultIID = IID_IVOSDISKPAGE } |
| |
The IVOSDiskPage represents a node within a double-linked list of IVOSDiskPage's each page contains a list of VOS_Objects. This is the basic data structure used by each strand within the ITextModel. Pseudo-iterators called VOS_Cursors are used to walk the data. NOTE: Normally this objects would NOT be accessed directly.
- See Also
- ITextModel
- VOS_Object
- VOS_Cursor
| virtual void IVOSDiskPage::AddRefObj | ( | VOS_Object * | object | ) | |
| pure virtual |
Add a reference to the object. This object must be contained on this page.
- Parameters
| virtual void IVOSDiskPage::AdjustLength | ( | int32 | delta | ) | |
| pure virtual |
Used by the VOS_Objects to tell the page that lengths have changed.
- Parameters
| delta | is the adjustment to the total number of characters on the page. |
Append an object onto the page. May cause the page to split into two.
- Parameters
| newOne | is the new VOS_Object to add to the page. |
| after | is the object to append after. Nil means to add at the end of the page. An object off the page will fail. |
| virtual void IVOSDiskPage::DirtyPage | ( | Bool16 | markDoc = kTrue | ) | |
| pure virtual |
Used by the VOS_Objects on the page to mark the page Dirty.
- Parameters
| markDoc | indicates whether to mark the document dirty also. |
| virtual ClassID IVOSDiskPage::GetClassOfObjectsInStrand | ( | | ) | const |
| pure virtual |
What type of VOS_Objects are being stored on this disk page? Each strand only can be made up of one type of VOS_Object in the normal scheme.
- Returns
- the ClassID of the VOS_Objects on this page.
| virtual UID IVOSDiskPage::GetStrand | ( | | ) | const |
| pure virtual |
What is the strand that owns this page?
- Returns
- the UID of the strand that uses this disk page.
Insert an object onto the page. May cause the page to split into two.
- Parameters
| newOne | is the new VOS_Object to add to the page. |
| before | is the object to insert before. Nil means to insert at the beginning of the page. An object off the page will fail. |
| virtual void IVOSDiskPage::InsertPage | ( | UID | newPage, | | | VOS_Object * | before = nil | | ) | | |
| pure virtual |
Insert a new page into the linked list. Maintains the linked list and the caches.
- Parameters
| newPage | is a UID of a new VOSDiskpage to add to the structure. |
| before,if | non-nil, specifies that the new page is to be inserted before the location of an object on the page. Can cause this page to split. |
| virtual int32 IVOSDiskPage::LocateObjectStart | ( | const VOS_Object * | object | ) | |
| pure virtual |
Find the offset of a VOS_Object that is located on this page. This is not an absolute index or position, only an offset (in characters) from the beginning of the page.
- Parameters
| object | is the object in question. |
- Returns
- the offset from the page start of the beginning of the object.
| virtual UID IVOSDiskPage::NextPage | ( | | ) | const |
| pure virtual |
What is the IVOSDiskPage that comes after this one?
- Returns
- the UID of the next disk page.
| virtual int32 IVOSDiskPage::ObjectIndexOnPage | ( | const VOS_Object * | object | ) | |
| pure virtual |
Find the index of a VOS_Object that is located on this page. This is not any kind of character position, just the index relative to other VOS_Objects on this page.
- Parameters
| object | is the object in question. |
- Returns
- the index of the object.
| virtual UID IVOSDiskPage::PrevPage | ( | | ) | const |
| pure virtual |
What is the IVOSDiskPage that comes before this one?
- Returns
- the UID of the previous disk page.
| virtual VOS_Object* IVOSDiskPage::QueryFindObject | ( | int32 * | offset | ) | |
| pure virtual |
Find the VOS_Object that is located at the specified offset on this page. This is not an absolute index or position, only an offset (in characters) from the beginning of the page.
- Parameters
| offset | is the number of characters from the beginning of the page. Offset is updated to be the offset WITHIN the returned object (the object contains the position, but doesn't have to start with it). |
- Returns
- an AddRef'd object that contains the offset.
| virtual VOS_Object* IVOSDiskPage::QueryFirstObj | ( | | ) | |
| pure virtual |
Query the first object on the page
- Returns
- an AddRef'd pointer to the first object on the page.
Query the last object on the page
- Returns
- an AddRef'd pointer to the last object on the page.
Query the object that occurs after another one on the page. This routine will return nil if the passed in object is NOT on this page or if the object is the last object on the page – it doesn't go to the next page automatically.
- Parameters
| object | is one object on the page. |
- Returns
- an AddRef'd pointer to the next object on the page.
Query the object that occurs before another one on the page. This routine will return nil if the passed in object is NOT on this page or if the object is the first object on the page – it doesn't go to the previous page automatically.
- Parameters
| obj | is one object on the page. |
- Returns
- an AddRef'd pointer to the previous object on the page.
| virtual void IVOSDiskPage::ReleaseObj | ( | VOS_Object * | object | ) | |
| pure virtual |
Release a reference to the object. This object must be contained on this page.
- Parameters
| object | is the VOS_Object who used to be referenced. |
| virtual void IVOSDiskPage::RemoveObj | ( | VOS_Object * | theOne, | | | bool16 | deleteIt = kTrue | | ) | | |
| pure virtual |
Remove an object from the page.
- Parameters
| theOne | is the new VOS_Object to remove. Will fail if the object is not found. |
| deleteIt | indicates whether to force the object to be destructed. |
| virtual UID IVOSDiskPage::RemoveOneOrMorePages | ( | int32 * | length, | | | K2Vector< UID > * | pageIDList, | | | K2Vector< int32 > * | pageLenList | | ) | | |
| pure virtual |
Shortcut method to remove more than one page at a time.
- Parameters
| length | is the number of characters to span. If the next diskpage is longer than the length left, then length is left with the number of characters on the next page and that next page's UID is returned. |
| pageIDList | is the list of the IVOSDiskPage objects that were contained in the range. |
| pageLenList | is a list of lengths, each corresponding to the disk pages in the pageIDList. |
- Returns
- the next disk page UID when the range doesn't extend through the end of the story.
| virtual void IVOSDiskPage::RemovePage | ( | | ) | |
| pure virtual |
Remove the page from the chain of pages. Updates the previous & next pointers of all diskpages involved, tells the cache, etc. but doesn't delete the object from the database.
| virtual void IVOSDiskPage::ReplaceObj | ( | VOS_Object * | replaceMe, | | | VOS_Object * | replaceWith, | | | bool16 | deleteIt = kTrue | | ) | | |
| pure virtual |
Replace an object onto the page.
- Parameters
| replaceMe | is the old VOS_Object to remove from the page. This object must be on this page. |
| replaceWith | is the new VOS_Object to add to the page. |
| deleteIt | indicates whether to force the old object to be destructed. |
| virtual void IVOSDiskPage::SetNextPage | ( | UID | page | ) | |
| pure virtual |
What is the IVOSDiskPage that comes after this one?
- Parameters
| page | is the UID of the next disk page. |
| virtual void IVOSDiskPage::SetPrevPage | ( | UID | page | ) | |
| pure virtual |
What is the IVOSDiskPage that comes before this one?
- Parameters
| page | is the UID of the previous disk page. |
| virtual void IVOSDiskPage::SetStrand | ( | UID | strandID | ) | |
| pure virtual |
What is the strand that owns this page?
- Parameters
| strandID | is the UID of the strand that uses this disk page. |
| virtual int32 IVOSDiskPage::TotalLength | ( | | ) | |
| pure virtual |
How many characters are represented by this disk page?
- Returns
- the number of character positions represented by this page.
| virtual int32 IVOSDiskPage::TotalObjects | ( | | ) | |
| pure virtual |
How many VOS_Objects are on this page?
- Returns
- the number of VOS_Objects on this page.