Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm writting a Wrapper and I have some doubts. I don't know how to wrap some methods

First, I have to types of classes, static and non static. The non static classes have a two static methods to obtain an instance of the class and destroy it. Like this:

C#
static ThisClass *GetDecoder();
static void DestroyDecoder();


And then a lot of methods to wrap and I don't know how to wrap the next:

C#
float* GetColorIRTransform();
bool Get3DPointOnIR(double x, double y, double z, bool runDistort, double &irX, double &irY);
DecoderInitStatus InitDecoder(DecoderType decoderType, const char *configFileName, const char *rigFileName, const char *colorRigFile);
Status StartDecoding(VideoStream *pStream, VideoStream *pStreamColor, PointCloud *&pPointCloud);
std::list<MantisVision::Image const*> GetDepthMapImageList();


DecoderInitStatus and DecoderTye are enums, Do I need to wrap too?

VideoStream, PointCloud and Image are other classes that I have to wrap, so in the wrapped class What class must I pass? VideoStream or WrappedVideoStream?.
Posted
Comments
[no name] 15-Jun-15 17:51pm    
How does DestroyDecoder know which decoder to destroy?

1 solution

You're creating a set of proxy classes.

http://www.oodesign.com/proxy-pattern.html[^]

I'm guessing the purpose is to allow the DLL to be used from .NET.

You don't need to wrap the enums but rather define equivalent enums for .NET.

To answer your last question, your wrapped class would expect wrappers to the other DLL classes.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900