35#include "src/jazz_elements/block.h"
38#ifndef INCLUDED_JAZZ_CATCH2
39#define INCLUDED_JAZZ_CATCH2
41#include "src/catch2/catch.hpp"
47#ifndef INCLUDED_JAZZ_ELEMENTS_KIND
48#define INCLUDED_JAZZ_ELEMENTS_KIND
96 if (idx < 0 || idx >=
size)
109 for (
int idx = 0; idx <
size; idx++) {
122 for (
int i = 0; i <
size; i++) {
125 for (
int j = 0; j < p_it_hea->
rank; j++) {
126 int k = p_it_hea->
dim[j];
131 dims.insert(std::string(pt));
149 if (num_items < 1 || num_items > MAX_ITEMS_IN_KIND)
150 return SERVICE_ERROR_WRONG_ARGUMENTS;
155 rq_sz += 2*att->size();
157 if (num_bytes < rq_sz)
158 return SERVICE_ERROR_NO_MEM;
170 return SERVICE_NO_ERROR;
197 if (idx < 0 || idx >=
size)
206 for (
int i = MAX_TENSOR_RANK - 1; i >= 0; i--) {
208 p_it_hea->
dim[i] = j;
216 if (p_dims ==
nullptr)
219 AttributeMap::iterator it = p_dims->find(j);
220 if (it == p_dims->end())
225 if (k <= STRING_EMPTY)
228 p_it_hea->
dim[i] = -k;
234 if (p_it_hea->
name <= STRING_EMPTY)
A block is a moveable BlockHeader followed by a Tensor and a StringBuffer.
Definition block.h:99
int get_string_offset(pStringBuffer psb, const char *p_str)
Definition block.cpp:128
pStringBuffer p_string_buffer()
Definition block.h:363
void set_attributes(AttributeMap *all_att)
Definition block.h:268
Kind: A type definition for Jazz Blocks and Tuples.
Definition kind.h:83
int audit()
Audit a Kind.
Definition kind.cpp:47
bool add_item(int idx, char const *p_name, int *p_dim, int cell_type, AttributeMap *p_dims)
Definition kind.h:191
int new_kind(int num_items, int num_bytes, AttributeMap *att=nullptr)
Definition kind.h:145
char * item_name(int idx)
Definition kind.h:95
void dimensions(Dimensions &dims)
Definition kind.h:121
int index(pChar name)
Definition kind.h:108
The namespace for Jazz Utils, Blocks, Kinds, Tuples, Containers, etc.
Definition block.cpp:39
std::set< std::string > Dimensions
An set::set with the dimension names returned by kind.dimensions()
Definition types.h:235
Kind * pKind
A pointer to a Kind object.
Definition kind.h:245
char * pChar
A pointer to a char buffer.
Definition types.h:185
std::map< int, const char * > AttributeMap
An stdlib map to store all the attributes of a Block at the same time used by the some Block methods.
Definition block.h:63
Structure at the end of a Block, initially created with init_string_buffer()
Definition types.h:282
char buffer[]
The buffer where strings are stored starting with two zeroes for STRING_NA & STRING_EMPTY.
Definition types.h:287
int dim[MAX_TENSOR_RANK]
Dimensions for the Tensor. The product of all * (cell_type & 0xff) < 2 Gb.
Definition types.h:193
ItemHeader cell_item[0]
.. An array of BlockHeader used by Kinds and Tuples
Definition types.h:231