diff --git a/resource/reapi/bindings/c++/reapi_cli.hpp b/resource/reapi/bindings/c++/reapi_cli.hpp index 10b67aeea..66cd2efba 100644 --- a/resource/reapi/bindings/c++/reapi_cli.hpp +++ b/resource/reapi/bindings/c++/reapi_cli.hpp @@ -72,6 +72,8 @@ class resource_query_t { const std::shared_ptr &get_job (const uint64_t jobid); const bool reservation_exists (const uint64_t jobid); const bool allocation_exists (const uint64_t jobid); + const unsigned int preorder_count (); + const unsigned int postorder_count (); /* Mutators */ void clear_resource_query_err_msg (); @@ -142,7 +144,9 @@ class reapi_cli_t : public reapi_t { static int info (void *h, const uint64_t jobid, std::string &mode, bool &reserved, int64_t &at, double &ov); static int info (void *h, const uint64_t jobid, - std::shared_ptr &job); + std::shared_ptr &job); + static unsigned int preorder_count (void *h); + static unsigned int postorder_count (void *h); static int stat (void *h, int64_t &V, int64_t &E,int64_t &J, double &load, double &min, double &max, double &avg); static const std::string &get_err_message (); diff --git a/resource/reapi/bindings/c++/reapi_cli_impl.hpp b/resource/reapi/bindings/c++/reapi_cli_impl.hpp index feb3dbc5c..5e3796839 100644 --- a/resource/reapi/bindings/c++/reapi_cli_impl.hpp +++ b/resource/reapi/bindings/c++/reapi_cli_impl.hpp @@ -263,6 +263,20 @@ int reapi_cli_t::info (void *h, const uint64_t jobid, return 0; } +unsigned int reapi_cli_t::preorder_count (void *h) +{ + resource_query_t *rq = static_cast (h); + + return rq->preorder_count (); +} + +unsigned int reapi_cli_t::postorder_count (void *h) +{ + resource_query_t *rq = static_cast (h); + + return rq->postorder_count (); +} + int reapi_cli_t::stat (void *h, int64_t &V, int64_t &E,int64_t &J, double &load, double &min, double &max, double &avg) { @@ -634,6 +648,16 @@ const bool resource_query_t::reservation_exists (const uint64_t jobid) return reservations.find (jobid) != reservations.end (); } +const unsigned int resource_query_t::preorder_count () +{ + return traverser->get_total_preorder_count (); +} + +const unsigned int resource_query_t::postorder_count () +{ + return traverser->get_total_postorder_count (); +} + void resource_query_t::clear_resource_query_err_msg () { m_err_msg = "";