I need to write a wrapper class in objective c for C++ class.
I have referred the following Can't find standard C++ includes when using C++ class in Cocoa project and was able to get rid of the lexical or Preprocessor issue: 'vector' file not found issue.
However, I do not understand coverting a C++ methods which accept several parameters to objective c method.
Can someone please help me to do so ? What i want to do is to write a wrapper class for this http://breakfastquay.com/rubberband/code-doc/classRubberBand_1_1RubberBandStretcher.html#a0af91755d71eecfce5781f2cd759db85
I have tried to do so and followings are the method I am stuck with ...
// Wrapper.h
#import <Foundation/Foundation.h>
@interface Wrapper : NSObject {
void *myRubberBandStretcher;
}
#pragma mark - Member Functions
-(void)process:(const float)input samples:(size_t)samples final:(bool)final;
@end
/////////////////////////////////////////////////////////////////////////////////
//Wrapper.mm
#import "Wrapper.h"
#import "RubberBandStretcher.h"
@implementation Wrapper
-(id)init {
self = [super init];
if (self) {
myRubberBandStretcher = new RubberBand::RubberBandStretcher::RubberBandStretcher(44100, 2, 0, 1.0, 1.0);
}
return self;
}
-(void)process:(const float)input samples:(size_t)samples final:(bool)final {
static_cast<RubberBand::RubberBandStretcher *>(myRubberBandStretcher)->process(<#const float *const *input#>, <#size_t samples#>, <#bool final#>)
}