Skip to content

Commit

Permalink
Support object Nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlie-Capps committed Oct 4, 2023
1 parent d717893 commit fe3f967
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/libs/conduit/conduit_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

#cmakedefine CONDUIT_USE_OPENMP

#cmakedefine CONDUIT_USE_TOTALVIEW

#endif


Expand Down
9 changes: 9 additions & 0 deletions src/libs/conduit/conduit_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
#include "conduit_node_iterator.hpp"
#include "conduit_utils.hpp"

#if defined(CONDUIT_USE_TOTALVIEW)
// forward declaration of debugger visualizer function
int TV_ttf_display_type ( const conduit::Node *n );
#endif


//-----------------------------------------------------------------------------
// -- begin conduit:: --
Expand Down Expand Up @@ -84,6 +89,10 @@ class CONDUIT_API Node
friend class NodeConstIterator;
friend class Generator;

#if defined(CONDUIT_USE_TOTALVIEW)
friend int ::TV_ttf_display_type ( const conduit::Node *n );
#endif

//-----------------------------------------------------------------------------
//
// -- begin declaration of Node construction and destruction --
Expand Down
13 changes: 6 additions & 7 deletions src/libs/conduit/debug/conduit_node_totalview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,18 @@ int TV_ttf_display_type ( const conduit::Node *n )
case conduit::DataType::OBJECT_ID:
{
const std::vector<std::string> & child_names = n->child_names();
const conduit::Schema & schema = n->schema();
for (const std::string & name : child_names) {
const conduit::Node * ptr = n->fetch_ptr(name);
TV_ttf_add_row (name.c_str(), "conduit::Node *", &ptr);
std::cout << "Added child " << name << " with pointer " << ptr << std::endl;
size_t cidx = (size_t)schema.child_index(name);
TV_ttf_add_row (name.c_str(), "conduit::Node *", &(n->m_children[cidx]));
}
break;
}
case conduit::DataType::LIST_ID:
{
int number_of_children = n->number_of_children();
for (int cidx = 0; cidx < number_of_children; ++cidx) {
const conduit::Node * ptr = n->child_ptr(cidx);
TV_ttf_add_row (index_to_TV_string(cidx).c_str(), "conduit::Node *", &ptr);
size_t number_of_children = (size_t)n->number_of_children();
for (size_t cidx = 0; cidx < number_of_children; ++cidx) {
TV_ttf_add_row (index_to_TV_string(cidx).c_str(), "conduit::Node *", &(n->m_children[cidx]));
}
break;
}
Expand Down

0 comments on commit fe3f967

Please sign in to comment.