How would you call the following

J

John Doe

Hi,

Let's say I have a C interface with some exported function like :

zmlInit();
zmlFunc();

and I wrapper all this function to a c++ object ZmlAdapter with the same
method

ZML_API Ret_t zmlInit( VoidPtr_t& a_pHandle )
{
Ret_t nRet = ZML_ERR_OK;

ZmlAdapter* pZmlAdapter = new ZmlAdapter();

a_pHandle = pZmlAdapter ;

return nRet;
}


ZML_API Ret_t zmlFuncA( VoidPtr_t a_pHandle )
{
Ret_t nRet = ZML_ERR_OK;

ZmlAdapter* pZmlAdapter = reinterpret_cast<ZmlAdapter*>(a_pHandle);


pZmlAdapter->FuncA
return nRet;
}



Could I call it a proxy ?
 
P

Pascal J. Bourguignon

John Doe said:
Hi,

Let's say I have a C interface with some exported function like :

zmlInit();
zmlFunc();

and I wrapper all this function to a c++ object ZmlAdapter with the
same method

ZML_API Ret_t zmlInit( VoidPtr_t& a_pHandle )
{
Ret_t nRet = ZML_ERR_OK;

ZmlAdapter* pZmlAdapter = new ZmlAdapter();

a_pHandle = pZmlAdapter ;

return nRet;
}


ZML_API Ret_t zmlFuncA( VoidPtr_t a_pHandle )
{
Ret_t nRet = ZML_ERR_OK;

ZmlAdapter* pZmlAdapter = reinterpret_cast<ZmlAdapter*>(a_pHandle);


pZmlAdapter->FuncA
return nRet;
}



Could I call it a proxy ?

A C wrapper.

The wrapper is the C function that wraps around the C++ code.
You didn't wrapped all these C functions, you wrapped the C++ object
ZmlAdapter with these C functions.

A wrapper, like the real thing, is a thin layer around an existing
object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top