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{
59{
60public:
61 virtual ~snapshot(){};
62
71 static snapshot* from_binary(const unsigned char* data, size_t length, bool freeOnDestroy = true);
72
74 virtual const unsigned char* get_data() const = 0;
76 virtual size_t get_data_len() const = 0;
78 virtual size_t num_runners() const = 0;
81 virtual bool can_be_migrated() const = 0;
82
83#ifdef INK_ENABLE_STL
88 static snapshot* from_file(const char* filename);
93 void write_to_file(const char* filename) const;
94#endif
95};
96} // namespace ink::runtime
Container for an InkCPP runtime snapshot, which can be migrated.
Definition snapshot.h:59
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