#pragma once
/***********************************************************
 Copyright (c) 2020 Qualcomm Technologies, Inc.
 All Rights Reserved.
 Confidential and Proprietary - Qualcomm Technologies, Inc.
************************************************************/

/**
 * ICallbackObjectExample demonstrates how we can implement a callback interface in the CA,
 * and use it from the TA to call code in the CA.
 */

/** @cond */

// AUTOGENERATED FILE: DO NOT EDIT

#include <cstdint>
#include "object.h"
#include "proxy_base.hpp"
#include "impl_base.hpp"
#include "ICallbackObjectExample.hpp"

class ICallbackObjectExampleImplBase : protected ImplBase, public IICallbackObjectExample {
   public:
    ICallbackObjectExampleImplBase() {}
    virtual ~ICallbackObjectExampleImplBase() {}

   protected:
    virtual int32_t invoke(ObjectOp op, ObjectArg* a, ObjectCounts k) {
        switch (ObjectOp_methodID(op)) {
            case OP_print: {
                if (k != ObjectCounts_pack(1, 0, 0, 0)) {
                    break;
                }
                const void* msg_ptr = (const void*)a[0].b.ptr;
                size_t msg_len = a[0].b.size / 1;
                return print(msg_ptr, msg_len);
            }
            default: { return Object_ERROR_INVALID; }
        }
        return Object_ERROR_INVALID;
    }
};

