// Copyright 2020 Siemens Digital Industries Software
// ==================================================
// Copyright 2020.
// Siemens Digital Industry Software Inc.
// All Rights Reserved.
// ==================================================
// Copyright 2020 Siemens Digital Industries Software

/**
    @file

    Manufacturing Validation Check Adapter for ME
*/ 

/** 
   MfgValidationTestFrameworkAdapter

   Methods to adapt ITK parameters to mfg validation test framework parameters.
   Methods to adapt mfg validation test results to ITK validation test results.
   Methods to adapt mfg validation test results to SOA response form.
*/

#ifndef TEAMCENTER_ME_MfgValidationTestFrameworkAdapter_HXX
#define TEAMCENTER_ME_MfgValidationTestFrameworkAdapter_HXX 

#include <base_utils/TcBaseTypes.hxx>
#include <me/me.h>
#include <me/MfgValidationTestInterface.hxx>
#include <me/libme_exports.h>

/**
    @defgroup ME Manufacturing Process Planner (ME)
    @{
*/

namespace Teamcenter
{
    class MfgValidationTestFrameworkAdapter;
}


/**
    @name Manufacturing Validation Test Framework adapters 
    @{
*/


class ME_API Teamcenter::MfgValidationTestFrameworkAdapter
{

public:


    /**
     *   Adapts c style validation test arguments to c++ style validation test arguments.
     */
    static void adapt(
        const char * client_identifier,                 /**< (I)  The client identifier. */   
        const int     n_input_objects,                  /**< (I)  The number of input objects. */   
        const tag_t * input_objects,                    /**< (I)  List of input objects. */   
        const int     n_validation_test_names,          /**< (I)  The number of validation test names. */   
        const char ** validation_test_names,            /**< (I)  List of validation test names. */   
        const int     n_additional_info,                /**< (I)  The number of additional info. */   
        const char ** additional_info,                  /**< (I)  List of additional info. */   
        std::string & clientName,                       /**< (I)  The adapted client identifier. */   
        TagVector & inputObjects,                       /**< (O)  The input objects as a vector. */   
        std::vector<std::string> & validationTestNames, /**< (O)  The validation test names as a vector. */   
        std::vector<std::string> & additionalInfo       /**< (O)  The additional info as a vector. */   
        );

    /**
     *  Adapts c++ style validation results as c style validation results.
     */
    static void adapt(
        const TestedObjectToValidationResultsMap & validationTestResults,   /**< (I) The c++ validation test results. */
        int *  n_tested_objects,     /**< (O) The number of tested objects. */
        tag_t ** tested_objects,     /**< (O) n_tested_objects List of tested objects. */
        int * n_validation_results,  /**< (O) The number of validation test results. */
        ME_validation_test_result_t *** validation_results   /**< (OF) Two-dimensional array for the validation test results. The first dimension is @p n_tested_objects, and the second is @p n_validation_results.
                                                             <br/>The array is packed, which means that the memory needs to be deallocated by calling #MEM_free on the container only. */
    );

    /**
     *  Adapts c++ style validation result structure as c style validation result.
     */
    static void adapt(const ValidationTestResult & validationResult,  /**< (I) Validation Test Result Structure. */ 
                      std::vector<std::string> & resultsVector        /**< (O) Validation Test Result Structure as string vector. */
    );

    /**
     *  Adapts int style validation test result as C++ string.
     */
    static void adapt(int testResult,                /**< (I) The int style test result. */ 
                      std::string  & testResultStr   /**< (O) The string style test results. */
    );

    /**
     *  Adapts the int style message type as c++ string.
     */
    static void adaptMessageType(int messageType,  /**< (I) The int style message type. */
                std::string & messageTypeStr       /**< (O) The string style message type. */
    );

    /**
     *  Adapts c++ vector string of validation test names as space delimited list of validation test names.
     */
    static void adapt(const std::vector<std::string> & validationTestNamesVector,  /**< (I) Vector string of validation test names. */
                      char ** validationTestNamesPtr                               /**< (OF) Space delimited list of validation test names. */ 
    );

    /**
     *  Adapts c style validation test result struct as c++ style validation test result struct.
     */
    static void adapt(const ME_validation_test_result_t & validationResultIn,  /**< (I) The c style validation test result. */
                      ValidationTestResult & validationResultOut               /**< (O) The c++ style validation test result. */
    );

};

/** @} */

#include <me/libme_undef.h>
/** @} */
#endif
