Jazz 1.25.+
Loading...
Searching...
No Matches
casters.h
1/* Jazz (c) 2018-2026 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/objects.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_CASTERS
48#define INCLUDED_JAZZ_BEBOP_CASTERS
49
50
56namespace jazz_bebop
57{
58
67class Caster {
68 public:
69
75
83 virtual StatusCode get(pTransaction &p_txn, pBlock p_block) {
84 return SERVICE_NOT_IMPLEMENTED;
85 }
86
88};
89typedef Caster *pCaster;
90typedef std::map<stdName, pCaster> Casters;
91typedef Casters *pCasters;
92
93
94} // namespace jazz_bebop
95
96#endif // ifndef INCLUDED_JAZZ_BEBOP_CASTERS
BaseAPI: The parent of API and Core.
Definition base_api.h:122
Caster: An optional converter of the output.
Definition casters.h:67
virtual StatusCode get(pTransaction &p_txn, pBlock p_block)
Convert a block doing whatever the caster does.
Definition casters.h:83
Caster(pBaseAPI api)
The constructor for a Caster.
Definition casters.h:74
stdName name
The name of the Caster.
Definition casters.h:87
A wrapped Name that supports being stacked in an std::vector and used as a key in an std::map.
Definition std_wrap.h:62
A language to access any container by base using locators.
Definition base_api.cpp:39
Casters * pCasters
A pointer to a Casters.
Definition casters.h:91
std::map< stdName, pCaster > Casters
A map of Caster pointers.
Definition casters.h:90
Caster * pCaster
A pointer to a Caster.
Definition casters.h:89
class Block * pBlock
A (forward defined) pointer to a Block.
Definition block.h:66
int StatusCode
Type returned by the Service API.
Definition utils.h:141
Transaction: A wrapper over a Block that defines the communication of a block with a Container.
Definition container.h:162