IceNavigatorFactory.cpp
Go to the documentation of this file.
2
3#include <algorithm>
4#include <iterator>
5#include <memory>
6#include <string>
7#include <vector>
8
10#include <Ice/Exception.h>
13
15#include <armarx/navigation/client/ice/NavigatorInterface.h>
20
22{
23
25
26 IceNavigatorFactory::IceNavigatorFactory(const NavigatorInterfacePrx& navigator) :
27 navigator(navigator)
28 {
29 // pass
30 }
31
36
37 void
38 IceNavigatorFactory::setNavigatorComponent(const NavigatorInterfacePrx& navigator)
39 {
40 ARMARX_CHECK_NOT_NULL(navigator);
41 this->navigator = navigator;
42 }
43
44 std::unique_ptr<core::NavigatorInterface>
46 const std::string& configId)
47 {
49 ARMARX_CHECK_NOT_NULL(navigator);
50
51 try
52 {
53 navigator->createConfig(config.toAron(), configId);
54 }
55 catch (const Ice::LocalException& e)
56 {
57 ARMARX_ERROR << "Failed to create navigation config '" << configId
58 << "' on navigator: " << e.what();
59 throw;
60 }
61
63 // std::make_unique doesn't work with friend class
64 return std::unique_ptr<IceNavigatorHandle>(new IceNavigatorHandle(navigator, configId));
65 }
66
67} // namespace armarx::navigation::client
void setNavigatorComponent(const NavigatorInterfacePrx &navigator)
NavigatorHandlePtr createConfig(const client::NavigationStackConfig &config, const std::string &configId) override
Create a Config object.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:196
This file is part of ArmarX.
#define ARMARX_TRACE
Definition trace.h:77