Skip to content

Commit

Permalink
feat: Add getters to taskHandler (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiakiteaneo authored Jul 20, 2023
2 parents d932426 + c4b14b2 commit bb89fdf
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
47 changes: 47 additions & 0 deletions packages/cpp/ArmoniK.Api.Worker/header/Worker/TaskHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,53 @@ class TaskHandler {
*/
std::vector<std::string>
get_result_ids(std::vector<armonik::api::grpc::v1::agent::CreateResultsMetaDataRequest_ResultCreate> 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::byte>
*/
std::vector<std::byte> getPayload();
/**
* @brief Get the Data Dependencies object
*
* @return std::vector<std::byte>
*/
std::vector<std::byte> 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<std::string>
*/
google::protobuf::RepeatedPtrField<std::string> getExpectedResults();

/**
* @brief Get the Configuration object
*
* @return armonik::api::grpc::v1::Configuration
*/
armonik::api::grpc::v1::Configuration getConfiguration();
};

} // namespace API_WORKER_NAMESPACE
51 changes: 51 additions & 0 deletions packages/cpp/ArmoniK.Api.Worker/source/Worker/TaskHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,54 @@ API_WORKER_NAMESPACE::TaskHandler::get_result_ids(std::vector<CreateResultsMetaD

return result_ids;
}

/**
* @brief Get the Session Id object
*
* @return std::string
*/
std::string API_WORKER_NAMESPACE::TaskHandler::getSessionId() { return session_id_; }

/**
* @brief Get the Task Id object
*
* @return std::string
*/
std::string API_WORKER_NAMESPACE::TaskHandler::getTaskId() { return task_id_; }

/**
* @brief Get the Payload object
*
* @return std::vector<std::byte>
*/
std::vector<std::byte> API_WORKER_NAMESPACE::TaskHandler::getPayload() { return payload_; }

/**
* @brief Get the Data Dependencies object
*
* @return std::vector<std::byte>
*/
std::vector<std::byte> 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<std::string>
*/
google::protobuf::RepeatedPtrField<std::string> 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_; }

0 comments on commit bb89fdf

Please sign in to comment.