From ff3d19e6fcd14e2f5d8525a8221e6131e6400ad8 Mon Sep 17 00:00:00 2001 From: ddiakiteaneo Date: Thu, 20 Jul 2023 15:14:08 +0200 Subject: [PATCH 1/2] Add getters to taskHandler --- .../header/Worker/TaskHandler.h | 47 ++++++++++++++ .../source/Worker/TaskHandler.cpp | 63 +++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h b/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h index 74aa2a0b3..88f3e6428 100644 --- a/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h +++ b/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h @@ -98,6 +98,53 @@ class TaskHandler { */ std::vector get_result_ids(std::vector results); + + /** + * @brief Get the Session Id object + * + * @return std::string + */ + std::string getSessionId(); + + /** + * @brief Get the Task Id object + * + * @return std::string + */ + std::string getTaskId(); + /** + * @brief Get the Payload object + * + * @return std::vector + */ + std::vector getPayload(); + /** + * @brief Get the Data Dependencies object + * + * @return std::vector + */ + std::vector getDataDependencies(); + + /** + * @brief Get the Task Options object + * + * @return armonik::api::grpc::v1::TaskOptions + */ + armonik::api::grpc::v1::TaskOptions getTaskOptions(); + + /** + * @brief Get the Expected Results object + * + * @return google::protobuf::RepeatedPtrField + */ + google::protobuf::RepeatedPtrField getExpectedResults(); + + /** + * @brief Get the Configuration object + * + * @return armonik::api::grpc::v1::Configuration + */ + armonik::api::grpc::v1::Configuration getConfiguration(); }; } // namespace API_WORKER_NAMESPACE diff --git a/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp b/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp index 133c59c5f..2969f5405 100644 --- a/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp +++ b/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp @@ -379,3 +379,66 @@ API_WORKER_NAMESPACE::TaskHandler::get_result_ids(std::vector + */ +std::vector API_WORKER_NAMESPACE::TaskHandler::getPayload(){ + return payload_; +} + +/** + * @brief Get the Data Dependencies object + * + * @return std::vector + */ +std::vector API_WORKER_NAMESPACE::TaskHandler::getDataDependencies(){ + return data_dependencies_; +} + +/** + * @brief Get the Task Options object + * + * @return armonik::api::grpc::v1::TaskOptions + */ +armonik::api::grpc::v1::TaskOptions API_WORKER_NAMESPACE::TaskHandler::getTaskOptions(){ + return task_options_; +} + +/** + * @brief Get the Expected Results object + * + * @return google::protobuf::RepeatedPtrField + */ +google::protobuf::RepeatedPtrField API_WORKER_NAMESPACE::TaskHandler::getExpectedResults(){ + return expected_result_; +} + +/** + * @brief Get the Configuration object + * + * @return armonik::api::grpc::v1::Configuration + */ +armonik::api::grpc::v1::Configuration API_WORKER_NAMESPACE::TaskHandler::getConfiguration(){ + return config_; +} \ No newline at end of file From c4b14b2a20ba5a40530492c74428f881c22a3137 Mon Sep 17 00:00:00 2001 From: ddiakiteaneo Date: Thu, 20 Jul 2023 15:20:04 +0200 Subject: [PATCH 2/2] Format --- .../header/Worker/TaskHandler.h | 28 +++++----- .../source/Worker/TaskHandler.cpp | 54 ++++++++----------- 2 files changed, 35 insertions(+), 47 deletions(-) diff --git a/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h b/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h index 88f3e6428..cf40a13b7 100644 --- a/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h +++ b/packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h @@ -101,48 +101,48 @@ class TaskHandler { /** * @brief Get the Session Id object - * - * @return std::string + * + * @return std::string */ std::string getSessionId(); /** * @brief Get the Task Id object - * - * @return std::string + * + * @return std::string */ std::string getTaskId(); /** * @brief Get the Payload object - * - * @return std::vector + * + * @return std::vector */ std::vector getPayload(); /** * @brief Get the Data Dependencies object - * - * @return std::vector + * + * @return std::vector */ std::vector getDataDependencies(); /** * @brief Get the Task Options object - * - * @return armonik::api::grpc::v1::TaskOptions + * + * @return armonik::api::grpc::v1::TaskOptions */ armonik::api::grpc::v1::TaskOptions getTaskOptions(); /** * @brief Get the Expected Results object - * - * @return google::protobuf::RepeatedPtrField + * + * @return google::protobuf::RepeatedPtrField */ google::protobuf::RepeatedPtrField getExpectedResults(); /** * @brief Get the Configuration object - * - * @return armonik::api::grpc::v1::Configuration + * + * @return armonik::api::grpc::v1::Configuration */ armonik::api::grpc::v1::Configuration getConfiguration(); }; diff --git a/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp b/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp index 2969f5405..23d32a93b 100644 --- a/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp +++ b/packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp @@ -382,63 +382,51 @@ API_WORKER_NAMESPACE::TaskHandler::get_result_ids(std::vector + * + * @return std::vector */ -std::vector API_WORKER_NAMESPACE::TaskHandler::getPayload(){ - return payload_; -} +std::vector API_WORKER_NAMESPACE::TaskHandler::getPayload() { return payload_; } /** * @brief Get the Data Dependencies object - * - * @return std::vector + * + * @return std::vector */ -std::vector API_WORKER_NAMESPACE::TaskHandler::getDataDependencies(){ - return data_dependencies_; -} +std::vector API_WORKER_NAMESPACE::TaskHandler::getDataDependencies() { return data_dependencies_; } /** * @brief Get the Task Options object - * - * @return armonik::api::grpc::v1::TaskOptions + * + * @return armonik::api::grpc::v1::TaskOptions */ -armonik::api::grpc::v1::TaskOptions API_WORKER_NAMESPACE::TaskHandler::getTaskOptions(){ - return task_options_; -} +armonik::api::grpc::v1::TaskOptions API_WORKER_NAMESPACE::TaskHandler::getTaskOptions() { return task_options_; } /** * @brief Get the Expected Results object - * - * @return google::protobuf::RepeatedPtrField + * + * @return google::protobuf::RepeatedPtrField */ -google::protobuf::RepeatedPtrField API_WORKER_NAMESPACE::TaskHandler::getExpectedResults(){ +google::protobuf::RepeatedPtrField API_WORKER_NAMESPACE::TaskHandler::getExpectedResults() { return expected_result_; } /** * @brief Get the Configuration object - * - * @return armonik::api::grpc::v1::Configuration + * + * @return armonik::api::grpc::v1::Configuration */ -armonik::api::grpc::v1::Configuration API_WORKER_NAMESPACE::TaskHandler::getConfiguration(){ - return config_; -} \ No newline at end of file +armonik::api::grpc::v1::Configuration API_WORKER_NAMESPACE::TaskHandler::getConfiguration() { return config_; } \ No newline at end of file