Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ParaView ParaView
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,961
    • Issues 1,961
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 99
    • Merge requests 99
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ParaViewParaView
  • ParaViewParaView
  • Issues
  • #20855
Closed
Open
Issue created Jul 27, 2021 by Francois Mazen@francois.mazenMaintainer

conduit_cpp::cpp_node creates a copy instead of a wrapper

When modify the conduit_cpp::Node created via conduit_cpp::cpp_node(conduit_node* n), then the original conduit_node is not modified. It seems that we are modifying a copy of the underlying conduit_node instead of pointing to the same data.

To reproduce:

  conduit_cpp::Node first_node;
  conduit_node* first_node_c_node = conduit_cpp::c_node(&first_node);
  conduit_cpp::Node second_node = conduit_cpp::cpp_node(first_node_c_node);
  second_node["test"] = 2;
  std::cout << "first_node:" << std::endl;
  first_node.print();
  std::cout << "second_node:" << std::endl;
  second_node.print();

produces this output:

first_node:
null
second_node:

{
  "test": 2
}

we expect the same values for first_node and second_node.

The same unwanted behavior could be reproduced using the C API:

  conduit_node* n = conduit_node_create();
  conduit_node* n2 = conduit_node_create();
  conduit_node_set_external_node(n2, n);
  conduit_node* child_node = conduit_node_fetch(n2, "test");
  conduit_node_set_int(child_node, 2);

  std::cout << "n:" << std::endl;
  conduit_node_print(n);
  std::cout << "n2:" << std::endl;
  conduit_node_print(n2);

Same output:

n:
null
n2:

{
  "test": 2
}

(In case of this is intended behavior, what method can create a real C++ wrapper of a conduit_node*?)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking