nk
1.0.0
C++ Numerical Computing Runtime
Toggle main menu visibility
Loading...
Searching...
No Matches
standard_engine.hpp
1
// bundle/include/nk/bundle/standard_engine.hpp
2
//
3
// StandardEngine — an Engine with the standard library already installed, as a
4
// stack-constructible convenience:
5
//
6
// nk::StandardEngine engine; // ready to eval("sin(1)") etc.
7
//
8
// It is a thin subclass over the public installStandardLibrary() composition
9
// API — no new behaviour, just "construct + install" in one step. The three
10
// composition flavours (this, installStandardLibrary, makeStandardEngine) all
11
// live here in bundle/; core itself stays library-agnostic.
12
//
13
// Pulls in the full engine.hpp (needed to subclass Engine); embedders who only
14
// want the free function include the lighter standard_library.hpp instead.
15
16
#pragma once
17
18
#include <
nk/bundle/standard_library.hpp
>
19
#include <nk/core/engine.hpp>
20
21
#include <memory_resource>
22
23
namespace
nk {
24
25
struct
StandardEngine : Engine
26
{
27
StandardEngine() {
installStandardLibrary
(*
this
); }
28
explicit
StandardEngine(std::pmr::memory_resource *mr) : Engine(mr)
29
{
30
installStandardLibrary
(*
this
);
31
}
32
};
33
34
}
// namespace nk
nk::installStandardLibrary
void installStandardLibrary(Engine &engine)
Forwarder for backward compatibility.
Definition
standard_library.hpp:26
standard_library.hpp
src
bundle
include
nk
bundle
standard_engine.hpp
Generated by
1.17.0