-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexport.cpp
More file actions
39 lines (29 loc) · 982 Bytes
/
export.cpp
File metadata and controls
39 lines (29 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// libcachesim_python - libCacheSim Python bindings
// Copyright 2025 The libcachesim Authors. All rights reserved.
//
// Use of this source code is governed by a GPL-3.0
// license that can be found in the LICENSE file or at
// https://github.com/1a1a11a/libcachesim/blob/develop/LICENSE
#include "export.h"
#include "exception.h"
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
namespace libcachesim {
PYBIND11_MODULE(libcachesim_python, m) {
m.doc() = "libcachesim_python";
// NOTE(haocheng): can use decentralized interface holder to export all the
// methods if the codebase is large enough
export_cache(m);
export_admissioner(m);
export_reader(m);
export_analyzer(m);
export_misc(m);
// NOTE(haocheng): register exception to make it available in Python
register_exception(m);
#ifdef VERSION_INFO
m.attr("__version__") = MACRO_STRINGIFY(VERSION_INFO);
#else
m.attr("__version__") = "dev";
#endif
}
} // namespace libcachesim