summaryrefslogtreecommitdiff
path: root/project2/ice
diff options
context:
space:
mode:
Diffstat (limited to 'project2/ice')
-rw-r--r--project2/ice/iceDaemon.cpp7
-rw-r--r--project2/ice/iceDaemon.h5
-rw-r--r--project2/ice/unittests/testDaemon.cpp2
3 files changed, 11 insertions, 3 deletions
diff --git a/project2/ice/iceDaemon.cpp b/project2/ice/iceDaemon.cpp
index 860cd86..14e7c90 100644
--- a/project2/ice/iceDaemon.cpp
+++ b/project2/ice/iceDaemon.cpp
@@ -67,7 +67,7 @@ IceDaemon::shutdown() const
}
void
-IceDaemon::run() const
+IceDaemon::setup() const
{
Logger()->messagebf(LOG_DEBUG, " %s creating adapter %s [%s]...", __PRETTY_FUNCTION__, adapterName, adapterEndpoint);
Ice::ObjectAdapterPtr adapter = ic->createObjectAdapterWithEndpoints(adapterName, adapterEndpoint);
@@ -79,7 +79,12 @@ IceDaemon::run() const
Logger()->messagebf(LOG_DEBUG, " %s starting...", __PRETTY_FUNCTION__);
adapter->activate();
+}
+
+void
+IceDaemon::run() const
+{
Logger()->messagebf(LOG_INFO, " %s running...", __PRETTY_FUNCTION__);
ic->waitForShutdown();
diff --git a/project2/ice/iceDaemon.h b/project2/ice/iceDaemon.h
index 3164699..41343ec 100644
--- a/project2/ice/iceDaemon.h
+++ b/project2/ice/iceDaemon.h
@@ -10,8 +10,9 @@ class IceDaemon : public Daemon, IceBase {
IceDaemon(int & argc, char ** argv);
virtual ~IceDaemon();
- void run() const;
- void shutdown() const;
+ void setup() const override;
+ void run() const override;
+ void shutdown() const override;
void executeTask(const std::string & name, const ParamMap & params) const;
void executeView(const std::string & name, Slicer::ModelPartPtr p, const ParamMap & params) const;
diff --git a/project2/ice/unittests/testDaemon.cpp b/project2/ice/unittests/testDaemon.cpp
index 0740966..4015f4a 100644
--- a/project2/ice/unittests/testDaemon.cpp
+++ b/project2/ice/unittests/testDaemon.cpp
@@ -103,6 +103,7 @@ commonTests()
int dummy = 0;
BOOST_TEST_CHECKPOINT("Run daemon");
DaemonPtr id = new IceDaemon(dummy, NULL);
+ id->setup();
std::thread run(&Daemon::run, id.get());
BOOST_TEST_CHECKPOINT("Create and verify proxies");
@@ -186,6 +187,7 @@ commonTests()
id->shutdown();
run.join();
+ id->teardown();
ic->destroy();
}