/*
 * Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
 * Copyright 2016 NXP
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

/*
 * Generated by erpcgen 1.14.0 on Wed May 28 10:34:56 2025.
 *
 * AUTOGENERATED - DO NOT EDIT
 */


#include <new>
#include "c_erpc_matrix_multiply_server.h"
#include "erpc_matrix_multiply_server.hpp"
#include "erpc_manually_constructed.hpp"

using namespace erpc;
using namespace std;
using namespace erpcShim;


class MatrixMultiplyService_server: public MatrixMultiplyService_interface
{
    public:
        virtual ~MatrixMultiplyService_server() {};


        void erpcMatrixMultiply(Matrix matrix1, Matrix matrix2, Matrix result_matrix)
        {
            ::erpcMatrixMultiply(matrix1, matrix2, result_matrix);
        }
};

ERPC_MANUALLY_CONSTRUCTED_STATIC(MatrixMultiplyService_service, s_MatrixMultiplyService_service);
ERPC_MANUALLY_CONSTRUCTED_STATIC(MatrixMultiplyService_server, s_MatrixMultiplyService_server);

erpc_service_t create_MatrixMultiplyService_service(void)
{
    erpc_service_t service;

#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    service = new (nothrow) MatrixMultiplyService_service(new (nothrow)MatrixMultiplyService_server());
#else
    if (s_MatrixMultiplyService_service.isUsed())
    {
        service = NULL;
    }
    else
    {
        s_MatrixMultiplyService_server.construct();
        s_MatrixMultiplyService_service.construct(s_MatrixMultiplyService_server.get());
        service = s_MatrixMultiplyService_service.get();
    }
#endif

    return service;
}

void destroy_MatrixMultiplyService_service(erpc_service_t service)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
    if (service)
    {
        delete (MatrixMultiplyService_server *)(((MatrixMultiplyService_service *)service)->getHandler());
        delete (MatrixMultiplyService_service *)service;
    }
#else
    (void)service;
    erpc_assert(service == s_MatrixMultiplyService_service.get());
    s_MatrixMultiplyService_service.destroy();
    s_MatrixMultiplyService_server.destroy();
#endif
}

