|
resonance 1.0.1
|
Queue of memory-card operations, with one entry point per libmc call. More...
#include <memcard.h>

Public Member Functions | |
| Memcard () | |
| Construct an empty queue. | |
| virtual | ~Memcard () |
| Release the queue. | |
| virtual void | Update () |
| Advance the head of the queue by one step. | |
| void | CheckInfo (MemcardCBHandler *pHandler, int nPortSlot, int nCookie) |
| Queue an enquiry about the card in one slot. | |
| void | EntSpace (MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie) |
| Queue an enquiry about the free directory entries under one path. | |
| void | Format (MemcardCBHandler *pHandler, int nPortSlot, int nCookie) |
| Queue a format of the card in one slot. | |
| void | Unformat (MemcardCBHandler *pHandler, int nPortSlot, int nCookie) |
| Queue an unformat of the card in one slot. | |
| void | CreateDir (MemcardCBHandler *pHandler, int nPortSlot, HxStr path, int nCookie) |
| Queue the creation of one directory. | |
| void | ListDir (MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie, unsigned nMode) |
| Queue a listing of one directory. | |
| void | Read (MemcardCBHandler *pHandler, int nPortSlot, int nFile, void *pBuffer, int nLength, int nCookie) |
| Queue a read from an open descriptor. | |
| void | Write (MemcardCBHandler *pHandler, int nPortSlot, int nFile, const void *pBuffer, int nLength, int nCookie) |
| Queue a write to an open descriptor. | |
| void | Seek (MemcardCBHandler *pHandler, int nFile, int nOffset, int nOrigin, int nCookie) |
| Queue a move of the position of an open descriptor. | |
| void | OpenWrite (MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie) |
| Queue an open for writing. | |
| void | OpenRead (MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie) |
| Queue an open for reading. | |
| void | Close (MemcardCBHandler *pHandler, int nFile, int nCookie) |
| Queue a close of an open descriptor. | |
| void | DeleteFile (MemcardCBHandler *pHandler, int nPortSlot, const HxStr &path, int nCookie) |
| Queue the deletion of one file or directory. | |
| void | RenameFile (MemcardCBHandler *pHandler, int nPortSlot, const HxStr &oldPath, const HxStr &newPath, int nCookie) |
| Queue a rename. | |
| void | Cancel (int nCookie) |
| Discard every queued operation that was queued with one tag. | |
Protected Attributes | |
| std::list< MemcardOp * > | mOps |
Queue of memory-card operations, with one entry point per libmc call.
Its RTTI descriptor is at 0x0086f630. It has no base class. The vptr therefore sits after the data at offset 4 rather than at offset 0. An instance is eight bytes and the vtable is at 0x0082c030, with three slots.
Every entry point below constructs one MemcardOp subclass on the heap and appends it to the queue. Nothing is issued at that moment. Update() drives the head of the queue, one libmc call at a time. A caller that queues an open, a write and a close in one turn therefore gets them serviced in order over the following frames. Ordering is what makes the queue rather than a set of direct calls necessary, because libmc services one command at a time.
Every entry point takes an nCookie ticket number, which the operation stores and Cancel() matches on. Every MemcardTask passes its own ticket. Abandoning a task therefore abandons exactly the operations that task queued, wherever they sit in the queue.
One instance exists. It is a MemcardPS2 built with new inside the constructor at 0x001f2960, which belongs to a singleton outside this subsystem.
| Memcard::Memcard | ( | ) |
Construct an empty queue.
The body default-constructs the queue and nothing else. The compiler inlined it into MemcardPS2::MemcardPS2(). No address of its own survives.
|
virtual |
Release the queue.
Occupies vtable slot 1. Any operation still queued is discarded without being issued and without being destroyed, because the body clears the list rather than deleting through it.
|
virtual |
Advance the head of the queue by one step.
Occupies vtable slot 2. The body of this class is empty, and MemcardPS2 supplies the PlayStation 2 implementation. The method title is inferred.
Reimplemented in MemcardPS2.
| void Memcard::CheckInfo | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| int | nCookie ) |
Queue an enquiry about the card in one slot.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::EntSpace | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| const HxStr & | path, | ||
| int | nCookie ) |
Queue an enquiry about the free directory entries under one path.
No caller exists in the image.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| path | The directory to measure. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::Format | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| int | nCookie ) |
Queue a format of the card in one slot.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::Unformat | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| int | nCookie ) |
Queue an unformat of the card in one slot.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::CreateDir | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| HxStr | path, | ||
| int | nCookie ) |
Queue the creation of one directory.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| path | The directory to create, taken by value and destroyed on return. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::ListDir | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| const HxStr & | path, | ||
| int | nCookie, | ||
| unsigned | nMode ) |
Queue a listing of one directory.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| path | The directory to list. |
| nCookie | The tag Cancel() matches on. |
| nMode | The sceMcGetDir() mode. |
| void Memcard::Read | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| int | nFile, | ||
| void * | pBuffer, | ||
| int | nLength, | ||
| int | nCookie ) |
Queue a read from an open descriptor.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot, which the operation records and never uses. |
| nFile | The descriptor to read from. |
| pBuffer | The destination. |
| nLength | The number of bytes to read. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::Write | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| int | nFile, | ||
| const void * | pBuffer, | ||
| int | nLength, | ||
| int | nCookie ) |
Queue a write to an open descriptor.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot, which the operation records and never uses. |
| nFile | The descriptor to write to. |
| pBuffer | The source. |
| nLength | The number of bytes to write. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::Seek | ( | MemcardCBHandler * | pHandler, |
| int | nFile, | ||
| int | nOffset, | ||
| int | nOrigin, | ||
| int | nCookie ) |
Queue a move of the position of an open descriptor.
No caller exists in the image.
| pHandler | The receiver the finished operation reports to. |
| nFile | The descriptor to move. |
| nOffset | The offset to move by. |
| nOrigin | The origin the offset is measured from. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::OpenWrite | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| const HxStr & | path, | ||
| int | nCookie ) |
Queue an open for writing.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| path | The file to open. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::OpenRead | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| const HxStr & | path, | ||
| int | nCookie ) |
Queue an open for reading.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| path | The file to open. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::Close | ( | MemcardCBHandler * | pHandler, |
| int | nFile, | ||
| int | nCookie ) |
Queue a close of an open descriptor.
| pHandler | The receiver the finished operation reports to. |
| nFile | The descriptor to close. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::DeleteFile | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| const HxStr & | path, | ||
| int | nCookie ) |
Queue the deletion of one file or directory.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| path | The file or directory to delete. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::RenameFile | ( | MemcardCBHandler * | pHandler, |
| int | nPortSlot, | ||
| const HxStr & | oldPath, | ||
| const HxStr & | newPath, | ||
| int | nCookie ) |
Queue a rename.
No caller exists in the image.
| pHandler | The receiver the finished operation reports to. |
| nPortSlot | The packed port and slot. |
| oldPath | The existing name. |
| newPath | The replacement name. |
| nCookie | The tag Cancel() matches on. |
| void Memcard::Cancel | ( | int | nCookie | ) |
Discard every queued operation that was queued with one tag.
An operation already in flight is discarded along with the rest, and its libmc call is not waited for.
| nCookie | The tag to match. |
|
protected |