Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add placeholder for internal data handling #1274

Open
wants to merge 2 commits into
base: user_data-interface
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/t8_data/t8_data_handler.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@ class t8_data_handler: public t8_abstract_data_handler {
return single_handler.type ();
}

bool
create_handle_for_internal_data (t8_abstract_data_handler * const handler, const int type)
{
switch (type) {
// Placeholder for future internal data, which is handled here.
default:
return false;
}
}

private:
/**
* \brief A shared pointer to a vector of data.
Expand Down
25 changes: 14 additions & 11 deletions test/t8_data/t8_pseudo_trees.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,21 @@ class t8_single_data_handler<pseudo_tree> {
mpiret = sc_MPI_Unpack (buffer, num_bytes, &pos, &type, 1, sc_MPI_INT, comm);
SC_CHECK_MPI (mpiret);

if (type == 0) {
ihandler = std::make_shared<t8_data_handler<enlarged_data<int>>> ();
if (!create_handle_for_internal_data (ihandler, type)) {

if (type == 0) {
ihandler = std::make_shared<t8_data_handler<enlarged_data<int>>> ();
}
else if (type == 1) {
ihandler = std::make_shared<t8_data_handler<enlarged_data<double>>> ();
}
else {
SC_ABORT_NOT_REACHED ();
}

int outcount = 0;
ihandler->unpack_vector_prefix (buffer, num_bytes, pos, outcount, comm);
}
else if (type == 1) {
ihandler = std::make_shared<t8_data_handler<enlarged_data<double>>> ();
}
else {
SC_ABORT_NOT_REACHED ();
}

int outcount = 0;
ihandler->unpack_vector_prefix (buffer, num_bytes, pos, outcount, comm);
}
}

Expand Down