Skip to content

Commit

Permalink
Fix component paths
Browse files Browse the repository at this point in the history
  • Loading branch information
vines26 committed Feb 9, 2024
1 parent 126f50a commit 77fc587
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions source/plugin-loading/ComponentPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ void ComponentPlugin::initEncoding() {
std::shared_ptr<ITransportComponent>
ComponentPlugin::createTransport(const std::string &name, ITransportSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) {
PluginConfig &pluginConfig) {
TRACE_METHOD(path, name);
initTransport();
pluginConfig.pluginDirectory = fs::path(path).parent_path().string();
pluginConfig.pluginDirectory = path;
ITransportComponent *transport =
createTransportImpl(name.c_str(), sdk, roleName.c_str(), pluginConfig);
return std::shared_ptr<ITransportComponent>(transport, destroyTransportImpl);
Expand All @@ -70,10 +70,10 @@ ComponentPlugin::createTransport(const std::string &name, ITransportSdk *sdk,
std::shared_ptr<IUserModelComponent>
ComponentPlugin::createUserModel(const std::string &name, IUserModelSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) {
PluginConfig &pluginConfig) {
TRACE_METHOD(path, name);
initUserModel();
pluginConfig.pluginDirectory = fs::path(path).parent_path().string();
pluginConfig.pluginDirectory = path;
return std::shared_ptr<IUserModelComponent>(
createUserModelImpl(name.c_str(), sdk, roleName.c_str(), pluginConfig),
destroyUserModelImpl);
Expand All @@ -82,10 +82,10 @@ ComponentPlugin::createUserModel(const std::string &name, IUserModelSdk *sdk,
std::shared_ptr<IEncodingComponent>
ComponentPlugin::createEncoding(const std::string &name, IEncodingSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) {
PluginConfig &pluginConfig) {
TRACE_METHOD(path, name);
initEncoding();
pluginConfig.pluginDirectory = fs::path(path).parent_path().string();
const std::string pluginPath = path;
return std::shared_ptr<IEncodingComponent>(
createEncodingImpl(name.c_str(), sdk, roleName.c_str(), pluginConfig),
destroyEncodingImpl);
Expand Down
6 changes: 3 additions & 3 deletions source/plugin-loading/ComponentPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ struct ComponentPlugin : public IComponentPlugin {
virtual std::shared_ptr<ITransportComponent>
createTransport(const std::string &name, ITransportSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) override;
PluginConfig &pluginConfig) override;
virtual std::shared_ptr<IUserModelComponent>
createUserModel(const std::string &name, IUserModelSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) override;
PluginConfig &pluginConfig) override;
virtual std::shared_ptr<IEncodingComponent>
createEncoding(const std::string &name, IEncodingSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) override;
PluginConfig &pluginConfig) override;

virtual std::string get_path() override;

Expand Down
6 changes: 3 additions & 3 deletions source/plugin-loading/IComponentPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ struct IComponentPlugin {
virtual std::shared_ptr<ITransportComponent>
createTransport(const std::string &name, ITransportSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) = 0;
PluginConfig &pluginConfig) = 0;
virtual std::shared_ptr<IUserModelComponent>
createUserModel(const std::string &name, IUserModelSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) = 0;
PluginConfig &pluginConfig) = 0;
virtual std::shared_ptr<IEncodingComponent>
createEncoding(const std::string &name, IEncodingSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) = 0;
PluginConfig &pluginConfig) = 0;
virtual std::string get_path() = 0;
};

Expand Down
12 changes: 6 additions & 6 deletions source/plugin-loading/PythonComponentPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ PythonComponentPlugin::PythonComponentPlugin(

std::shared_ptr<ITransportComponent> PythonComponentPlugin::createTransport(
const std::string &name, ITransportSdk *sdk, const std::string &roleName,
const PluginConfig &pluginConfig) {
PluginConfig &pluginConfig) {
TRACE_METHOD(path, name);
initPython("", pythonModulePath, pythonShimsPath);
pluginConfig.pluginDirectory = fs::path(path).string();
pluginConfig.pluginDirectory = path;
return std::shared_ptr<ITransportComponent>(
static_cast<ITransportComponent *>(createPythonComponentPlugin(
FUNC_CREATE_TRANSPORT, path, pythonModule, SDK_TYPE_TRANSPORT,
Expand All @@ -162,10 +162,10 @@ std::shared_ptr<ITransportComponent> PythonComponentPlugin::createTransport(

std::shared_ptr<IUserModelComponent> PythonComponentPlugin::createUserModel(
const std::string &name, IUserModelSdk *sdk, const std::string &roleName,
const PluginConfig &pluginConfig) {
PluginConfig &pluginConfig) {
TRACE_METHOD(path, name);
initPython("", pythonModulePath, pythonShimsPath);
pluginConfig.pluginDirectory = fs::path(path).string();
pluginConfig.pluginDirectory = path;
return std::shared_ptr<IUserModelComponent>(
static_cast<IUserModelComponent *>(createPythonComponentPlugin(
FUNC_CREATE_USER_MODEL, path, pythonModule, SDK_TYPE_USER_MODEL,
Expand All @@ -175,10 +175,10 @@ std::shared_ptr<IUserModelComponent> PythonComponentPlugin::createUserModel(

std::shared_ptr<IEncodingComponent> PythonComponentPlugin::createEncoding(
const std::string &name, IEncodingSdk *sdk, const std::string &roleName,
const PluginConfig &pluginConfig) {
PluginConfig &pluginConfig) {
TRACE_METHOD(path, name);
initPython("", pythonModulePath, pythonShimsPath);
pluginConfig.pluginDirectory = fs::path(path).string();
pluginConfig.pluginDirectory = path;
return std::shared_ptr<IEncodingComponent>(
static_cast<IEncodingComponent *>(createPythonComponentPlugin(
FUNC_CREATE_ENCODING, path, pythonModule, SDK_TYPE_ENCODING,
Expand Down
6 changes: 3 additions & 3 deletions source/plugin-loading/PythonComponentPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ struct PythonComponentPlugin : public IComponentPlugin {
virtual std::shared_ptr<ITransportComponent>
createTransport(const std::string &name, ITransportSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) override;
PluginConfig &pluginConfig) override;
virtual std::shared_ptr<IUserModelComponent>
createUserModel(const std::string &name, IUserModelSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) override;
PluginConfig &pluginConfig) override;
virtual std::shared_ptr<IEncodingComponent>
createEncoding(const std::string &name, IEncodingSdk *sdk,
const std::string &roleName,
const PluginConfig &pluginConfig) override;
PluginConfig &pluginConfig) override;

virtual std::string get_path() override;

Expand Down

0 comments on commit 77fc587

Please sign in to comment.