#include <SegPageBackupRestoreDevice.h>
Inheritance diagram for BackupRestorePage:

Public Member Functions | |
| virtual PBuffer | getBuffer () const |
| |
| virtual uint | getBufferSize () const |
| |
| virtual void | notifyTransferCompletion (bool bSuccess) |
| Receives notification when a transfer completes. | |
| void | setParent (WeakSegPageBackupRestoreDevice pParentInit) |
| Sets the initiating backup/restore object. | |
| void | setBuffer (PBuffer pBuffer) |
| Sets the buffer associated with this page. | |
| void | setBufferSize (uint bufferSize) |
| Sets the size of the buffer. | |
| BlockNum | getPageCounter () |
| |
| void | setPageCounter (BlockNum counter) |
| Sets the counter that determines the order in which pages are written to the backup file. | |
| void | setReadRequest (bool isRead) |
| Indicates whether the request is a read request. | |
Private Attributes | |
| PBuffer | pBuffer |
| Pointer to the scratch buffer associated with this request. | |
| BlockNum | pageCounter |
| The counter that determines the order in which pages are written to the backup file. | |
| uint | bufferSize |
| Size of the scratch buffer. | |
| bool | isRead |
| True if this is a read request. | |
| WeakSegPageBackupRestoreDevice | pParent |
| A pointer to the parent object that initiated this I/O request. | |
Definition at line 44 of file SegPageBackupRestoreDevice.h.
| PBuffer BackupRestorePage::getBuffer | ( | ) | const [virtual] |
Implements RandomAccessRequestBinding.
Definition at line 37 of file SegPageBackupRestoreDevice.cpp.
References pBuffer.
Referenced by SegPageBackupRestoreDevice::notifyReadTransferCompletion(), and SegPageBackupRestoreDevice::restorePage().
00038 { 00039 return pBuffer; 00040 }
| uint BackupRestorePage::getBufferSize | ( | ) | const [virtual] |
Implements RandomAccessRequestBinding.
Definition at line 47 of file SegPageBackupRestoreDevice.cpp.
References bufferSize.
00048 { 00049 return bufferSize; 00050 }
| void BackupRestorePage::notifyTransferCompletion | ( | bool | bSuccess | ) | [virtual] |
Receives notification when a transfer completes.
| bSuccess | true if the full buffer size was successfully transferred for this binding |
Implements RandomAccessRequestBinding.
Definition at line 72 of file SegPageBackupRestoreDevice.cpp.
References isRead, and pParent.
00073 { 00074 SharedSegPageBackupRestoreDevice sharedPtr = pParent.lock(); 00075 StrictMutexGuard mutexGuard(sharedPtr->getMutex()); 00076 00077 if (isRead) { 00078 sharedPtr->notifyReadTransferCompletion(*this, bSuccess); 00079 } else { 00080 sharedPtr->notifyWriteTransferCompletion(*this, bSuccess); 00081 } 00082 00083 // release the reference to the shared pointer while we're still holding 00084 // the parent mutex 00085 sharedPtr.reset(); 00086 }
| void BackupRestorePage::setParent | ( | WeakSegPageBackupRestoreDevice | pParentInit | ) |
Sets the initiating backup/restore object.
| pParentInit | a pointer to the initiating backup/restore object |
Definition at line 32 of file SegPageBackupRestoreDevice.cpp.
References pParent.
00033 { 00034 pParent = pParentInit; 00035 }
| void BackupRestorePage::setBuffer | ( | PBuffer | pBuffer | ) |
Sets the buffer associated with this page.
| pBuffer | the buffer |
Definition at line 52 of file SegPageBackupRestoreDevice.cpp.
References pBuffer.
00053 { 00054 pBuffer = pBufferInit; 00055 }
| void BackupRestorePage::setBufferSize | ( | uint | bufferSize | ) |
Sets the size of the buffer.
| bufferSize | the buffer size |
Definition at line 42 of file SegPageBackupRestoreDevice.cpp.
References bufferSize.
00043 { 00044 bufferSize = bufferSizeInit; 00045 }
| BlockNum BackupRestorePage::getPageCounter | ( | ) |
Definition at line 57 of file SegPageBackupRestoreDevice.cpp.
References pageCounter.
Referenced by SegPageBackupRestoreDevice::notifyReadTransferCompletion().
00058 { 00059 return pageCounter; 00060 }
| void BackupRestorePage::setPageCounter | ( | BlockNum | counter | ) |
Sets the counter that determines the order in which pages are written to the backup file.
| counter | the counter |
Definition at line 62 of file SegPageBackupRestoreDevice.cpp.
References pageCounter.
Referenced by SegPageBackupRestoreDevice::backupPage(), and SegPageBackupRestoreDevice::restorePage().
00063 { 00064 pageCounter = counter; 00065 }
| void BackupRestorePage::setReadRequest | ( | bool | isRead | ) |
Indicates whether the request is a read request.
| isRead | true if this is a read request |
Definition at line 67 of file SegPageBackupRestoreDevice.cpp.
References isRead.
Referenced by SegPageBackupRestoreDevice::backupPage(), and SegPageBackupRestoreDevice::restorePage().
00068 { 00069 isRead = isReadInit; 00070 }
PBuffer BackupRestorePage::pBuffer [private] |
Pointer to the scratch buffer associated with this request.
Definition at line 50 of file SegPageBackupRestoreDevice.h.
Referenced by getBuffer(), and setBuffer().
BlockNum BackupRestorePage::pageCounter [private] |
The counter that determines the order in which pages are written to the backup file.
Definition at line 56 of file SegPageBackupRestoreDevice.h.
Referenced by getPageCounter(), and setPageCounter().
uint BackupRestorePage::bufferSize [private] |
Size of the scratch buffer.
Definition at line 61 of file SegPageBackupRestoreDevice.h.
Referenced by getBufferSize(), and setBufferSize().
bool BackupRestorePage::isRead [private] |
True if this is a read request.
Definition at line 66 of file SegPageBackupRestoreDevice.h.
Referenced by notifyTransferCompletion(), and setReadRequest().
A pointer to the parent object that initiated this I/O request.
Uses a weak pointer because of the circularity in the reference.
Definition at line 72 of file SegPageBackupRestoreDevice.h.
Referenced by notifyTransferCompletion(), and setParent().
1.5.1