@@ -852,4 +852,122 @@ std::vector< Uint31_Index > relation_way_member_indices
852852}
853853
854854
855+ std::vector< Uint31_Index > relation_relation_member_indices
856+ (const Statement& stmt, Resource_Manager& rman,
857+ std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_begin,
858+ std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_end);
859+
860+
861+ std::vector< Uint31_Index > relation_relation_member_indices
862+ (const Statement& stmt, Resource_Manager& rman,
863+ std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_begin,
864+ std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_end,
865+ std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >::const_iterator attic_rels_begin,
866+ std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >::const_iterator attic_rels_end);
867+
868+
869+ std::set< std::pair< Uint32_Index, Uint32_Index > > collect_node_req
870+ (const Statement* stmt, Resource_Manager& rman,
871+ const std::vector< Node::Id_Type >& map_ids, const std::vector< uint32 >& parents);
872+
873+
874+ template < typename Relation_Skeleton >
875+ std::set< std::pair< Uint32_Index, Uint32_Index > > relation_node_member_indices
876+ (const Statement* stmt, Resource_Manager& rman,
877+ typename std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_begin,
878+ typename std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_end)
879+ {
880+ std::vector< uint32 > parents;
881+
882+ for (typename std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator
883+ it = rels_begin; it != rels_end; ++it)
884+ {
885+ if ((it->first .val () & 0x80000000 ) && ((it->first .val () & 0x3 ) == 0 ))
886+ {
887+ // Treat relations with really large indices: get the node indexes from the segement indexes
888+ for (typename std::vector< Relation_Skeleton >::const_iterator it2 = it->second .begin ();
889+ it2 != it->second .end (); ++it2)
890+ {
891+ for (std::vector< Uint31_Index >::const_iterator it3 = it2->node_idxs .begin ();
892+ it3 != it2->node_idxs .end (); ++it3)
893+ parents.push_back (it3->val ());
894+ }
895+ }
896+ else
897+ parents.push_back (it->first .val ());
898+ }
899+ if (stmt)
900+ rman.health_check (*stmt);
901+
902+ return collect_node_req (stmt, rman, std::vector< Node::Id_Type >(), parents);
903+ }
904+
905+
906+ template < typename Relation_Skeleton >
907+ std::set< std::pair< Uint32_Index, Uint32_Index > > relation_node_member_indices
908+ (const Statement* stmt, Resource_Manager& rman,
909+ typename std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_begin,
910+ typename std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator rels_end,
911+ typename std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >::const_iterator
912+ attic_rels_begin,
913+ typename std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >::const_iterator
914+ attic_rels_end)
915+ {
916+ std::vector< uint32 > parents;
917+
918+ for (typename std::map< Uint31_Index, std::vector< Relation_Skeleton > >::const_iterator
919+ it = rels_begin; it != rels_end; ++it)
920+ {
921+ if ((it->first .val () & 0x80000000 ) && ((it->first .val () & 0x3 ) == 0 ))
922+ {
923+ // Treat relations with really large indices: get the node indexes from the segement indexes
924+ for (typename std::vector< Relation_Skeleton >::const_iterator it2 = it->second .begin ();
925+ it2 != it->second .end (); ++it2)
926+ {
927+ for (std::vector< Uint31_Index >::const_iterator it3 = it2->node_idxs .begin ();
928+ it3 != it2->node_idxs .end (); ++it3)
929+ parents.push_back (it3->val ());
930+ }
931+ }
932+ else
933+ parents.push_back (it->first .val ());
934+ }
935+ for (typename std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >::const_iterator
936+ it = attic_rels_begin; it != attic_rels_end; ++it)
937+ {
938+ if ((it->first .val () & 0x80000000 ) && ((it->first .val () & 0x3 ) == 0 ))
939+ {
940+ // Treat relations with really large indices: get the node indexes from the segement indexes
941+ for (typename std::vector< Attic< Relation_Skeleton > >::const_iterator it2 = it->second .begin ();
942+ it2 != it->second .end (); ++it2)
943+ {
944+ for (std::vector< Uint31_Index >::const_iterator it3 = it2->node_idxs .begin ();
945+ it3 != it2->node_idxs .end (); ++it3)
946+ parents.push_back (it3->val ());
947+ }
948+ }
949+ else
950+ parents.push_back (it->first .val ());
951+ }
952+ if (stmt)
953+ rman.health_check (*stmt);
954+
955+ return collect_node_req (stmt, rman, std::vector< Node::Id_Type >(), parents);
956+ }
957+
958+
959+ std::set< std::pair< Uint32_Index, Uint32_Index > > way_nd_indices
960+ (const Statement* stmt, Resource_Manager& rman,
961+ std::map< Uint31_Index, std::vector< Way_Skeleton > >::const_iterator ways_begin,
962+ std::map< Uint31_Index, std::vector< Way_Skeleton > >::const_iterator ways_end);
963+
964+
965+ std::set< std::pair< Uint32_Index, Uint32_Index > > way_nd_indices
966+ (const Statement* stmt, Resource_Manager& rman,
967+ std::map< Uint31_Index, std::vector< Way_Skeleton > >::const_iterator ways_begin,
968+ std::map< Uint31_Index, std::vector< Way_Skeleton > >::const_iterator ways_end,
969+ std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >::const_iterator attic_ways_begin,
970+ std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >::const_iterator attic_ways_end);
971+
972+
855973#endif
0 commit comments