Container for an InkCPP runtime snapshot.
More...
#include <snapshot.h>
|
virtual const unsigned char * | get_data () const =0 |
| acces blob inside snapshot
|
|
virtual size_t | get_data_len () const =0 |
| size of blob inside snapshot
|
|
virtual size_t | num_runners () const =0 |
| number of runners which are stored inside this snapshot
|
|
void | write_to_file (const char *filename) const |
| serialize snapshot to file
|
|
|
static snapshot * | from_binary (const unsigned char *data, size_t length, bool freeOnDestroy=true) |
| Construct snapshot from blob.
|
|
static snapshot * | from_file (const char *filename) |
| deserialize snapshot from file.
|
|
Container for an InkCPP runtime snapshot.
Each snapshot contains a globals store and all assoziated runners/threads For convinience there exist ink::runtime::globals_interface::create_snapshot() and runner_interface::create_snapshot() . If the runner is assoziated to the globals the snapshot will be identical. If multiple runners are assoziated to the same globals all will be contained, and cann be reconsrtucted with the id parameter of ink::runtime::story::new_runner_from_snapshot()
- Todo
- Currently the id is equal to the creation order, a way to name the single runner/threads is WIP
◆ from_binary()
static snapshot * ink::runtime::snapshot::from_binary |
( |
const unsigned char * | data, |
|
|
size_t | length, |
|
|
bool | freeOnDestroy = true ) |
|
static |
Construct snapshot from blob.
Memory must be kept valid until the snapshot is deconstructed.
- Parameters
-
data | pointer to blob |
length | number of bytes in blob |
freeOnDestroy | if the memory should be freed (delete[]) when the snapshot is deconstructed |
- Returns
- newly created snapshot
◆ from_file()
static snapshot * ink::runtime::snapshot::from_file |
( |
const char * | filename | ) |
|
|
static |
deserialize snapshot from file.
- Parameters
-
- Exceptions
-
ink_exception | if it fails to open the file |
◆ write_to_file()
void ink::runtime::snapshot::write_to_file |
( |
const char * | filename | ) |
const |
serialize snapshot to file
- Parameters
-
filename | output file filename, if already exist it will be overwritten |
- Exceptions
-
ink_exception | if it failt to open the file |
The documentation for this class was generated from the following file: