#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. | |
| void | dirtyall () |
| Don't call sync, all storages are replaced. | |
| 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 | |
| static int | cost (ShStorage *from, ShStorage *to) |
| Return the cost of transferring from one storage to another. | |
| static bool | transfer (ShStorage *from, ShStorage *to) |
| Transfer data from one storage to another. | |
| static 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 146 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 197 of file ShMemory.cpp. Referenced by sync(). |
|
|
Mark an upcoming write to this storage. This will sync, if necessary. Definition at line 183 of file ShMemory.cpp. References dirtyall(), and sync(). |
|
|
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. |
|
|
Make sure this storage is in sync with the latest version of the memory.
Definition at line 149 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 209 of file ShMemory.cpp. Referenced by addTransfer(), and sync(). |
1.4.1