Jazz 1.25.+
Loading...
Searching...
No Matches
core.h
1/* Jazz (c) 2018-2025 kaalam.ai (The Authors of Jazz), using (under the same license):
2
3 1. Biomodelling - The AATBlockQueue class (c) Jacques BasaldĂșa, 2009-2012 licensed
4 exclusively for the use in the Jazz server software.
5
6 Copyright 2009-2012 Jacques BasaldĂșa
7
8 2. BBVA - Jazz: A lightweight analytical web server for data-driven applications.
9
10 Copyright 2016-2017 Banco Bilbao Vizcaya Argentaria, S.A.
11
12 This product includes software developed at
13
14 BBVA (https://www.bbva.com/)
15
16 3. LMDB, Copyright 2011-2017 Howard Chu, Symas Corp. All rights reserved.
17
18 Licensed under http://www.OpenLDAP.org/license.html
19
20
21 Licensed under the Apache License, Version 2.0 (the "License");
22 you may not use this file except in compliance with the License.
23 You may obtain a copy of the License at
24
25 http://www.apache.org/licenses/LICENSE-2.0
26
27 Unless required by applicable law or agreed to in writing, software
28 distributed under the License is distributed on an "AS IS" BASIS,
29 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 See the License for the specific language governing permissions and
31 limitations under the License.
32*/
33
34
35#include "src/jazz_bebop/bop.h"
36
37#if defined CATCH_TEST
38#ifndef INCLUDED_JAZZ_CATCH2
39#define INCLUDED_JAZZ_CATCH2
40
41#include "src/catch2/catch.hpp"
42
43#endif
44#endif
45
46
47#ifndef INCLUDED_JAZZ_BEBOP_CORE
48#define INCLUDED_JAZZ_BEBOP_CORE
49
50
51//TODO: Design Compiler relations with the services it owns, especially Fields/Snippets and how Core uses it.
52//TODO: Design Core how it connects to API and uses everything else.
53
54
60namespace jazz_bebop
61{
62
63using namespace jazz_elements;
64
65
93class Core : public BaseAPI {
94
95//TODO: Synchronize http://localhost:8888/jazz_reference/api_ref_core.html (Erase this only when Core is done.)
96//TODO: Use SNIPPET_STORAGE_ENTITY
97//TODO: Use ONNXRT_MAX_NUM_SESSIONS
98
99 public:
100
101 Core(pLogger a_logger, pConfigFile a_config, pChannels a_channels, pVolatile a_volatile, pPersisted a_persisted);
102 ~Core();
103
104 virtual pChar const id();
105
106 StatusCode start ();
108
110
111 // API Container interface: (see docstring)
112
113 virtual StatusCode new_entity (pChar p_where);
114 virtual StatusCode new_entity (Locator &where);
115 virtual StatusCode put (pChar p_where,
116 pBlock p_block,
117 int mode = WRITE_AS_BASE_DEFAULT);
118 virtual StatusCode put (Locator &where,
119 pBlock p_block,
120 int mode = WRITE_AS_BASE_DEFAULT);
121 virtual StatusCode remove (pChar p_where);
122 virtual StatusCode remove (Locator &where);
123 virtual StatusCode header (StaticBlockHeader &hea,
124 pChar p_what);
125 virtual StatusCode header (pTransaction &p_txn,
126 pChar p_what);
127 virtual StatusCode header (StaticBlockHeader &hea,
128 Locator &what);
129 virtual StatusCode header (pTransaction &p_txn,
130 Locator &what);
131 virtual StatusCode get (pTransaction &p_txn,
132 pChar p_what);
133 virtual StatusCode get (pTransaction &p_txn,
134 pChar p_what,
135 pBlock p_row_filter);
136 virtual StatusCode get (pTransaction &p_txn,
137 pChar p_what,
138 pChar name);
139 virtual StatusCode get (pTransaction &p_txn,
140 Locator &what);
141 virtual StatusCode get (pTransaction &p_txn,
142 Locator &what,
143 pBlock p_row_filter);
144 virtual StatusCode get (pTransaction &p_txn,
145 Locator &what,
146 pChar name);
147 virtual StatusCode exec (pTransaction &p_txn,
148 Locator &function,
149 pTuple p_args);
150 virtual StatusCode modify (Locator &function,
151 pTuple p_args);
152
153 private:
154
158};
159typedef Core *pCore;
160
161
162#ifdef CATCH_TEST
163
164// Instancing Core
165// -----------------
166
167extern Core COR;
168
169#endif
170
171} // namespace jazz_bebop
172
173#endif // ifndef INCLUDED_JAZZ_BEBOP_CORE
BaseAPI: The parent of API and Core.
Definition base_api.h:121
Bop: The Bebop compiler and decompiler.
Definition bop.h:59
Core: The execution unit is now a wrapper around onnx-runtime.
Definition core.h:93
virtual StatusCode get(pTransaction &p_txn, pChar p_what)
Definition core.cpp:205
void base_names(BaseNames &base_names)
Definition core.cpp:112
StatusCode start()
Definition core.cpp:82
Fields fields
The fields.
Definition core.h:156
DataSpaces data_spaces
The data spaces.
Definition core.h:155
StatusCode shut_down()
Definition core.cpp:99
virtual StatusCode modify(Locator &function, pTuple p_args)
Definition core.cpp:261
virtual StatusCode remove(pChar p_where)
Definition core.cpp:157
virtual pChar const id()
Definition core.cpp:72
virtual StatusCode new_entity(pChar p_where)
Definition core.cpp:125
Bop bop
The Bop compiler.
Definition core.h:157
virtual StatusCode exec(pTransaction &p_txn, Locator &function, pTuple p_args)
Definition core.cpp:253
virtual StatusCode put(pChar p_where, pBlock p_block, int mode=WRITE_AS_BASE_DEFAULT)
Definition core.cpp:141
virtual StatusCode header(StaticBlockHeader &hea, pChar p_what)
Definition core.cpp:173
DataSpaces: The data space.
Definition data_spaces.h:70
Fields: A Space for Snippets.
Definition fields.h:63
Channels: A Container doing block transactions across media (files, folders, shell,...
Definition channel.h:227
A configuration file as a key/value store.
Definition utils.h:217
A simple logger.
Definition utils.h:245
Persisted: A Service to manage data objects in LMDB.
Definition persisted.h:93
Tuple: A Jazz Block with multiple Tensors.
Definition tuple.h:94
Volatile: A Service to manage data objects in RAM.
Definition volatile.h:244
A language to access any container by base using locators.
Definition base_api.cpp:39
Core * pCore
A pointer to a Core.
Definition core.h:159
The namespace for Jazz Utils, Blocks, Kinds, Tuples, Containers, etc.
Definition block.cpp:39
char * pChar
A pointer to a char buffer.
Definition types.h:185
class Block * pBlock
A (forward defined) pointer to a Block.
Definition block.h:66
std::map< std::string, pContainer > BaseNames
A map of names for the containers (or structure engines like "map" or "tree" inside Volatile).
Definition container.h:152
int StatusCode
Type returned by the Service API.
Definition utils.h:141
Locator: A minimal structure to define the location of resources inside a Container.
Definition container.h:184
A Binary Compatible BlockHeader without Index (and therefore constructors/destructors)
Definition types.h:265
Transaction: A wrapper over a Block that defines the communication of a block with a Container.
Definition container.h:162