// // Copyright (c) ZeroC, Inc. All rights reserved. // #include #include using namespace std; using namespace Test; SessionManagerI::SessionManagerI(const shared_ptr& controller): _controller(controller) { } shared_ptr SessionManagerI::create(string, shared_ptr sessionControl, const Ice::Current& current) { auto newSession = Ice::uncheckedCast( current.adapter->addWithUUID(make_shared(sessionControl, _controller))); _controller->addSession(SessionTuple(newSession, move(sessionControl))); return newSession; } SessionI::SessionI(shared_ptr sessionControl, shared_ptr controller) : _sessionControl(move(sessionControl)), _controller(move(controller)) { assert(_sessionControl); } void SessionI::shutdown(const Ice::Current& current) { current.adapter->getCommunicator()->shutdown(); } void SessionI::destroy(const Ice::Current& current) { _controller->notifyDestroy(_sessionControl); current.adapter->remove(current.id); }