I'm making an app in React-native that uses Djinni from dropbox to bridge between C++ and Javascript. Calling from Javascript to C++ works well but now I'm implementing Call from C++ to Java/ObjC, my C++ skills are so and so. So I'm stuck on initialising class method. I'm basing this on the example provided with Djinni. AnotherClassMain is the access point from Javascript to C++.
I want to call runAProcess method from processAImpl inside anotherClassMain.
But I get the error Field type 'aEditing::ProcessAImpl' is an abstract class On the line ProcesAImpl processA; in anotherClassMain.hpp
How can I access this initiate the class processAImpl and call the runAProcess from anotherClassMain ??
// processA.hpp created by djinni
#pragma once
#include <string>
namespace aEditing {
class ProcessA {
public:
virtual ~ProcessA() {}
virtual bool runThisProcess(const std::string & str) = 0;
};
}
//processAImpl.hpp
#pragma once
#include "processA.hpp"
namespace aEditing {
class ProcessAImpl : public ProcessA {
public:
ProcessAImpl(const std::shared_ptr<ProcessA> & listener);
void runAProcess(const std::string aCommand);
private:
std::shared_ptr<ProcessA> aProcess;
};
}
//processAImpl.cpp
#include "procesAImpl.hpp"
namespace aEditing {
ProcessAImpl::ProcessAImpl (const std::shared_ptr<ProcessA> & listener) {
this->aProcess = listener;
}
void ProcessAImpl::runAProcess(const std::string aCommand) {
this->aProcess->runThisProcess(aCommand);
}
}
//anotherClassMain.hpp
#pragma once
#include "includes.hpp"
#include "processAImpl.hpp"
namespace anotherProcessing {
class AnotherProcessingMain: public anotherProcessing::AnotherProcessing {
public:
AnotherProcessingMain();
string anotherProcessing(const std::string &Input, const std::string &output) override;
private:
ProcesAImpl processA;
};
}
//anotherClassMain.cpp
#include "anotherClassMain.hpp"
namespace anotherProcessing {
shared_ptr<AnotherProcessing> AnotherProcessing::create() {
return make_shared<AnotherProcessingMain>();
}
AnotherProcessingMain::AnotherProcessingMain() {}
string AnotherProcessingMain::anotherProcessing(const std::string &Input, const std::string &output){
processA.runAProcess("testCommand"); //Trying to access this!
return "yeah";
}