<< Operator Overloading

Description

Appends tiling data using the << operator overloading mode. If the length of the appended tiling data exceeds the maximum, skip this operation.

Using the operator << to append tiling data is a more intuitive and convenient way to implement the same function as Append.

Prototype

template<typename T>

TilingData &operator<<(TilingData &out, const T &data)

Parameters

Parameter

Input/Output

Description

T

Input

Type of appended tiling data.

out

Output

Instance of the TilingData class.

data

Input

Appended tiling data instance.

Returns

TilingData object to which data has been appended

Restrictions

None

Example

auto td_buf = TilingData::CreateCap(100U);
auto td = reinterpret_cast<TilingData *>(td_buf.get());

struct AppendData{
  int a = 10;
  int b = 100;
};
AppendData ad;
(*td) << ad;
auto data_size = td.GetDataSize(); // 2 * sizeof(int)