Homogeneous table
Refer to Developer Guide: Homogeneous table.
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 forDatatype: contiguous for floating-point, ordinal for integer types. TheDatatype should be at leastfloat,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.
- template<typenameData>statichomogen_tablewrap(constdal::array<Data> &data, std::int64_trow_count, std::int64_tcolumn_count, data_layoutlayout= data_layout::row_major)
- Creates a newhomogen_tableinstance from an array. The created table shares data ownership with the given array.
- 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 forDatatype: contiguous for floating-point, ordinal for integer types. TheDatatype should be at leastfloat,doubleorstd::int32_t.
- Parameters
- data– The array that stores 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.
- Casts an object of the base table type to a homogen table. If cast is not possible, the operation is equivalent to a default constructor call.
- 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. TheDatatype should be at leastfloat,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 theDatatype. No checks are performed that this type is the actual type of the data within the table. If table has no data, returnsnullptr.
- constvoid *get_data()const
- The pointer to the data block within the table. Should be equal tonullptrwhenrow_count == 0andcolumn_count == 0.
- std::int64_tget_kind()const
- The unique id of the homogen table type.