Commit 63746e7a authored by Uwe Woessner's avatar Uwe Woessner
Browse files

fixed spawnPoint creation


Signed-off-by: Uwe Woessner's avatarhpcwoess <woessner@hlrs.de>
parent a2e4d122
......@@ -103,7 +103,7 @@ std::unique_ptr<SpawnPoint> SpawnPointLibrary::CreateSpawnPoint(const SpawnPoint
}
}
std::unique_ptr<SpawnPointInterface> spawnPoint = nullptr;
SpawnPointInterface *spawnPoint = nullptr;
try
{
spawnPoint = createInstanceFunc(&dependencies, callbacks);
......@@ -124,6 +124,6 @@ std::unique_ptr<SpawnPoint> SpawnPointLibrary::CreateSpawnPoint(const SpawnPoint
return nullptr;
}
return std::make_unique<SpawnPoint>(dependencies.agentFactory, std::move(spawnPoint), this);
return std::make_unique<SpawnPoint>(dependencies.agentFactory, spawnPoint, this);
}
} // namespace SimulationSlave
......@@ -35,8 +35,10 @@ class SpawnPointLibrary
{
public:
typedef const std::string &(*SpawnPointInterface_GetVersion)();
typedef std::unique_ptr<SpawnPointInterface> (*SpawnPointInterface_CreateInstanceType)(const SpawnPointDependencies* dependencies,
const CallbackInterface* callbacks);
//typedef std::unique_ptr<SpawnPointInterface> (*SpawnPointInterface_CreateInstanceType)(const SpawnPointDependencies* dependencies,
// extern "C" can't return std::unique_ptr in msvc const CallbackInterface* callbacks);
typedef SpawnPointInterface* (*SpawnPointInterface_CreateInstanceType)(const SpawnPointDependencies *dependencies,
const CallbackInterface *callbacks);
SpawnPointLibrary(const std::string &libraryPath,
CallbackInterface *callbacks) :
......
......@@ -32,10 +32,10 @@ class SpawnPoint
{
public:
SpawnPoint(AgentFactoryInterface *agentFactory,
std::unique_ptr<SpawnPointInterface>&& implementation,
SpawnPointInterface* implementation,
SpawnPointLibrary *library) :
library(library),
implementation(std::move(implementation)),
implementation(implementation),
agentFactory(agentFactory)
{
LOG_INTERN(LogLevel::DebugCore) << "created spawn point " << id;
......@@ -77,7 +77,7 @@ public:
//-----------------------------------------------------------------------------
SpawnPointInterface* GetImplementation()
{
return implementation.get();
return implementation;
}
//-----------------------------------------------------------------------------
......@@ -92,7 +92,7 @@ public:
private:
SpawnPointLibrary *library;
std::unique_ptr<SpawnPointInterface> implementation;
SpawnPointInterface *implementation;
AgentFactoryInterface *agentFactory;
int id = 0;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment