#include <ShMemory.hpp>
Inheritance diagram for SH::ShStorage:


Public Member Functions | |
| ShStorage () | |
| virtual | ~ShStorage () |
| int | timestamp () const |
| Return 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 () const |
| 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 () |
| 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. | |
| ShValueType | value_type () const |
| Return the type that is stored inside this object. | |
| void | value_type (ShValueType value_type) |
| Change the internal type (does NOT convert the values). | |
| int | value_size () const |
| Return the size in bytes of one value in the storage array. | |
Static Public Member Functions | |
| static int | cost (const ShStorage *from, const ShStorage *to) |
| Return the cost of transferring from one storage to another. | |
| static bool | transfer (const 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, ShValueType value_type) | |
Protected Attributes | |
| ShValueType | m_value_type |
| int | m_value_size |
This might be on the CPU, the GPU, a filesystem or even across the network.
Definition at line 150 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 198 of file ShMemory.cpp. References id(). Referenced by sync(). |
|
|
Mark an upcoming write to this storage. This will sync, if necessary. Definition at line 185 of file ShMemory.cpp. References dirtyall(), and sync(). |
|
|
Mark an upcoming write to this storage. Don't call sync, all storages are replaced. Definition at line 193 of file ShMemory.cpp. References SH::ShMemory::increment_timestamp(). Referenced by dirty(). |
|
|
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, shgl::GlTextureStorage, and shgl::PBufferStorage. Referenced by cost(), and transfer(). |
|
||||||||||||
|
Transfer data from one storage to another. Returns true if the transfer succeeded. Definition at line 210 of file ShMemory.cpp. References id(), and setTimestamp(). Referenced by addTransfer(), and SH::ShTextureNode::build_mipmaps(). |
1.4.6