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{
27{
28public:
29 virtual ~snapshot(){};
30
39 static snapshot* from_binary(const unsigned char* data, size_t length, bool freeOnDestroy = true);
40
42 virtual const unsigned char* get_data() const = 0;
44 virtual size_t get_data_len() const = 0;
46 virtual size_t num_runners() const = 0;
47
48#ifdef INK_ENABLE_STL
53 static snapshot* from_file(const char* filename);
58 void write_to_file(const char* filename) const;
59#endif
60};
61} // namespace ink::runtime
Container for an InkCPP runtime snapshot.
Definition snapshot.h:27
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
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
acces blob inside snapshot
Contaning all modules and classes used for the inkles ink runtime.
Definition choice.h:13