35#include "src/jazz_bebop/base_api.h"
38#ifndef INCLUDED_JAZZ_CATCH2
39#define INCLUDED_JAZZ_CATCH2
41#include "src/catch2/catch.hpp"
47#ifndef INCLUDED_JAZZ_BEBOP_SPACE
48#define INCLUDED_JAZZ_BEBOP_SPACE
57#define SPACE_NOT_A_ROW 0xffffFFFFffffFFFE
58#define SPACE_ROW_STOP_ITERATOR 0xffffFFFFffffFFFF
77 strncpy(this->name,
name, NAME_SIZE);
78 this->name[NAME_LENGTH] = 0;
147 return SPACE_ROW_STOP_ITERATOR;
220 return SERVICE_NOT_IMPLEMENTED;
268 return SERVICE_NOT_IMPLEMENTED;
278 return SERVICE_NOT_IMPLEMENTED;
288 return SPACE_NOT_A_ROW;
408 return SERVICE_NOT_IMPLEMENTED;
BaseAPI: The parent of API and Core.
Definition base_api.h:121
Caster: An optional converter of the output.
Definition space.h:203
virtual StatusCode get(pTransaction &p_txn, pBlock p_block)
Convert a block doing whatever the caster does.
Definition space.h:219
Caster(pBaseAPI api)
The constructor for a Caster.
Definition space.h:210
stdName name
The name of the Caster.
Definition space.h:223
ColSelection: A selection of columns from a Space.
Definition space.h:162
virtual pName next_name()
ColSelection: Get the next column name.
Definition space.cpp:140
virtual bool restart()
ColSelection: Restart the iterator.
Definition space.cpp:113
stdNames name
The list of column names in the selection.
Definition space.h:189
virtual int next_index()
ColSelection: Get the next column index.
Definition space.cpp:127
std::vector< int > index
The list of column indices in the selection.
Definition space.h:190
int current_col
The index of the current column (the next to be retrieved).
Definition space.h:188
bool is_valid
True if the iterator was created by a successful query.
Definition space.h:182
RowSelection: An iterator over the rows of a Space.
Definition space.h:123
virtual RowNumber next()
Get the next row.
Definition space.h:146
RowSelection(pChar query, pSpace p_space)
The constructor for a RowSelection.
Definition space.h:132
virtual bool restart()
Restart the iterator.
Definition space.h:138
bool is_valid
True if the iterator was created by a successful query.
Definition space.h:150
Space: The abstract space.
Definition space.h:248
pBaseAPI p_api
A pointer to the BaseAPI that provides access to containers.
Definition space.h:417
virtual StatusCode load_meta()
Load the metadata of the Space.
Definition space.h:267
virtual pName col_name(int col)
Get the name of a column.
Definition space.h:318
virtual pRowSelection where(pChar query)
Get a RowSelection from a query.
Definition space.h:351
Casters casters
A map of all the available Casters.
Definition space.h:418
char storage_base[SHORT_NAME_SIZE]
The base name of the storage container.
Definition space.h:415
virtual StatusCode shut_down()
Definition space.cpp:195
virtual pColSelection select(pChar query)
Get a ColSelection from a query.
Definition space.h:363
virtual RowNumber num_rows()
Return the number of rows in the Space.
Definition space.h:287
Name name
The name of the Space.
Definition space.h:416
virtual bool register_caster(pCaster cast)
Register a Caster descendant to make it available in queries.
Definition space.h:388
virtual pCaster as(pChar query)
Get the appropriate Caster from the AS clause of a query.
Definition space.h:373
virtual int num_cols()
Get the number of columns in the Space.
Definition space.h:308
virtual int col_index(pName name)
Get the index of a column.
Definition space.h:328
virtual pLocator locator(RowNumber row, int col, int &index)
Get the location of a cell as a Locator.
Definition space.h:340
virtual void * get_index_data(RowNumber row)
Get a pointer to the data of the index of a given row.
Definition space.h:298
virtual StatusCode start()
Definition space.cpp:169
virtual StatusCode save_meta()
Save the metadata of the Space.
Definition space.h:277
virtual StatusCode get_row(pTransaction &p_txn, RowNumber row, pColSelection cols=nullptr, pCaster cast=nullptr)
Get a row from the Space as a Tuple.
Definition space.h:407
A wrapped Name that supports being stacked in an std::vector and used as a key in an std::map.
Definition space.h:67
bool operator==(const stdName &o) const
Operator name == o.name.
Definition space.h:95
Name name
The name.
Definition space.h:109
bool operator<(const stdName &o) const
Operator name < o.name.
Definition space.h:105
stdName(const stdName &name)
Copy constructor for stdName.
Definition space.h:85
stdName(const pChar &name)
Constructor from cChar.
Definition space.h:76
A Jazz Service is a globally instanced configurable object that may allocate RAM.
Definition utils.h:285
A language to access any container by base using locators.
Definition base_api.cpp:39
Casters * pCasters
A pointer to a Casters.
Definition space.h:227
std::map< stdName, pCaster > Casters
A map of Caster pointers.
Definition space.h:226
std::vector< stdName > stdNames
A vector of stdName.
Definition space.h:112
Caster * pCaster
A pointer to a Caster.
Definition space.h:225
RowSelection * pRowSelection
A pointer to a RowSelection.
Definition space.h:152
Space * pSpace
Forward definition of Space.
Definition space.h:62
ColSelection * pColSelection
A pointer to a ColSelection.
Definition space.h:192
uint64_t RowNumber
A row number in a Space.
Definition space.h:54
Name ColumnName
A column name in a Space.
Definition space.h:55
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
char Name[NAME_SIZE]
A short identifier used in Blocks, Containers and API.
Definition types.h:183
Name * pName
A pointer to a Name.
Definition types.h:184
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
Transaction: A wrapper over a Block that defines the communication of a block with a Container.
Definition container.h:162