Homogeneous table
Class
homogen_table
is an implementation of a table type
for which the following is true:- The data within the table are dense and stored as one contiguous memory block.
- All the columns have the same data type.
Programming interface
All types and functions in this section are declared in the
oneapi::dal
namespace and be available via inclusion of the
oneapi/dal/table/homogen.hpp
header file.- classhomogen_table
- Public Static Methods
- staticstd::int64_tkind()
- Returns the unique id ofhomogen_tableclass.
- template<typenameData>statichomogen_tablewrap(constData *data_pointer, std::int64_trow_count, std::int64_tcolumn_count, data_layoutlayout= data_layout::row_major)
- Creates a newhomogen_tableinstance from externally-defined data block. Table object refers to the data but does not own it. The responsibility to free the data remains on the user side. Thedatashould point to thedata_pointermemory block.
- Template Parameters
- Data– The type of elements in the data block that will be stored into the table. The table initializes data types of metadata with this data type. The feature types should be set to default values for
type: contiguous for floating-point, ordinal for integer types. The
type should be at least
float,doubleorstd::int32_t. - Parameters
- data_pointer– The pointer to a homogeneous data block.
- row_count– The number of rows in the table.
- column_count– The number of columns in the table.
- layout– The layout of the data. Should bedata_layout::row_majorordata_layout::column_major.
Constructors- homogen_table()
- Creates a newhomogen_tableinstance with zero number of rows and columns. The is set to`homogen_table::kind()`. All the properties should be set to default values (see the Properties section).
- template<typenameData, typenameConstDeleter>homogen_table(constData *data_pointer, std::int64_trow_count, std::int64_tcolumn_count, ConstDeleter &&data_deleter, data_layoutlayout= data_layout::row_major)
- Creates a newhomogen_tableinstance from externally-defined data block. Table object owns the data pointer. Thedatashould point to thedata_pointermemory block.
- Template Parameters
- Data– The type of elements in the data block that will be stored into the table. The
type should be at least
float,doubleorstd::int32_t. - ConstDeleter– The type of a deleter called ondata_pointerwhen the last table that refers it is out of the scope.
- Parameters
- data_pointer– The pointer to a homogeneous data block.
- row_count– The number of rows in the table.
- column_count– The number of columns in the table.
- data_deleter– The deleter that is called on thedata_pointerwhen the last table that refers it is out of the scope.
- layout– The layout of the data. Should bedata_layout::row_majorordata_layout::column_major.
Public Methods- Returns thedatapointer cast to the
type. No checks are performed that this type is the actual type of the data within the table.
Properties- constvoid *data
- The pointer to the data block within the table. Should be equal tonullptrwhenrow_count == 0andcolumn_count == 0.
- Getter & Setter
const void * get_data() const
- std::int64_tkind
- The unique id of the homogen table type.
- Getter & Setter
std::int64_t get_kind() const