|
StatusCode | new_tuple (int num_items, pBlock blocks[], Name p_names[], int num_bytes, AttributeMap *att=nullptr) |
|
char * | item_name (int idx) |
|
int | index (pChar name) |
|
pBlock | get_block (int idx) |
|
bool | is_a (pKind kind) |
|
int | audit () |
|
void | set_dimensions (int *p_dim) |
|
void | get_dimensions (int *p_dim) |
|
bool | validate_index (int *p_idx) |
|
int | validate_offset (int offset) |
|
int | get_offset (int *p_idx) |
|
void | get_index (int offset, int *p_idx) |
|
char * | get_string (int *p_idx) |
|
char * | get_string (int offset) |
|
void | set_string (int *p_idx, const char *p_str) |
|
void | set_string (int offset, const char *p_str) |
|
char * | get_attribute (int attribute_id) |
|
void | set_attributes (AttributeMap *all_att) |
|
void | get_attributes (AttributeMap *all_att) |
|
void | init_string_buffer () |
|
bool | find_NAs_in_tensor () |
|
int * | align64bit (uintptr_t ipt) |
| Align a pointer (as uintptr_t) to the next 8 byte boundary assuming the block is aligned.
|
|
int * | p_attribute_keys () |
|
pStringBuffer | p_string_buffer () |
|
int | get_string_offset (pStringBuffer psb, const char *p_str) |
|
bool | is_a_filter () |
| Check (in depth) the validity of a filter.
|
|
bool | can_filter (pBlock p_block) |
|
void | close_block (int set_has_NA=SET_HAS_NA_FALSE, bool set_hash=true, bool set_time=true) |
|
bool | check_hash () |
|
Tuple: A Jazz Block with multiple Tensors.
Can be simplified as "An instance of a **Kind**" although that is not exactly what it is. It is an array of Tensors and it can match one or more Kinds if its .is_a(<kind>) method returns true.
Physically, like a Kind, it is a single block with some differences:
- It holds data and metadata.
- It has constant values for the dimensions.
- It has a one step creation process: new_tuple().
- It also stores all the Blocks "as is" in the same space (after its header, vector of CELL_TYPE_KIND_ITEM, attribute keys and StringBuffer)
- The data stored &tensor is the metadata (like in a Kind) and the method .block(item) returns a pointer to each Block.
- A Tuple is a Block of type CELL_TYPE_TUPLE_ITEM (instead of CELL_TYPE_KIND_ITEM).
- The StringBuffer contains the item names and Tuple attributes. Blocks may have their own StringBuffers
Also, Tuples should define, if the Container sets them as expected, the attribute:
- BLOCK_ATTRIB_BLOCKTYPE as the const "Tuple"
Creating Tuples
More advanced Tuple functionalities (including other ways of creating tuples) can be done by Containers. This class, has a minimum functionality to build Tuples: new_tuple() to do the basic building. It does not includes creating Tuples from other Tuples by appending the names.
Using Tuples
Like any Block, it is a moveable structure that can be edited by this class. Channel-wise, Volatile, Persistence or via the http API, it is just a Block. Note:
- It has a new method, .block(item), that returns the address of an item.
- It has an is_a() method that verifies if it satisfies a Kind.
- It has an audit() method to check validity.
- Besides that, it is just a "big Block" whose header has a total_bytes that includes all the metadata and data.