inkcpp
Loading...
Searching...
No Matches
snapshot.h
1/* Copyright (c) 2024 Julian Benda
2 *
3 * This file is part of inkCPP which is released under MIT license.
4 * See file LICENSE.txt or go to
5 * https://github.com/JBenda/inkcpp for full license details.
6 */
7#pragma once
8
9#include "types.h"
10
11namespace ink::runtime
12{
56{
57public:
58 virtual ~snapshot(){};
59
68 static snapshot* from_binary(const unsigned char* data, size_t length, bool freeOnDestroy = true);
69
71 virtual const unsigned char* get_data() const = 0;
73 virtual size_t get_data_len() const = 0;
75 virtual size_t num_runners() const = 0;
77 virtual bool can_be_migrated() const = 0;
78
79#ifdef INK_ENABLE_STL
84 static snapshot* from_file(const char* filename);
89 void write_to_file(const char* filename) const;
90#endif
91};
92} // namespace ink::runtime
Container for an InkCPP runtime snapshot.
Definition snapshot.h:56
static snapshot * from_file(const char *filename)
deserialize snapshot from file.
virtual size_t get_data_len() const =0
size of blob inside snapshot
void write_to_file(const char *filename) const
serialize snapshot to file
virtual size_t num_runners() const =0
number of runners which are stored inside this snapshot
virtual bool can_be_migrated() const =0
if this snapshot can be migrated, if the story file changes (slightly).
static snapshot * from_binary(const unsigned char *data, size_t length, bool freeOnDestroy=true)
Construct snapshot from blob.
virtual const unsigned char * get_data() const =0
access blob inside snapshot
Contaning all modules and classes used for the inkles ink runtime.
Definition choice.h:13