// // Copyright (c) ZeroC, Inc. All rights reserved. // #include #include #include using namespace std; using namespace Test; shared_ptr SessionManagerI::create(string userId, shared_ptr sessionControl, const Ice::Current& current) { if(userId == "rejectme") { throw Glacier2::CannotCreateSessionException(""); } if(userId == "localexception") { throw Ice::ObjectNotExistException(__FILE__, __LINE__); } return Ice::uncheckedCast(current.adapter->addWithUUID(make_shared(sessionControl))); } SessionI::SessionI(shared_ptr sessionControl) : _sessionControl(move(sessionControl)) { assert(_sessionControl); } void SessionI::destroyFromClientAsync(function response, function, const Ice::Current&) { _sessionControl->destroyAsync(move(response), [](exception_ptr){ test(false); }); } void SessionI::shutdown(const Ice::Current& current) { current.adapter->getCommunicator()->shutdown(); } void SessionI::destroy(const Ice::Current& current) { current.adapter->remove(current.id); }