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{
75{
76public:
77 virtual ~snapshot() {};
78
87 static snapshot* from_binary(const unsigned char* data, size_t length, bool freeOnDestroy = true);
88
90 virtual const unsigned char* get_data() const = 0;
92 virtual size_t get_data_len() const = 0;
94 virtual size_t num_runners() const = 0;
97 virtual bool can_be_migrated() const = 0;
98
99#ifdef INK_ENABLE_STL
104 static snapshot* from_file(const char* filename);
109 void write_to_file(const char* filename) const;
110#endif
111};
112} // namespace ink::runtime
Container for an InkCPP runtime snapshot, which can be migrated.
Definition snapshot.h:75
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), for details see Migration.
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