Space: The abstract space. More...
#include <space.h>
Public Member Functions | |
Space (pBaseAPI api, pName a_name) | |
Bop: Create the Space. | |
virtual StatusCode | start () |
virtual StatusCode | shut_down () |
virtual StatusCode | load_meta () |
Load the metadata of the Space. | |
virtual StatusCode | save_meta () |
Save the metadata of the Space. | |
virtual RowNumber | num_rows () |
Return the number of rows in the Space. | |
virtual void * | get_index_data (RowNumber row) |
Get a pointer to the data of the index of a given row. | |
virtual int | num_cols () |
Get the number of columns in the Space. | |
virtual pName | col_name (int col) |
Get the name of a column. | |
virtual int | col_index (pName name) |
Get the index of a column. | |
virtual pLocator | locator (RowNumber row, int col, int &index) |
Get the location of a cell as a Locator. | |
virtual pRowSelection | where (pChar query) |
Get a RowSelection from a query. | |
virtual pColSelection | select (pChar query) |
Get a ColSelection from a query. | |
virtual pCaster | as (pChar query) |
Get the appropriate Caster from the AS clause of a query. | |
virtual bool | register_caster (pCaster cast) |
Register a Caster descendant to make it available in queries. | |
virtual StatusCode | get_row (pTransaction &p_txn, RowNumber row, pColSelection cols=nullptr, pCaster cast=nullptr) |
Get a row from the Space as a Tuple. | |
![]() | |
Service (pLogger a_logger, pConfigFile a_config) | |
virtual pChar const | id () |
void | log (int loglevel, const char *message) |
void | log_printf (int loglevel, const char *fmt,...) |
bool | get_conf_key (const char *key, int &value) |
bool | get_conf_key (const char *key, double &value) |
bool | get_conf_key (const char *key, std::string &value) |
Protected Attributes | |
char | storage_base [SHORT_NAME_SIZE] |
The base name of the storage container. | |
Name | name |
The name of the Space. | |
pBaseAPI | p_api |
A pointer to the BaseAPI that provides access to containers. | |
Casters | casters |
A map of all the available Casters. | |
Additional Inherited Members | |
![]() | |
pLogger | p_log |
The logger. | |
pConfigFile | p_conf |
The configuration file. | |
Space: The abstract space.
This is the abstract parent of DataSpaces, Fields/SemSpaces and Snippet/Concept. A Space is an abstraction over many blocks that provides:
Through inheritance, it provides su things as:
The class Space is mostly empty. It provides the parent virtual interface and the parents of all the auxiliary classes used to access data.
|
virtual |
Starts the Space service
Reimplemented from jazz_elements::Service.
|
virtual |
Shuts down the Space Service
Reimplemented from jazz_elements::Service.
|
inlinevirtual |
Load the metadata of the Space.
This method must be implemented by descendants. It will load a record of metadata from //storage_base/storage_ent/name
.
|
inlinevirtual |
Save the metadata of the Space.
This method must be implemented by descendants. It will store a record of metadata into //storage_base/storage_ent/name
.
|
inlinevirtual |
|
inlinevirtual |
Get a pointer to the data of the index of a given row.
row | The row number. |
|
inlinevirtual |
|
inlinevirtual |
Get the name of a column.
col | The column index. |
|
inlinevirtual |
Get the index of a column.
name | The name of the column. |
Get the location of a cell as a Locator.
row | The row number. |
col | The column index. |
index | If the block contains multiple rows, which is the index of row in the block. |
|
inlinevirtual |
Get a RowSelection from a query.
query | A query string that is understood by the descendant. In Bop, this is the content of a WHERE clause with a syntax that depends on how the Space is indexed (Time, categorical, Embedding storage, ...). |
|
inlinevirtual |
Get a ColSelection from a query.
query | By default, a list of comma separated column names. Spaces that use descendants of ColSelection may define a different interface. |
|
inlinevirtual |
|
inlinevirtual |
Get a row from the Space as a Tuple.
p_txn | A transaction that will be used to get the result. It must be destroyed with: p_txn->p_owner->destroy_transaction(p_txn) |
row | The row number as obtained from a RowSelection.next() call. |
cols | Pointer to a ColSelection to specify columns to be retrieved. If nullptr, all columns are retrieved. |
cast | Pointer to a Caster to convert the result. If nullptr, no conversion is done. |