#include <ShMemory.hpp>
Inheritance diagram for SH::ShStorage:
Public Member Functions | |
int | timestamp () const |
Return the version of the data currently stored by this storage. | |
void | setTimestamp (int timestamp) |
Force-set the version of the data currently stored by this storage. | |
const ShMemory * | memory () const |
Return the memory this storage represents. | |
ShMemory * | memory () |
Return the memory this storage represents. | |
void | sync () |
Make sure this storage is in sync with the latest version of the memory. | |
void | dirty () |
Mark an upcoming write to this storage. | |
virtual std::string | id () const =0 |
Return an id uniquely identifying the _type_ of this storage This is used for looking up transfer functions. | |
void | orphan () |
Called by ShMemory when it destructs. Necessary for refcounting purposes. | |
Static Public Member Functions | |
int | cost (ShStorage *from, ShStorage *to) |
Return the cost of transferring from one storage to another. | |
bool | transfer (ShStorage *from, ShStorage *to) |
Transfer data from one storage to another. | |
void | addTransfer (const std::string &from, const std::string &to, ShTransfer *transfer) |
Use this to register new transfer functions when they are instantiated. | |
Protected Member Functions | |
ShStorage (ShMemory *memory) |
This might be on the CPU, the GPU, a filesystem or even across the network.
Definition at line 136 of file ShMemory.hpp.
|
Return the cost of transferring from one storage to another. Returns -1 if there is no possible transfer. Definition at line 182 of file ShMemory.cpp. References id(). Referenced by sync(). |
|
Mark an upcoming write to this storage. This will sync, if necessary. Definition at line 170 of file ShMemory.cpp. References sync(), and SH::ShMemory::updateTimestamp(). |
|
Return an id uniquely identifying the _type_ of this storage This is used for looking up transfer functions. e.g.: host, opengl:texture, sm:texture Implemented in SH::ShHostStorage. Referenced by cost(), and transfer(). |
|
Make sure this storage is in sync with the latest version of the memory.
Definition at line 136 of file ShMemory.cpp. References cost(), SH::ShMemory::m_storages, timestamp(), SH::ShMemory::timestamp(), and transfer(). Referenced by dirty(). |
|
Transfer data from one storage to another. Returns true if the transfer succeeded. Definition at line 194 of file ShMemory.cpp. References id(), setTimestamp(), and timestamp(). Referenced by sync(). |