Debian Codegraph @

test cases/swift/13 mixed objcpp/mylib.mm

raw
1 #include "mylib.h"
2 #include <iostream>
3
4 Test::Test() {
5 std::cout << "Test initialized" << std::endl;
6 }
7
8 void Test::testCallFromClass() {
9 std::cout << "Calling Objective-C++ class function from Swift is working" << std::endl;
10 }
11
12 @implementation ObjCPPTest
13 - (id)init {
14 self = [super init];
15 if (self) {
16 test = new Test();
17 }
18 return self;
19 }
20
21 - (void)dealloc {
22 delete test;
23 [super dealloc];
24 }
25
26 - (void)testCallToObjCPP {
27 test->testCallFromClass();
28 }
29 @end