From 986cfe0c836e17cdef90d41a7a5f4c78cc470566 Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 11:42:46 -0400 Subject: [PATCH 01/18] C++ build fixes --- .github/workflows/ci.yml | 52 + .gitignore | 10 +- .vscode/cspell.json | 1 + certs/cacert.der | Bin 973 -> 986 bytes certs/cacert.pem | 34 +- certs/client.bks | Bin 3525 -> 3560 bytes certs/client.jks | Bin 3519 -> 3553 bytes certs/client.p12 | Bin 2822 -> 2838 bytes certs/makedemocerts.py | 2 +- certs/server.bks | Bin 3589 -> 3601 bytes certs/server.jks | Bin 3584 -> 3594 bytes certs/server.p12 | Bin 2886 -> 2878 bytes certs/server.pem | 28 + cpp/Chat/client/Client.cpp | 243 +- cpp/Chat/client/PollingClient.cpp | 17 +- cpp/Chat/server/ChatRoom.cpp | 2 +- cpp/Chat/server/ChatServer.cpp | 15 +- cpp/Chat/server/ChatSessionI.cpp | 16 +- cpp/Chat/server/ChatSessionI.h | 12 +- cpp/Chat/server/ChatSessionManagerI.cpp | 12 +- cpp/Chat/server/ChatSessionManagerI.h | 6 +- .../server/PollingChatSessionFactoryI.cpp | 11 +- cpp/Chat/server/PollingChatSessionFactoryI.h | 15 +- cpp/Chat/server/PollingChatSessionI.cpp | 2 +- cpp/Glacier2/callback/CallbackI.cpp | 5 +- cpp/Glacier2/callback/CallbackI.h | 8 +- cpp/Glacier2/callback/Client.cpp | 23 +- cpp/Glacier2/callback/Server.cpp | 3 +- cpp/Glacier2/callback/config.glacier2 | 7 - cpp/Glacier2/simpleChat/ChatSessionI.cpp | 47 +- cpp/Glacier2/simpleChat/ChatSessionI.h | 16 +- cpp/Glacier2/simpleChat/Client.cpp | 16 +- cpp/Glacier2/simpleChat/Server.cpp | 3 +- cpp/Glacier2/simpleChat/config.glacier2 | 7 - cpp/Ice/async/Client.cpp | 4 +- cpp/Ice/async/HelloI.cpp | 3 +- cpp/Ice/async/Server.cpp | 5 +- cpp/Ice/async/WorkQueue.cpp | 3 +- cpp/Ice/asyncInvocation/Client.cpp | 15 +- cpp/Ice/asyncInvocation/Server.cpp | 3 +- cpp/Ice/bidir/CallbackI.cpp | 7 +- cpp/Ice/bidir/CallbackI.h | 10 +- cpp/Ice/bidir/Client.cpp | 7 +- cpp/Ice/bidir/Server.cpp | 3 +- cpp/Ice/callback/CallbackSenderI.cpp | 5 +- cpp/Ice/callback/CallbackSenderI.h | 8 +- cpp/Ice/callback/Client.cpp | 7 +- cpp/Ice/callback/Server.cpp | 3 +- cpp/Ice/context/Client.cpp | 3 +- cpp/Ice/context/ContextI.cpp | 3 +- cpp/Ice/context/Server.cpp | 3 +- cpp/Ice/hello/Client.cpp | 3 +- cpp/Ice/hello/HelloI.cpp | 3 +- cpp/Ice/hello/Server.cpp | 3 +- cpp/Ice/interceptor/Client.cpp | 3 +- cpp/Ice/interceptor/InterceptorI.cpp | 14 +- cpp/Ice/interceptor/InterceptorI.h | 6 +- cpp/Ice/interceptor/Server.cpp | 7 +- cpp/Ice/interceptor/ThermostatI.cpp | 3 +- cpp/Ice/interleaved/Client.cpp | 5 +- cpp/Ice/interleaved/Server.cpp | 3 +- cpp/Ice/interleaved/ThroughputI.cpp | 4 +- cpp/Ice/interleaved/ThroughputI.h | 9 +- cpp/Ice/invoke/Client.cpp | 3 +- cpp/Ice/invoke/PrinterI.cpp | 7 +- cpp/Ice/invoke/PrinterI.h | 6 +- cpp/Ice/invoke/Server.cpp | 5 +- cpp/Ice/latency/Client.cpp | 3 +- cpp/Ice/latency/Server.cpp | 5 +- cpp/Ice/locator/Client.cpp | 3 +- cpp/Ice/locator/HelloI.cpp | 5 +- cpp/Ice/locator/Locator.cpp | 56 +- cpp/Ice/locator/Server.cpp | 3 +- cpp/Ice/minimal/Client.cpp | 3 +- cpp/Ice/minimal/HelloI.cpp | 3 +- cpp/Ice/minimal/Server.cpp | 3 +- cpp/Ice/mtalk/Client.cpp | 67 +- cpp/Ice/multicast/Client.cpp | 15 +- cpp/Ice/multicast/Server.cpp | 23 +- cpp/Ice/nested/Client.cpp | 3 +- cpp/Ice/nested/NestedI.cpp | 7 +- cpp/Ice/nested/NestedI.h | 10 +- cpp/Ice/nested/Server.cpp | 3 +- cpp/Ice/optional/Client.cpp | 70 +- cpp/Ice/optional/ContactDBI.cpp | 21 +- cpp/Ice/optional/ContactDBI.h | 32 +- cpp/Ice/optional/Server.cpp | 3 +- cpp/Ice/plugin/Client.cpp | 3 +- cpp/Ice/plugin/LoggerPluginI.cpp | 2 + cpp/Ice/plugin/Server.cpp | 1 + cpp/Ice/properties/Client.cpp | 7 +- cpp/Ice/properties/Props.ice | 2 +- cpp/Ice/properties/Server.cpp | 3 +- cpp/Ice/session/Client.cpp | 5 +- cpp/Ice/session/Server.cpp | 3 +- cpp/Ice/session/SessionFactoryI.cpp | 11 +- cpp/Ice/session/SessionFactoryI.h | 8 +- cpp/Ice/session/SessionI.cpp | 5 +- cpp/Ice/session/SessionI.h | 12 +- cpp/Ice/throughput/Client.cpp | 7 +- cpp/Ice/throughput/Server.cpp | 3 +- cpp/Ice/throughput/Throughput.ice | 7 +- cpp/Ice/throughput/ThroughputI.cpp | 17 +- cpp/Ice/throughput/ThroughputI.h | 38 +- cpp/IceBox/hello/Client.cpp | 3 +- cpp/IceBox/hello/HelloI.cpp | 3 +- cpp/IceBox/hello/README.md | 4 +- cpp/IceDiscovery/hello/Client.cpp | 3 +- cpp/IceDiscovery/hello/HelloI.cpp | 3 +- cpp/IceDiscovery/hello/Server.cpp | 3 +- cpp/IceDiscovery/replication/Client.cpp | 3 +- cpp/IceDiscovery/replication/HelloI.cpp | 3 +- cpp/IceDiscovery/replication/Server.cpp | 3 +- cpp/IceGrid/allocate/Client.cpp | 13 +- cpp/IceGrid/allocate/HelloI.cpp | 3 +- cpp/IceGrid/allocate/Server.cpp | 3 +- cpp/IceGrid/customLocator/Client.cpp | 3 +- cpp/IceGrid/customLocator/HelloI.cpp | 3 +- cpp/IceGrid/customLocator/Locator.cpp | 50 +- cpp/IceGrid/customLocator/Server.cpp | 3 +- cpp/IceGrid/icebox/Client.cpp | 3 +- cpp/IceGrid/icebox/HelloI.cpp | 8 +- cpp/IceGrid/icebox/application.xml | 17 +- cpp/IceGrid/replication/Client.cpp | 3 +- cpp/IceGrid/replication/HelloI.cpp | 3 +- cpp/IceGrid/replication/Server.cpp | 3 +- cpp/IceGrid/secure/Client.cpp | 5 +- cpp/IceGrid/secure/HelloI.cpp | 3 +- cpp/IceGrid/secure/Server.cpp | 3 +- cpp/IceGrid/secure/config.glacier2 | 2 - cpp/IceGrid/sessionActivation/Client.cpp | 11 +- cpp/IceGrid/sessionActivation/HelloI.cpp | 3 +- cpp/IceGrid/sessionActivation/Server.cpp | 3 +- cpp/IceGrid/simple/Client.cpp | 5 +- cpp/IceGrid/simple/HelloI.cpp | 3 +- cpp/IceGrid/simple/Server.cpp | 3 +- cpp/IceStorm/clock/Publisher.cpp | 10 +- cpp/IceStorm/clock/Subscriber.cpp | 6 +- cpp/IceStorm/clock/config.icebox | 2 +- cpp/IceStorm/counter/Client.cpp | 3 +- cpp/IceStorm/counter/CounterI.cpp | 9 +- cpp/IceStorm/counter/CounterI.h | 16 +- cpp/IceStorm/counter/CounterObserverI.cpp | 4 +- cpp/IceStorm/counter/Server.cpp | 7 +- cpp/IceStorm/counter/config.icebox | 2 +- cpp/IceStorm/replicated/Publisher.cpp | 5 +- cpp/IceStorm/replicated/Subscriber.cpp | 10 +- cpp/IceStorm/replicated/application.xml | 115 +- cpp/IceStorm/replicated2/Publisher.cpp | 5 +- cpp/IceStorm/replicated2/Subscriber.cpp | 6 +- cpp/IceStorm/replicated2/config.ib1 | 2 +- cpp/IceStorm/replicated2/config.ib2 | 2 +- cpp/IceStorm/replicated2/config.ib3 | 2 +- cpp/Makefile | 2 +- cpp/Manual/evictor/EvictorBase.cpp | 107 - cpp/Manual/evictor/EvictorBase.h | 45 - cpp/Manual/evictor/README.md | 12 - cpp/Manual/lifecycle/Client.cpp | 52 - cpp/Manual/lifecycle/Filesystem.ice | 46 - cpp/Manual/lifecycle/FilesystemI.cpp | 249 -- cpp/Manual/lifecycle/FilesystemI.h | 75 - cpp/Manual/lifecycle/Grammar.cpp | 1661 ------------- cpp/Manual/lifecycle/Grammar.h | 86 - cpp/Manual/lifecycle/Grammar.y | 154 -- cpp/Manual/lifecycle/Makefile.mk | 7 - cpp/Manual/lifecycle/Parser.cpp | 445 ---- cpp/Manual/lifecycle/Parser.h | 85 - cpp/Manual/lifecycle/README.md | 18 - cpp/Manual/lifecycle/Scanner.cpp | 2048 ----------------- cpp/Manual/lifecycle/Scanner.l | 293 --- cpp/Manual/lifecycle/Server.cpp | 81 - .../lifecycle/msbuild/client/client.vcxproj | 272 --- .../msbuild/client/client.vcxproj.filters | 110 - .../msbuild/client/client.vcxproj.user | 19 - .../lifecycle/msbuild/client/packages.config | 8 - .../lifecycle/msbuild/server/packages.config | 8 - .../lifecycle/msbuild/server/server.vcxproj | 269 --- .../msbuild/server/server.vcxproj.filters | 102 - .../msbuild/server/server.vcxproj.user | 19 - cpp/Manual/printer/Client.cpp | 4 +- cpp/Manual/printer/Server.cpp | 3 +- cpp/Manual/simpleFilesystem/Client.cpp | 4 +- cpp/Manual/simpleFilesystem/FilesystemI.cpp | 2 +- cpp/Manual/simpleFilesystem/FilesystemI.h | 10 +- cpp/Manual/simpleFilesystem/Server.cpp | 3 +- cpp/make/Make.rules | 14 +- csharp/Glacier2/callback/config.glacier2 | 7 - csharp/IceStorm/clock/config.icebox | 2 +- java/Database/library/config.glacier2 | 7 - java/Glacier2/callback/config.glacier2 | 7 - java/IceGrid/icebox/application.xml | 18 +- java/IceStorm/clock/config.icebox | 2 +- make/Make.rules | 4 +- php/Glacier2/hello/config.glacier2 | 7 - python/Glacier2/callback/config.glacier2 | 7 - python/IceStorm/clock/config.icebox | 2 +- swift/Glacier2/callback/config.glacier2 | 7 - swift/IceStorm/clock/config.icebox | 2 +- 198 files changed, 912 insertions(+), 7124 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 certs/server.pem delete mode 100644 cpp/Manual/evictor/EvictorBase.cpp delete mode 100644 cpp/Manual/evictor/EvictorBase.h delete mode 100644 cpp/Manual/evictor/README.md delete mode 100644 cpp/Manual/lifecycle/Client.cpp delete mode 100644 cpp/Manual/lifecycle/Filesystem.ice delete mode 100644 cpp/Manual/lifecycle/FilesystemI.cpp delete mode 100644 cpp/Manual/lifecycle/FilesystemI.h delete mode 100644 cpp/Manual/lifecycle/Grammar.cpp delete mode 100644 cpp/Manual/lifecycle/Grammar.h delete mode 100644 cpp/Manual/lifecycle/Grammar.y delete mode 100644 cpp/Manual/lifecycle/Makefile.mk delete mode 100644 cpp/Manual/lifecycle/Parser.cpp delete mode 100644 cpp/Manual/lifecycle/Parser.h delete mode 100644 cpp/Manual/lifecycle/README.md delete mode 100644 cpp/Manual/lifecycle/Scanner.cpp delete mode 100644 cpp/Manual/lifecycle/Scanner.l delete mode 100644 cpp/Manual/lifecycle/Server.cpp delete mode 100644 cpp/Manual/lifecycle/msbuild/client/client.vcxproj delete mode 100644 cpp/Manual/lifecycle/msbuild/client/client.vcxproj.filters delete mode 100644 cpp/Manual/lifecycle/msbuild/client/client.vcxproj.user delete mode 100644 cpp/Manual/lifecycle/msbuild/client/packages.config delete mode 100644 cpp/Manual/lifecycle/msbuild/server/packages.config delete mode 100644 cpp/Manual/lifecycle/msbuild/server/server.vcxproj delete mode 100644 cpp/Manual/lifecycle/msbuild/server/server.vcxproj.filters delete mode 100644 cpp/Manual/lifecycle/msbuild/server/server.vcxproj.user diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..48979ca54b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: Build and test + +on: + workflow_dispatch: + push: + branches: ["main"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["main"] + +# See https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + ci: + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Ice + uses: actions/checkout@v4 + with: + repository: zeroc-ice/ice + ref: main + path: ice + + - name: Setup Ice Build Dependencies + uses: ./ice/.github/actions/setup-dependencies + + - name: Build Iice on ${{ matrix.os }} + uses: ./ice/.github/actions/build + timeout-minutes: 90 + with: + working_directory: ice/cpp + + - name: Checkout repository + uses: actions/checkout@v4 + with: + path: ice-demos + + - name: Build Ice Demos on ${{ matrix.os }} + timeout-minutes: 90 + working-directory: ice-demos/cpp + run: | + export ICE_HOME=$GITHUB_WORKSPACE/ice + make diff --git a/.gitignore b/.gitignore index 77c79d8e6c..877862daa1 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,10 @@ locator publisher subscriber talk +chatserver + +!Chat/client/ +!Chat/server/ !**/msbuild/client !**/msbuild/server @@ -185,8 +189,7 @@ es5 # # Nuget packages # -cpp11/packages -cpp98/packages +cpp/packages csharp/packages # @@ -214,3 +217,6 @@ swift/Carthage .build Package.resolved *.bcsymbolmap + +compile_commands.json +.envrc diff --git a/.vscode/cspell.json b/.vscode/cspell.json index d7a07ee5b0..c960b0c7a7 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -2,6 +2,7 @@ "version": "0.2", "language": "en", "words": [ + "Blobject", "icegrid", "zeroc" ], diff --git a/certs/cacert.der b/certs/cacert.der index 899a6aa07f91532d43ddc0717b0cdbb12dc2347f..6c405e2bb2757d922ee9fffc8ffd1a726e108451 100644 GIT binary patch delta 680 zcmV;Z0$2Ub2igZ0FoFZtFoFWUpaTK{0s;t9Y?T#5(DnV17a;^xWpi|qJbf`TFgG$c zF)=eTF*sTm4Kg$_FfutYF*7nTI9f1)i!l{269xlS1Op5VNn>RoRAqB?kvw^mV*wz4 z%dhLH&Z*c`xP z@a3`WuDyS1UF0^7%k#oprZ(X()6xrUDyQ4J##bco4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-T$+haxLLOt$Ec4$_JS*gbm2MZ7O0YfNVEF?W1frTy#ptN;YcjR5 zuuvo75rZ;y$LEcIFL`sLGMw+*VLq-FM=?OaF-Ye2TY*fP=h0=r4erg4)F`Yh^r!J2+v-rCf=48oWUybk}>EgkJ zQdq3NYK3OVKJ`?soyweHRSG1|=ioJhEoWm`a zP_k>=)Zp}NmF`if{?5{!JhkYTO_VL!wv4nG_TjD+cV zmsIKGYj+Y`&A(a<1`oiQIOD!;%SjiN2zlqGR9>jiV^*rVgWy7ZQs|ZxUpHUO>?6r! zZqQB~{~bce4guTUV$=bcv!LfE`Nfjgv?TLqQhlut(Po1hAmerhF{FQUc@Ne|q5fDb zsMqCluX;vLEKKOq!XWgyGCBF~BVC&)e`BBbYkI~v>Y&3qmNBup+%7vFIfyYL6Js;) zc?bOb!R%3?Ob>H6`H8-Rrs9uHvai11sm zW0IXy*#)1RxkD2o@c3Z|OYWTj96FhTPq*;vw_J_7i~Ct_{UVjJpQ-@zd{^VO4iJ1b zC+rm5_dWC~0Ju#1U6NcIfdg$fkBLJoPqY4P!$$l+?Ta7uOV?aQ+YO7T7R|76*h$DQ zf$Zl>r_?;RlgkP)Lq`~*n#8rwc>f(3kl*Nhi6_#i~3c(w+8?}WmjXzBz diff --git a/certs/server.pem b/certs/server.pem new file mode 100644 index 0000000000..ca1b44cb78 --- /dev/null +++ b/certs/server.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIExjCCA66gAwIBAgIICIqPq5Tox3swDQYJKoZIhvcNAQELBQAwgYsxFTATBgNV +BAMMDEljZSBUZXN0cyBDQTEMMAoGA1UECwwDSWNlMRQwEgYDVQQKDAtaZXJvQywg +SW5jLjEQMA4GA1UEBwwHSnVwaXRlcjEQMA4GA1UECAwHRmxvcmlkYTELMAkGA1UE +BhMCVVMxHTAbBgkqhkiG9w0BCQEWDmluZm9AemVyb2MuY29tMB4XDTIyMDcyNzEx +MzIxOFoXDTI0MTAyOTExMzIxOFowgYgx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8SefRMl/3/Uefj7Kkx +BXZbP1FEKMts9QBAfit0OktmJltxB5+DyARAS6zRH4t0c/wmUm5ml/OOza297aAl +hvW/Q1QlB6WKRMCH9F7AUyRz9uFiaM1cYsZ/I/SltoPCguESZcjqFDZ8fblNcdur +v/c6QECje4YDjZ53vxEjfYtDBpFBG6GQPXBF5BZN47F6Iu/W+kS/OQatkR/8hhEh +CjvZb3AXSr9f9V+uRm9c6yeHz2mfp9jFHIPhCJrYpkPQfSJ2pZfyiD1tzwvOyw5K +x+P/Keu4P/M4IZLHdQiYgSbV9lFe04z5cBo= +-----END CERTIFICATE----- diff --git a/cpp/Chat/client/Client.cpp b/cpp/Chat/client/Client.cpp index c6a9c3f08f..d229b1134b 100644 --- a/cpp/Chat/client/Client.cpp +++ b/cpp/Chat/client/Client.cpp @@ -2,11 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "ChatSession.h" +#include "ChatUtils.h" #include #include - -#include -#include +#include using namespace std; @@ -14,16 +14,20 @@ static const unsigned int maxMessageSize = 1024; namespace { - // mutex to prevent intertwined cout output mutex coutMutex; + void menu() + { + const lock_guard lock(coutMutex); + cout << "enter /quit to exit." << endl; + } } -class ChatRoomCallbackI : public Chat::ChatRoomCallback +class ChatRoomCallbackI final : public Chat::ChatRoomCallback { public: - virtual void init(Ice::StringSeq names, const Ice::Current&) override + void init(Ice::StringSeq names, const Ice::Current&) final { const lock_guard lock(coutMutex); cout << "Users: "; @@ -39,132 +43,132 @@ class ChatRoomCallbackI : public Chat::ChatRoomCallback cout << endl; } - virtual void join(long long, string name, const Ice::Current&) override + void join(long long, string name, const Ice::Current&) final { const lock_guard lock(coutMutex); cout << ">>>> " << name << " joined." << endl; } - virtual void leave(long long, string name, const Ice::Current&) override + void leave(long long, string name, const Ice::Current&) final { const lock_guard lock(coutMutex); cout << "<<<< " << name << " left." << endl; } - virtual void send(long long, string name, string message, const Ice::Current&) override + void send(long long, string name, string message, const Ice::Current&) final { const lock_guard lock(coutMutex); cout << name << " > " << ChatUtils::unstripHtml(message) << endl; } }; -class ChatClient : public Glacier2::Application +Chat::ChatSessionPrx +createSession(Glacier2::RouterPrx router) { -public: - ChatClient() - : // - // Since this is an interactive demo we don't want any signal - // handling. - // - Application(Ice::SignalPolicy::NoSignalHandling) + while (true) { - } + cout << "This demo accepts any user ID and password.\n"; - virtual shared_ptr createSession() override - { - shared_ptr sessionPrx; - while (!sessionPrx) - { - cout << "This demo accepts any user ID and password.\n"; + string id; + cout << "user id: " << flush; + getline(cin, id); + id = ChatUtils::trim(id); - string id; - cout << "user id: " << flush; - getline(cin, id); - id = ChatUtils::trim(id); + string pw; + cout << "password: " << flush; + getline(cin, pw); + pw = ChatUtils::trim(pw); - string pw; - cout << "password: " << flush; - getline(cin, pw); - pw = ChatUtils::trim(pw); - - try - { - sessionPrx = router()->createSession(id, pw); - break; - } - catch (const Glacier2::CannotCreateSessionException& ex) - { - cout << "Login failed:\n" << ex.reason << endl; - } - catch (const Glacier2::PermissionDeniedException& ex) - { - cout << "Login failed:\n" << ex.reason << endl; - } - catch (const Ice::LocalException& ex) + try + { + optional session{router->createSession(id, pw)}; + if (!session) { - cerr << "Communication with the server failed:\n" << ex << endl; + cerr << "Glaicer2::createSession return null. Is the SessionManager configured?" << endl; + exit(1); } + router->ice_getCachedConnection()->setCloseCallback( + [](Ice::ConnectionPtr) + { + const lock_guard lock(coutMutex); + cout << "The Glacier2 session has been destroyed." << endl; + }); + return *session; + } + catch (const Glacier2::CannotCreateSessionException& ex) + { + cout << "Login failed:\n" << ex.reason << endl; + } + catch (const Glacier2::PermissionDeniedException& ex) + { + cout << "Login failed:\n" << ex.reason << endl; + } + catch (const Ice::LocalException& ex) + { + cerr << "Communication with the server failed:\n" << ex << endl; } - return sessionPrx; } +} - virtual void sessionDestroyed() override { cerr << "Session destroyed " << endl; } - - virtual int runWithSession(int argc, char*[]) override +void +run(shared_ptr communicator) +{ + optional router{communicator->getDefaultRouter()}; + if (!router) { - if (argc > 1) - { - const string message = "usage: "; - throw runtime_error(message + appName()); - } + cerr << "No router configured" << endl; + exit(1); + } - auto sessionPrx = Ice::uncheckedCast(this->session()); - sessionPrx->setCallback( - Ice::uncheckedCast(addWithUUID(make_shared()))); + // Create a session with the Glacier2 router + Chat::ChatSessionPrx session = createSession(*router); - menu(); + auto adapter = communicator->createObjectAdapterWithRouter("", *router); + adapter->activate(); - do - { - string s; - cout << ""; - getline(cin, s); - s = ChatUtils::trim(s); + // Create a callback object and add it to the adapter using the client's category + // provided by the router + Ice::Identity id{Ice::generateUUID(), router->getCategoryForClient()}; + + auto callbackPrx = adapter->add(make_shared(), id); + + // Set the callback proxy on the session + session->setCallback(Chat::ChatRoomCallbackPrx{callbackPrx}); + + menu(); - if (!s.empty()) + do + { + string s; + cout << ""; + getline(cin, s); + s = ChatUtils::trim(s); + + if (!s.empty()) + { + if (s[0] == '/') + { + if (s == "/quit") + { + break; + } + menu(); + } + else { - if (s[0] == '/') + if (s.size() > maxMessageSize) { - if (s == "/quit") - { - break; - } - menu(); + const lock_guard lock(coutMutex); + cout << "Message length exceeded, maximum length is " << maxMessageSize << " characters."; } else { - if (s.size() > maxMessageSize) - { - const lock_guard lock(coutMutex); - cout << "Message length exceeded, maximum length is " << maxMessageSize << " characters."; - } - else - { - sessionPrx->send(s); - } + session->send(s); } } - } while (cin.good()); - return 0; - } - -private: - void menu() - { - const lock_guard lock(coutMutex); - cout << "enter /quit to exit." << endl; - } -}; + } + } while (cin.good()); +} int main(int argc, char* argv[]) @@ -173,23 +177,44 @@ main(int argc, char* argv[]) Ice::registerIceSSL(); Ice::registerIceWS(); #endif - Ice::InitializationData initData; - initData.properties = Ice::createProperties(argc, argv); - // - // Set Ice.Default.Router if not set - // - if (initData.properties->getProperty("Ice.Default.Router").empty()) + int status = 0; + + try + { + // CommunicatorHolder's ctor initializes an Ice communicator, + // and its dtor destroys this communicator. + // + // The communicator initialization removes all Ice-related arguments from argc/argv + Ice::InitializationData initData; + initData.properties = Ice::createProperties(argc, argv); + + if (argc > 1) + { + cerr << argv[0] << ": too many arguments" << endl; + status = 1; + } + + // + // Set Ice.Default.Router if not set + // + if (initData.properties->getProperty("Ice.Default.Router").empty()) + { + initData.properties->setProperty("IceSSL.UsePlatformCAs", "1"); + // initData.properties->setProperty("IceSSL.CheckCertName", "2"); + initData.properties->setProperty( + "Ice.Default.Router", + "Glacier2/router:wss -p 443 -h zeroc.com -r /demo-proxy/chat/glacier2"); + } + const Ice::CommunicatorHolder ich(initData); + + run(ich.communicator()); + } + catch (const std::exception& ex) { - initData.properties->setProperty("Ice.Plugin.IceSSL", "IceSSL:createIceSSL"); - initData.properties->setProperty("IceSSL.UsePlatformCAs", "1"); - initData.properties->setProperty("IceSSL.CheckCertName", "2"); - initData.properties->setProperty("IceSSL.VerifyDepthMax", "5"); - initData.properties->setProperty( - "Ice.Default.Router", - "Glacier2/router:wss -p 443 -h zeroc.com -r /demo-proxy/chat/glacier2"); + cerr << ex.what() << endl; + status = 1; } - ChatClient app; - return app.main(argc, argv, initData); + return status; } diff --git a/cpp/Chat/client/PollingClient.cpp b/cpp/Chat/client/PollingClient.cpp index e4aa3e3330..cf57556151 100644 --- a/cpp/Chat/client/PollingClient.cpp +++ b/cpp/Chat/client/PollingClient.cpp @@ -2,27 +2,25 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "ChatUtils.h" +#include "PollingChat.h" #include - -#include -#include #include +#include using namespace std; static const unsigned int maxMessageSize = 1024; namespace { - // mutex to prevent intertwined cout output mutex coutMutex; - } class GetUpdatesTask { public: - explicit GetUpdatesTask(const shared_ptr& session) : _session(session) {} + explicit GetUpdatesTask(const optional& session) : _session(session) {} ~GetUpdatesTask() { @@ -114,7 +112,7 @@ class GetUpdatesTask } private: - const shared_ptr _session; + const optional _session; std::future _asyncResult; // only used by the main thread bool _done = false; @@ -144,10 +142,7 @@ main(int argc, char* argv[]) // if (initData.properties->getProperty("PollingChatSessionFactory").empty()) { - initData.properties->setProperty("Ice.Plugin.IceSSL", "IceSSL:createIceSSL"); initData.properties->setProperty("IceSSL.UsePlatformCAs", "1"); - initData.properties->setProperty("IceSSL.CheckCertName", "2"); - initData.properties->setProperty("IceSSL.VerifyDepthMax", "5"); initData.properties->setProperty( "PollingChatSessionFactory", "PollingChatSessionFactory:wss -h zeroc.com -p 443 -r /demo-proxy/chat/poll"); @@ -189,7 +184,7 @@ run(const shared_ptr& communicator) return 1; } - shared_ptr session; + optional session; while (!session) { cout << "This demo accepts any user ID and password.\n"; diff --git a/cpp/Chat/server/ChatRoom.cpp b/cpp/Chat/server/ChatRoom.cpp index b386b3f14d..6be0d1785b 100644 --- a/cpp/Chat/server/ChatRoom.cpp +++ b/cpp/Chat/server/ChatRoom.cpp @@ -80,7 +80,7 @@ ChatRoom::leave(const string& name) } } -Ice::Long +int64_t ChatRoom::send(const string& name, const string& message) { const lock_guard sync(_mutex); diff --git a/cpp/Chat/server/ChatServer.cpp b/cpp/Chat/server/ChatServer.cpp index 35e89d56d5..29a672ab34 100644 --- a/cpp/Chat/server/ChatServer.cpp +++ b/cpp/Chat/server/ChatServer.cpp @@ -2,17 +2,17 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "ChatSessionManagerI.h" +#include "PollingChatSessionFactoryI.h" #include -#include - +#include using namespace std; -class ChatServer : public Ice::Service +class ChatServer final : public Ice::Service { public: - virtual bool start(int argc, char* argv[], int&) override; - virtual bool stop() override; + bool start(int argc, char* argv[], int&) final; + bool stop() final; private: shared_ptr _adapter; @@ -21,7 +21,6 @@ class ChatServer : public Ice::Service bool ChatServer::start(int, char*[], int& status) { - const int timeout = communicator()->getProperties()->getPropertyAsIntWithDefault("PollingChatSessionTimeout", 10); const bool traceEnabled = communicator()->getProperties()->getPropertyAsIntWithDefault("Server.Trace", 0) != 0; auto logger = communicator()->getLogger(); @@ -45,7 +44,7 @@ ChatServer::start(int, char*[], int& status) out << "Chat session manager created ok."; } _adapter->add( - make_shared(chatRoom, timeout, traceEnabled, logger), + make_shared(chatRoom, traceEnabled, logger), Ice::stringToIdentity("PollingChatSessionFactory")); if (traceEnabled) diff --git a/cpp/Chat/server/ChatSessionI.cpp b/cpp/Chat/server/ChatSessionI.cpp index 6a4f576ed8..42ae9a9816 100644 --- a/cpp/Chat/server/ChatSessionI.cpp +++ b/cpp/Chat/server/ChatSessionI.cpp @@ -2,8 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include -#include +#include "ChatSessionI.h" +#include "ChatUtils.h" using namespace std; @@ -11,8 +11,8 @@ class SessionCallbackAdapter : public ChatRoomCallbackAdapter, public enable_sha { public: SessionCallbackAdapter( - const shared_ptr& callback, - const shared_ptr& session, + const optional& callback, + const optional& session, bool trace, const shared_ptr& logger, std::string name) @@ -93,8 +93,8 @@ class SessionCallbackAdapter : public ChatRoomCallbackAdapter, public enable_sha } private: - const shared_ptr _callback; - const shared_ptr _session; + const optional _callback; + const optional _session; const bool _trace; const shared_ptr _logger; const string _name; @@ -113,7 +113,7 @@ ChatSessionI::ChatSessionI( } void -ChatSessionI::setCallback(shared_ptr callback, const Ice::Current& current) +ChatSessionI::setCallback(optional callback, const Ice::Current& current) { const lock_guard sync(_mutex); if (_destroy) @@ -131,6 +131,8 @@ ChatSessionI::setCallback(shared_ptr callback, const return; } + callback->ice_ping(); + Ice::Context ctx; ctx["_fwd"] = "o"; _callback = make_shared( diff --git a/cpp/Chat/server/ChatSessionI.h b/cpp/Chat/server/ChatSessionI.h index 2612b02697..dbf050372e 100644 --- a/cpp/Chat/server/ChatSessionI.h +++ b/cpp/Chat/server/ChatSessionI.h @@ -5,17 +5,17 @@ #ifndef CHAT_SESSION_I_H #define CHAT_SESSION_I_H -#include -#include +#include "ChatRoom.h" +#include "ChatSession.h" -class ChatSessionI : public Chat::ChatSession +class ChatSessionI final : public Chat::ChatSession { public: ChatSessionI(const std::shared_ptr&, std::string, bool trace, const std::shared_ptr& logger); - virtual void setCallback(std::shared_ptr, const Ice::Current&) override; - virtual long long send(std::string, const Ice::Current&) override; - virtual void destroy(const Ice::Current&) override; + void setCallback(std::optional, const Ice::Current&) final; + long long send(std::string, const Ice::Current&) final; + void destroy(const Ice::Current&) final; private: const std::shared_ptr _chatRoom; diff --git a/cpp/Chat/server/ChatSessionManagerI.cpp b/cpp/Chat/server/ChatSessionManagerI.cpp index 3aabb85268..9522f1d4d5 100644 --- a/cpp/Chat/server/ChatSessionManagerI.cpp +++ b/cpp/Chat/server/ChatSessionManagerI.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include -#include -#include +#include "ChatSessionManagerI.h" +#include "ChatSessionI.h" +#include "ChatUtils.h" using namespace std; @@ -18,10 +18,10 @@ ChatSessionManagerI::ChatSessionManagerI( { } -shared_ptr +optional ChatSessionManagerI::create( string name, - shared_ptr sessionControl, + optional sessionControl, const Ice::Current& current) { string vname; @@ -40,7 +40,7 @@ ChatSessionManagerI::create( throw Glacier2::CannotCreateSessionException(ex.what()); } - shared_ptr proxy; + optional proxy; try { auto session = make_shared(_chatRoom, vname, _trace, _logger); diff --git a/cpp/Chat/server/ChatSessionManagerI.h b/cpp/Chat/server/ChatSessionManagerI.h index f0175fb412..cbeaaa02a2 100644 --- a/cpp/Chat/server/ChatSessionManagerI.h +++ b/cpp/Chat/server/ChatSessionManagerI.h @@ -9,13 +9,13 @@ #include #include -class ChatSessionManagerI : public Glacier2::SessionManager +class ChatSessionManagerI final : public Glacier2::SessionManager { public: ChatSessionManagerI(const std::shared_ptr&, bool trace, const std::shared_ptr& logger); - virtual std::shared_ptr - create(std::string, std::shared_ptr, const Ice::Current&) override; + std::optional + create(std::string, std::optional, const Ice::Current&) final; private: const std::shared_ptr _chatRoom; diff --git a/cpp/Chat/server/PollingChatSessionFactoryI.cpp b/cpp/Chat/server/PollingChatSessionFactoryI.cpp index 7a1bf84cfc..64b9e9da62 100644 --- a/cpp/Chat/server/PollingChatSessionFactoryI.cpp +++ b/cpp/Chat/server/PollingChatSessionFactoryI.cpp @@ -11,17 +11,15 @@ using namespace std; PollingChatSessionFactoryI::PollingChatSessionFactoryI( const shared_ptr& chatRoom, - int timeout, bool trace, const shared_ptr& logger) : _chatRoom(chatRoom), - _timeout(timeout), _trace(trace), _logger(logger) { } -shared_ptr +optional PollingChatSessionFactoryI::create(string name, string, const Ice::Current& current) { string vname; @@ -40,18 +38,13 @@ PollingChatSessionFactoryI::create(string name, string, const Ice::Current& curr throw PollingChat::CannotCreateSessionException(ex.what()); } - shared_ptr proxy; + optional proxy; auto session = make_shared(_chatRoom, vname, _trace, _logger); proxy = Ice::uncheckedCast(current.adapter->addWithUUID(session)); auto collocProxy = proxy->ice_endpoints(Ice::EndpointSeq()); - // - // Close connection if the connection is idle for _timeout seconds - // - current.con->setACM(_timeout, Ice::ACMClose::CloseOnInvocationAndIdle, Ice::ACMHeartbeat::HeartbeatOnDispatch); - auto trace = _trace; auto logger = _logger; current.con->setCloseCallback( diff --git a/cpp/Chat/server/PollingChatSessionFactoryI.h b/cpp/Chat/server/PollingChatSessionFactoryI.h index 80bf40cd8f..b4f89580db 100644 --- a/cpp/Chat/server/PollingChatSessionFactoryI.h +++ b/cpp/Chat/server/PollingChatSessionFactoryI.h @@ -5,23 +5,20 @@ #ifndef POLLING_CHAT_SESSION_FACTORY_I_H #define POLLING_CHAT_SESSION_FACTORY_I_H +#include "ChatRoom.h" +#include "PollingChat.h" +#include "PollingChatSessionI.h" #include -#include -#include -#include - -class PollingChatSessionFactoryI : public PollingChat::PollingChatSessionFactory +class PollingChatSessionFactoryI final : public PollingChat::PollingChatSessionFactory { public: - PollingChatSessionFactoryI(const std::shared_ptr&, int, bool, const std::shared_ptr&); + PollingChatSessionFactoryI(const std::shared_ptr&, bool, const std::shared_ptr&); - virtual std::shared_ptr - create(std::string, std::string, const Ice::Current&) override; + std::optional create(std::string, std::string, const Ice::Current&) final; private: const std::shared_ptr _chatRoom; - const int _timeout; const bool _trace; const std::shared_ptr _logger; }; diff --git a/cpp/Chat/server/PollingChatSessionI.cpp b/cpp/Chat/server/PollingChatSessionI.cpp index 1e700a71d2..5d1f0504f7 100644 --- a/cpp/Chat/server/PollingChatSessionI.cpp +++ b/cpp/Chat/server/PollingChatSessionI.cpp @@ -102,7 +102,7 @@ PollingChatSessionI::getUpdates(const Ice::Current&) return _callback->getUpdates(); } -Ice::Long +int64_t PollingChatSessionI::send(string message, const Ice::Current&) { const lock_guard sync(_mutex); diff --git a/cpp/Glacier2/callback/CallbackI.cpp b/cpp/Glacier2/callback/CallbackI.cpp index d4cd92bd36..242f9177a1 100644 --- a/cpp/Glacier2/callback/CallbackI.cpp +++ b/cpp/Glacier2/callback/CallbackI.cpp @@ -2,14 +2,15 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CallbackI.h" #include +#include using namespace std; using namespace Demo; void -CallbackI::initiateCallback(shared_ptr proxy, const Ice::Current& current) +CallbackI::initiateCallback(optional proxy, const Ice::Current& current) { cout << "initiating callback to: " << current.adapter->getCommunicator()->proxyToString(proxy) << endl; try diff --git a/cpp/Glacier2/callback/CallbackI.h b/cpp/Glacier2/callback/CallbackI.h index aa53886d00..8ab439728b 100644 --- a/cpp/Glacier2/callback/CallbackI.h +++ b/cpp/Glacier2/callback/CallbackI.h @@ -5,13 +5,13 @@ #ifndef CALLBACK_I_H #define CALLBACK_I_H -#include +#include "Callback.h" -class CallbackI : public Demo::Callback +class CallbackI final : public Demo::Callback { public: - virtual void initiateCallback(std::shared_ptr, const Ice::Current&) override; - virtual void shutdown(const Ice::Current&) override; + void initiateCallback(std::optional, const Ice::Current&) final; + void shutdown(const Ice::Current&) final; }; #endif diff --git a/cpp/Glacier2/callback/Client.cpp b/cpp/Glacier2/callback/Client.cpp index 43614f75c0..dc9058e60f 100644 --- a/cpp/Glacier2/callback/Client.cpp +++ b/cpp/Glacier2/callback/Client.cpp @@ -2,17 +2,18 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Callback.h" #include #include +#include using namespace std; using namespace Demo; -class CallbackReceiverI : public Demo::CallbackReceiver +class CallbackReceiverI final : public Demo::CallbackReceiver { public: - virtual void callback(const Ice::Current&) override { cout << "received callback" << endl; } + void callback(const Ice::Current&) final { cout << "received callback" << endl; } }; void run(const shared_ptr&); @@ -60,16 +61,22 @@ void menu(); void run(const shared_ptr& communicator) { - const shared_ptr router = - Ice::checkedCast(communicator->getDefaultRouter()); - shared_ptr session; + optional defaultRouter = communicator->getDefaultRouter(); + if (!defaultRouter) + { + cerr << "no router configured" << endl; + return; + } + const Glacier2::RouterPrx router = Glacier2::RouterPrx(*communicator->getDefaultRouter()); + + optional session; // // Loop until we have successfully create a session. // while (!session) { // - // Prompt the user for the creadentials to create the session. + // Prompt the user for the credentials to create the session. // cout << "This demo accepts any user-id / password combination.\n"; @@ -100,10 +107,8 @@ run(const shared_ptr& communicator) } } - const Ice::Int acmTimeout = router->getACMTimeout(); const Ice::ConnectionPtr connection = router->ice_getCachedConnection(); assert(connection); - connection->setACM(acmTimeout, IceUtil::None, Ice::ACMHeartbeat::HeartbeatAlways); connection->setCloseCallback([](Ice::ConnectionPtr) { cout << "The Glacier2 session has been destroyed." << endl; }); diff --git a/cpp/Glacier2/callback/Server.cpp b/cpp/Glacier2/callback/Server.cpp index 0d955b0e5b..413c191c1b 100644 --- a/cpp/Glacier2/callback/Server.cpp +++ b/cpp/Glacier2/callback/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CallbackI.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Glacier2/callback/config.glacier2 b/cpp/Glacier2/callback/config.glacier2 index f38ed422cb..ed378f8b38 100644 --- a/cpp/Glacier2/callback/config.glacier2 +++ b/cpp/Glacier2/callback/config.glacier2 @@ -23,13 +23,6 @@ Glacier2.Server.Endpoints=tcp -h localhost # Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 - # # Glacier can forward requests buffered or unbuffered. Unbuffered # means a lower resource consumption, as buffering requires one diff --git a/cpp/Glacier2/simpleChat/ChatSessionI.cpp b/cpp/Glacier2/simpleChat/ChatSessionI.cpp index 3ea2faab01..c8ef8f6c43 100644 --- a/cpp/Glacier2/simpleChat/ChatSessionI.cpp +++ b/cpp/Glacier2/simpleChat/ChatSessionI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "ChatSessionI.h" #include +#include #include using namespace std; @@ -18,20 +19,20 @@ class ChatRoom public: static ChatRoom* instance(); - void enter(const shared_ptr&, const shared_ptr&, const Ice::Current&); - void leave(const shared_ptr&, const Ice::Current&); + void enter(const ChatSessionPrx&, const ChatCallbackPrx&, const Ice::Current&); + void leave(const ChatCallbackPrx&, const Ice::Current&); void message(const string&) const; void deadRouter(const shared_ptr&); void destroy(); private: mutex _mutex; - list> _callbacks; + list _callbacks; // // Map of connection from Glacier2 to proxies of Chat Sessions in this server // - map, list>> _connectionMap; + map, list> _connectionMap; }; ChatRoom* @@ -42,10 +43,7 @@ ChatRoom::instance() } void -ChatRoom::enter( - const shared_ptr& session, - const shared_ptr& callback, - const Ice::Current& current) +ChatRoom::enter(const ChatSessionPrx& session, const ChatCallbackPrx& callback, const Ice::Current& current) { const lock_guard sync(_mutex); _callbacks.push_back(callback); @@ -57,11 +55,6 @@ ChatRoom::enter( _connectionMap[current.con].push_back(session); - // - // Never close this connection from Glacier2 and turn on heartbeats with a timeout of 30s - // - current.con->setACM(30, Ice::ACMClose::CloseOff, Ice::ACMHeartbeat::HeartbeatAlways); - current.con->setCloseCallback( [this](const shared_ptr& con) { @@ -80,13 +73,12 @@ ChatRoom::enter( } void -ChatRoom::leave(const shared_ptr& callback, const Ice::Current& current) +ChatRoom::leave(const ChatCallbackPrx& callback, const Ice::Current& current) { const lock_guard sync(_mutex); - _callbacks.remove_if([&callback](const shared_ptr& cb) - { return Ice::proxyIdentityEqual(callback, cb); }); - _connectionMap[current.con].remove_if([¤t](const shared_ptr& s) + _callbacks.remove_if([&callback](const ChatCallbackPrx& cb) { return Ice::proxyIdentityEqual(callback, cb); }); + _connectionMap[current.con].remove_if([¤t](const ChatSessionPrx& s) { return current.id == s->ice_getIdentity(); }); } @@ -115,7 +107,7 @@ ChatRoom::deadRouter(const shared_ptr& con) { cout << "Detected dead router - destroying all associated sessions " << endl; - list> sessions; + list sessions; { const lock_guard sync(_mutex); auto p = _connectionMap.find(con); @@ -153,18 +145,15 @@ ChatRoom::destroy() ChatSessionI::ChatSessionI(string userId) : _userId(std::move(userId)) {} void -ChatSessionI::setCallback(shared_ptr callback, const Ice::Current& current) +ChatSessionI::setCallback(optional callback, const Ice::Current& current) { const lock_guard sync(_mutex); - if (!_callback) + if (!_callback && callback) { _callback = callback; auto chatRoom = ChatRoom::instance(); chatRoom->message(_userId + " has entered the chat room."); - chatRoom->enter( - Ice::uncheckedCast(current.adapter->createProxy(current.id)), - callback, - current); + chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), *callback, current); } } @@ -183,8 +172,8 @@ ChatSessionI::destroy(const Ice::Current& current) if (_callback) { auto chatRoom = ChatRoom::instance(); - chatRoom->leave(_callback, current); - _callback = nullptr; + chatRoom->leave(*_callback, current); + _callback = nullopt; chatRoom->message(_userId + " has left the chat room."); } current.adapter->remove(current.id); @@ -194,8 +183,8 @@ ChatSessionI::destroy(const Ice::Current& current) // ChatSessionManagerI // -shared_ptr -ChatSessionManagerI::create(string userId, shared_ptr, const Ice::Current& current) +optional +ChatSessionManagerI::create(string userId, optional, const Ice::Current& current) { const Ice::Identity ident = {Ice::generateUUID(), "session"}; return Ice::uncheckedCast(current.adapter->add(make_shared(userId), ident)); diff --git a/cpp/Glacier2/simpleChat/ChatSessionI.h b/cpp/Glacier2/simpleChat/ChatSessionI.h index 19c3b54823..4e409d4571 100644 --- a/cpp/Glacier2/simpleChat/ChatSessionI.h +++ b/cpp/Glacier2/simpleChat/ChatSessionI.h @@ -9,26 +9,26 @@ #include #include -class ChatSessionI : public Demo::ChatSession +class ChatSessionI final : public Demo::ChatSession { public: ChatSessionI(std::string); - virtual void setCallback(std::shared_ptr, const Ice::Current&) override; - virtual void say(std::string, const Ice::Current&) override; - virtual void destroy(const Ice::Current&) override; + void setCallback(std::optional, const Ice::Current&) final; + void say(std::string, const Ice::Current&) final; + void destroy(const Ice::Current&) final; private: std::mutex _mutex; const std::string _userId; - std::shared_ptr _callback; + std::optional _callback; }; -class ChatSessionManagerI : public Glacier2::SessionManager +class ChatSessionManagerI final : public Glacier2::SessionManager { public: - virtual std::shared_ptr - create(std::string, std::shared_ptr, const Ice::Current&) override; + std::optional + create(std::string, std::optional, const Ice::Current&) final; void destroy(); }; diff --git a/cpp/Glacier2/simpleChat/Client.cpp b/cpp/Glacier2/simpleChat/Client.cpp index 65a2185825..21bc05b929 100644 --- a/cpp/Glacier2/simpleChat/Client.cpp +++ b/cpp/Glacier2/simpleChat/Client.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Chat.h" #include #include +#include using namespace std; using namespace Demo; @@ -68,9 +69,14 @@ string trim(const string&); void run(const shared_ptr& communicator) { - const shared_ptr router = - Ice::checkedCast(communicator->getDefaultRouter()); - shared_ptr session; + optional defaultRouter = communicator->getDefaultRouter(); + if (!defaultRouter) + { + cerr << "no router configured" << endl; + return; + } + const Glacier2::RouterPrx router = Glacier2::RouterPrx(*communicator->getDefaultRouter()); + optional session; while (!session) { cout << "This demo accepts any user-id / password combination.\n"; @@ -98,10 +104,8 @@ run(const shared_ptr& communicator) } } - const Ice::Int acmTimeout = router->getACMTimeout(); const Ice::ConnectionPtr connection = router->ice_getCachedConnection(); assert(connection); - connection->setACM(acmTimeout, IceUtil::None, Ice::ACMHeartbeat::HeartbeatAlways); connection->setCloseCallback( [](Ice::ConnectionPtr) { diff --git a/cpp/Glacier2/simpleChat/Server.cpp b/cpp/Glacier2/simpleChat/Server.cpp index 04438d55ee..74a735967d 100644 --- a/cpp/Glacier2/simpleChat/Server.cpp +++ b/cpp/Glacier2/simpleChat/Server.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "ChatSessionI.h" #include #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Glacier2/simpleChat/config.glacier2 b/cpp/Glacier2/simpleChat/config.glacier2 index 4cacfbdb96..6ce986ccf7 100644 --- a/cpp/Glacier2/simpleChat/config.glacier2 +++ b/cpp/Glacier2/simpleChat/config.glacier2 @@ -47,13 +47,6 @@ Glacier2.SessionManager=ChatSessionManager:tcp -h localhost -p 10001 # Glacier2.PermissionsVerifier=ChatSessionVerifier:tcp -h localhost -p 10001 -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 - # # Only allow access to back end "sesion" objects. # diff --git a/cpp/Ice/async/Client.cpp b/cpp/Ice/async/Client.cpp index 2a1dec9cbe..38c75a95ff 100644 --- a/cpp/Ice/async/Client.cpp +++ b/cpp/Ice/async/Client.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/async/HelloI.cpp b/cpp/Ice/async/HelloI.cpp index a7704f6aa2..fd92467b9d 100644 --- a/cpp/Ice/async/HelloI.cpp +++ b/cpp/Ice/async/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/Ice/async/Server.cpp b/cpp/Ice/async/Server.cpp index 60efa77c81..4df7c14fcb 100644 --- a/cpp/Ice/async/Server.cpp +++ b/cpp/Ice/async/Server.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" +#include "WorkQueue.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/async/WorkQueue.cpp b/cpp/Ice/async/WorkQueue.cpp index 4586be394e..3fc170c06f 100644 --- a/cpp/Ice/async/WorkQueue.cpp +++ b/cpp/Ice/async/WorkQueue.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "WorkQueue.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/asyncInvocation/Client.cpp b/cpp/Ice/asyncInvocation/Client.cpp index 3052b73a2f..94523247ed 100644 --- a/cpp/Ice/asyncInvocation/Client.cpp +++ b/cpp/Ice/asyncInvocation/Client.cpp @@ -2,12 +2,13 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Calculator.h" + #include +#include #include -#include - using namespace std; int run(const shared_ptr&, const string&); @@ -71,18 +72,18 @@ run(const shared_ptr& communicator, const string& appName) // Calculate 13 / 5 auto fut2 = calculator->divideAsync(13, 5); - // Since the 'divide' operation has output parameters, the result of 'get' is a struct + // Since the 'divide' operation has output parameters, the result of 'get' is a tuple { - auto result = fut2.get(); - cout << "13 / 5 is " << result.returnValue << " with a remainder of " << result.remainder << endl; + auto [returnValue, remainder] = fut2.get(); + cout << "13 / 5 is " << returnValue << " with a remainder of " << remainder << endl; } // same with 13 / 0, which throws an exception try { auto fut3 = calculator->divideAsync(13, 0); - auto result = fut3.get(); - cout << "13 / 0 is " << result.returnValue << " with a remainder of " << result.remainder << endl; + auto [returnValue, remainder] = fut3.get(); + cout << "13 / 0 is " << returnValue << " with a remainder of " << remainder << endl; } catch (const Demo::DivideByZeroException&) { diff --git a/cpp/Ice/asyncInvocation/Server.cpp b/cpp/Ice/asyncInvocation/Server.cpp index cbd0eea132..6cd12b268f 100644 --- a/cpp/Ice/asyncInvocation/Server.cpp +++ b/cpp/Ice/asyncInvocation/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CalculatorI.h" #include +#include #include using namespace std; diff --git a/cpp/Ice/bidir/CallbackI.cpp b/cpp/Ice/bidir/CallbackI.cpp index 475bf03044..d501206412 100644 --- a/cpp/Ice/bidir/CallbackI.cpp +++ b/cpp/Ice/bidir/CallbackI.cpp @@ -2,14 +2,15 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CallbackI.h" #include +#include using namespace std; using namespace Demo; void -CallbackSenderI::addClient(std::shared_ptr client, const Ice::Current& current) +CallbackSenderI::addClient(optional client, const Ice::Current& current) { const lock_guard lock(_mutex); cout << "adding client `" << Ice::identityToString(client->ice_getIdentity()) << "'" << endl; @@ -80,7 +81,7 @@ CallbackSenderI::invokeCallback() } void -CallbackSenderI::removeClient(const shared_ptr& client, exception_ptr eptr) +CallbackSenderI::removeClient(const optional& client, exception_ptr eptr) { const lock_guard lock(_mutex); auto p = find(_clients.begin(), _clients.end(), client); diff --git a/cpp/Ice/bidir/CallbackI.h b/cpp/Ice/bidir/CallbackI.h index 9ee609e3f5..6e7f1873c2 100644 --- a/cpp/Ice/bidir/CallbackI.h +++ b/cpp/Ice/bidir/CallbackI.h @@ -5,22 +5,22 @@ #ifndef CALLBACK_I_H #define CALLBACK_I_H -#include +#include "Callback.h" -class CallbackSenderI : public Demo::CallbackSender, public std::enable_shared_from_this +class CallbackSenderI final : public Demo::CallbackSender, public std::enable_shared_from_this { public: - virtual void addClient(std::shared_ptr, const Ice::Current&) override; + void addClient(std::optional, const Ice::Current&) final; void destroy(); void start(); private: void invokeCallback(); - void removeClient(const std::shared_ptr&, std::exception_ptr); + void removeClient(const std::optional&, std::exception_ptr); bool _destroy = false; - std::vector> _clients; + std::vector> _clients; std::mutex _mutex; std::condition_variable _cv; diff --git a/cpp/Ice/bidir/Client.cpp b/cpp/Ice/bidir/Client.cpp index 2ba1228b3d..49e3b63a4a 100644 --- a/cpp/Ice/bidir/Client.cpp +++ b/cpp/Ice/bidir/Client.cpp @@ -2,16 +2,17 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Callback.h" #include +#include using namespace std; using namespace Demo; -class CallbackReceiverI : public CallbackReceiver +class CallbackReceiverI final : public CallbackReceiver { public: - virtual void callback(Ice::Int num, const Ice::Current&) override { cout << "received callback #" << num << endl; } + void callback(int32_t num, const Ice::Current&) final { cout << "received callback #" << num << endl; } }; int run(const shared_ptr&, const string&); diff --git a/cpp/Ice/bidir/Server.cpp b/cpp/Ice/bidir/Server.cpp index 8b428e6bac..67e2a54cf5 100644 --- a/cpp/Ice/bidir/Server.cpp +++ b/cpp/Ice/bidir/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CallbackI.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/callback/CallbackSenderI.cpp b/cpp/Ice/callback/CallbackSenderI.cpp index 318ff4e492..a02e19ecf3 100644 --- a/cpp/Ice/callback/CallbackSenderI.cpp +++ b/cpp/Ice/callback/CallbackSenderI.cpp @@ -2,14 +2,15 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CallbackSenderI.h" #include +#include using namespace std; using namespace Demo; void -CallbackSenderI::initiateCallback(shared_ptr proxy, const Ice::Current&) +CallbackSenderI::initiateCallback(optional proxy, const Ice::Current&) { cout << "initiating callback" << endl; try diff --git a/cpp/Ice/callback/CallbackSenderI.h b/cpp/Ice/callback/CallbackSenderI.h index f131993c37..e4bc180461 100644 --- a/cpp/Ice/callback/CallbackSenderI.h +++ b/cpp/Ice/callback/CallbackSenderI.h @@ -5,13 +5,13 @@ #ifndef CALLBACK_I_H #define CALLBACK_I_H -#include +#include "Callback.h" -class CallbackSenderI : public Demo::CallbackSender +class CallbackSenderI final : public Demo::CallbackSender { public: - virtual void initiateCallback(std::shared_ptr, const Ice::Current&) override; - virtual void shutdown(const Ice::Current&) override; + void initiateCallback(std::optional, const Ice::Current&) final; + void shutdown(const Ice::Current&) final; }; #endif diff --git a/cpp/Ice/callback/Client.cpp b/cpp/Ice/callback/Client.cpp index 5d0d8686ee..53d06b2970 100644 --- a/cpp/Ice/callback/Client.cpp +++ b/cpp/Ice/callback/Client.cpp @@ -2,16 +2,17 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Callback.h" #include +#include using namespace std; using namespace Demo; -class CallbackReceiverI : public CallbackReceiver +class CallbackReceiverI final : public CallbackReceiver { public: - virtual void callback(const Ice::Current&) override { cout << "received callback" << endl; } + void callback(const Ice::Current&) final { cout << "received callback" << endl; } }; int run(const shared_ptr&); diff --git a/cpp/Ice/callback/Server.cpp b/cpp/Ice/callback/Server.cpp index eb7bc7b6a3..d47187f07a 100644 --- a/cpp/Ice/callback/Server.cpp +++ b/cpp/Ice/callback/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CallbackSenderI.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/context/Client.cpp b/cpp/Ice/context/Client.cpp index 492c53b1c7..dda7503991 100644 --- a/cpp/Ice/context/Client.cpp +++ b/cpp/Ice/context/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Context.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/context/ContextI.cpp b/cpp/Ice/context/ContextI.cpp index 6a8514de33..734fcaa8ab 100644 --- a/cpp/Ice/context/ContextI.cpp +++ b/cpp/Ice/context/ContextI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "ContextI.h" #include +#include using namespace std; diff --git a/cpp/Ice/context/Server.cpp b/cpp/Ice/context/Server.cpp index 0716adc21c..e4aea7d650 100644 --- a/cpp/Ice/context/Server.cpp +++ b/cpp/Ice/context/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "ContextI.h" #include +#include using namespace std; diff --git a/cpp/Ice/hello/Client.cpp b/cpp/Ice/hello/Client.cpp index 7a106b1398..72ae948fd3 100644 --- a/cpp/Ice/hello/Client.cpp +++ b/cpp/Ice/hello/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/hello/HelloI.cpp b/cpp/Ice/hello/HelloI.cpp index 07ef89de15..77b1464cea 100644 --- a/cpp/Ice/hello/HelloI.cpp +++ b/cpp/Ice/hello/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include #include using namespace std; diff --git a/cpp/Ice/hello/Server.cpp b/cpp/Ice/hello/Server.cpp index 15e7a9dde6..8635ee5d63 100644 --- a/cpp/Ice/hello/Server.cpp +++ b/cpp/Ice/hello/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/Ice/interceptor/Client.cpp b/cpp/Ice/interceptor/Client.cpp index 4f8c7df0e3..0fa2c8cb6f 100644 --- a/cpp/Ice/interceptor/Client.cpp +++ b/cpp/Ice/interceptor/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Interceptor.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/interceptor/InterceptorI.cpp b/cpp/Ice/interceptor/InterceptorI.cpp index 1e62b0e5d3..9d539de7b6 100644 --- a/cpp/Ice/interceptor/InterceptorI.cpp +++ b/cpp/Ice/interceptor/InterceptorI.cpp @@ -2,24 +2,24 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "InterceptorI.h" using namespace std; InterceptorI::InterceptorI( - shared_ptr servant, + shared_ptr next, shared_ptr authenticator, unordered_set securedOperations) - : _servant(std::move(servant)), + : _next(std::move(next)), _authenticator(std::move(authenticator)), _securedOperations(std::move(securedOperations)) { } -bool -InterceptorI::dispatch(Ice::Request& request) +void +InterceptorI::dispatch(Ice::IncomingRequest& request, function sendResponse) { - auto current = request.getCurrent(); + auto current = request.current(); // // Check if the operation requires authorization to invoke. // @@ -42,5 +42,5 @@ InterceptorI::dispatch(Ice::Request& request) throw Demo::AuthorizationException(); } } - return _servant->ice_dispatch(request); + _next->dispatch(request, sendResponse); } diff --git a/cpp/Ice/interceptor/InterceptorI.h b/cpp/Ice/interceptor/InterceptorI.h index 73dc51086c..e4337d6103 100644 --- a/cpp/Ice/interceptor/InterceptorI.h +++ b/cpp/Ice/interceptor/InterceptorI.h @@ -9,14 +9,14 @@ #include #include -class InterceptorI : public Ice::DispatchInterceptor +class InterceptorI : public Ice::Object { public: InterceptorI(std::shared_ptr, std::shared_ptr, std::unordered_set); - virtual bool dispatch(Ice::Request&) override; + void dispatch(Ice::IncomingRequest&, std::function) final; private: - std::shared_ptr _servant; + std::shared_ptr _next; std::shared_ptr _authenticator; std::unordered_set _securedOperations; }; diff --git a/cpp/Ice/interceptor/Server.cpp b/cpp/Ice/interceptor/Server.cpp index edf9d4574e..b1f82d2ac6 100644 --- a/cpp/Ice/interceptor/Server.cpp +++ b/cpp/Ice/interceptor/Server.cpp @@ -2,10 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "AuthenticatorI.h" +#include "InterceptorI.h" +#include "ThermostatI.h" #include -#include -#include +#include #include using namespace std; diff --git a/cpp/Ice/interceptor/ThermostatI.cpp b/cpp/Ice/interceptor/ThermostatI.cpp index 65013c4bbc..8195425a04 100644 --- a/cpp/Ice/interceptor/ThermostatI.cpp +++ b/cpp/Ice/interceptor/ThermostatI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "ThermostatI.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/interleaved/Client.cpp b/cpp/Ice/interleaved/Client.cpp index e061d7faa9..83f88c0046 100644 --- a/cpp/Ice/interleaved/Client.cpp +++ b/cpp/Ice/interleaved/Client.cpp @@ -2,11 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Throughput.h" #include -#include - #include - +#include #include using namespace std; diff --git a/cpp/Ice/interleaved/Server.cpp b/cpp/Ice/interleaved/Server.cpp index 6a8fb2ed3b..eb90945383 100644 --- a/cpp/Ice/interleaved/Server.cpp +++ b/cpp/Ice/interleaved/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "ThroughputI.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/interleaved/ThroughputI.cpp b/cpp/Ice/interleaved/ThroughputI.cpp index f768a15cf4..a251a21f9b 100644 --- a/cpp/Ice/interleaved/ThroughputI.cpp +++ b/cpp/Ice/interleaved/ThroughputI.cpp @@ -2,11 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "ThroughputI.h" #include -#include Demo::Throughput::EchoByteSeqMarshaledResult -ThroughputI::echoByteSeq(std::pair seq, const Ice::Current& current) +ThroughputI::echoByteSeq(std::pair seq, const Ice::Current& current) { return EchoByteSeqMarshaledResult(seq, current); } diff --git a/cpp/Ice/interleaved/ThroughputI.h b/cpp/Ice/interleaved/ThroughputI.h index 84d46a168f..83943bdc9e 100644 --- a/cpp/Ice/interleaved/ThroughputI.h +++ b/cpp/Ice/interleaved/ThroughputI.h @@ -5,15 +5,14 @@ #ifndef THROUGHPUT_I_H #define THROUGHPUT_I_H -#include +#include "Throughput.h" -class ThroughputI : public Demo::Throughput +class ThroughputI final : public Demo::Throughput { public: - virtual EchoByteSeqMarshaledResult - echoByteSeq(std::pair, const Ice::Current&) override; + EchoByteSeqMarshaledResult echoByteSeq(std::pair, const Ice::Current&) final; - virtual void shutdown(const Ice::Current&) override; + void shutdown(const Ice::Current&) final; }; #endif diff --git a/cpp/Ice/invoke/Client.cpp b/cpp/Ice/invoke/Client.cpp index ce367d2ae9..d877d3f056 100644 --- a/cpp/Ice/invoke/Client.cpp +++ b/cpp/Ice/invoke/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Printer.h" #include -#include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/invoke/PrinterI.cpp b/cpp/Ice/invoke/PrinterI.cpp index c9437fa0d2..6022428ad1 100644 --- a/cpp/Ice/invoke/PrinterI.cpp +++ b/cpp/Ice/invoke/PrinterI.cpp @@ -2,8 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "PrinterI.h" + #include -#include + +#include using namespace std; using namespace Demo; @@ -27,7 +30,7 @@ operator<<(ostream& out, Color c) } bool -PrinterI::ice_invoke(vector inParams, vector& outParams, const Ice::Current& current) +PrinterI::ice_invoke(vector inParams, vector& outParams, const Ice::Current& current) { auto communicator = current.adapter->getCommunicator(); diff --git a/cpp/Ice/invoke/PrinterI.h b/cpp/Ice/invoke/PrinterI.h index 425e655011..1223b0c704 100644 --- a/cpp/Ice/invoke/PrinterI.h +++ b/cpp/Ice/invoke/PrinterI.h @@ -5,12 +5,12 @@ #ifndef PRINTER_I_H #define PRINTER_I_H -#include +#include "Printer.h" -class PrinterI : public Ice::Blobject +class PrinterI final : public Ice::Blobject { public: - virtual bool ice_invoke(std::vector, std::vector&, const Ice::Current&) override; + bool ice_invoke(std::vector, std::vector&, const Ice::Current&) final; }; #endif diff --git a/cpp/Ice/invoke/Server.cpp b/cpp/Ice/invoke/Server.cpp index 83f8e10f9d..22f42fc333 100644 --- a/cpp/Ice/invoke/Server.cpp +++ b/cpp/Ice/invoke/Server.cpp @@ -2,8 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "PrinterI.h" + #include -#include + +#include using namespace std; diff --git a/cpp/Ice/latency/Client.cpp b/cpp/Ice/latency/Client.cpp index b9abca472e..9d3eb56f1b 100644 --- a/cpp/Ice/latency/Client.cpp +++ b/cpp/Ice/latency/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Latency.h" #include -#include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/latency/Server.cpp b/cpp/Ice/latency/Server.cpp index 0c0595ee9f..88468b8f0c 100644 --- a/cpp/Ice/latency/Server.cpp +++ b/cpp/Ice/latency/Server.cpp @@ -2,8 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Latency.h" + #include -#include + +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/locator/Client.cpp b/cpp/Ice/locator/Client.cpp index 8a2e69b226..7ac9c74165 100644 --- a/cpp/Ice/locator/Client.cpp +++ b/cpp/Ice/locator/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/locator/HelloI.cpp b/cpp/Ice/locator/HelloI.cpp index 07155288e1..7e91540be4 100644 --- a/cpp/Ice/locator/HelloI.cpp +++ b/cpp/Ice/locator/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; @@ -22,6 +23,6 @@ HelloI::shutdown(const Ice::Current& c) // Unregister from the Locator registry // auto communicator = c.adapter->getCommunicator(); - communicator->getDefaultLocator()->getRegistry()->setAdapterDirectProxy("Hello", nullptr); + communicator->getDefaultLocator()->getRegistry()->setAdapterDirectProxy("Hello", nullopt); communicator->shutdown(); } diff --git a/cpp/Ice/locator/Locator.cpp b/cpp/Ice/locator/Locator.cpp index 8815d3dcf8..84bd37457c 100644 --- a/cpp/Ice/locator/Locator.cpp +++ b/cpp/Ice/locator/Locator.cpp @@ -3,57 +3,58 @@ // #include +#include using namespace std; namespace { - class LocatorRegistryI : public Ice::LocatorRegistry + class LocatorRegistryI final : public Ice::LocatorRegistry { public: - virtual void setAdapterDirectProxyAsync( + void setAdapterDirectProxyAsync( string id, - shared_ptr proxy, + optional proxy, function response, function, - const Ice::Current&) override + const Ice::Current&) final { - if (!proxy) + if (proxy) { - _adapters.erase(id); + _adapters.insert({id, std::move(*proxy)}); } else { - _adapters[id] = proxy; + _adapters.erase(id); } response(); } - virtual void setReplicatedAdapterDirectProxyAsync( + void setReplicatedAdapterDirectProxyAsync( string, string, - shared_ptr, + optional, function response, function, - const Ice::Current&) override + const Ice::Current&) final { assert(false); // Not used by this demo response(); } - virtual void setServerProcessProxyAsync( + void setServerProcessProxyAsync( string, - shared_ptr, + optional, function response, function, - const Ice::Current&) override + const Ice::Current&) final { assert(false); // Not used by this demo response(); } - shared_ptr getAdapter(const string& id) + optional getAdapter(const string& id) { auto p = _adapters.find(id); if (p == _adapters.end()) @@ -64,44 +65,41 @@ namespace } private: - map> _adapters; + map _adapters; }; - class LocatorI : public Ice::Locator + class LocatorI final : public Ice::Locator { public: - LocatorI(shared_ptr registry, shared_ptr registryPrx) + LocatorI(shared_ptr registry, optional registryPrx) : _registry(std::move(registry)), _registryPrx(std::move(registryPrx)) { } - virtual void findObjectByIdAsync( + void findObjectByIdAsync( Ice::Identity, - function&)> response, + function&)> response, function, - const Ice::Current&) const override + const Ice::Current&) const final { - response(nullptr); + response(nullopt); } - virtual void findAdapterByIdAsync( + void findAdapterByIdAsync( string id, - function&)> response, + function&)> response, function, - const Ice::Current&) const override + const Ice::Current&) const final { response(_registry->getAdapter(id)); } - virtual shared_ptr getRegistry(const Ice::Current&) const override - { - return _registryPrx; - } + optional getRegistry(const Ice::Current&) const final { return _registryPrx; } private: const shared_ptr _registry; - const shared_ptr _registryPrx; + const optional _registryPrx; }; } diff --git a/cpp/Ice/locator/Server.cpp b/cpp/Ice/locator/Server.cpp index 77fe3d7984..9da1fbff49 100644 --- a/cpp/Ice/locator/Server.cpp +++ b/cpp/Ice/locator/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/Ice/minimal/Client.cpp b/cpp/Ice/minimal/Client.cpp index 186c507e6d..d50808bc39 100644 --- a/cpp/Ice/minimal/Client.cpp +++ b/cpp/Ice/minimal/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/minimal/HelloI.cpp b/cpp/Ice/minimal/HelloI.cpp index 03eec19da2..59710360f1 100644 --- a/cpp/Ice/minimal/HelloI.cpp +++ b/cpp/Ice/minimal/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/Ice/minimal/Server.cpp b/cpp/Ice/minimal/Server.cpp index 3278461ce0..c443ef925a 100644 --- a/cpp/Ice/minimal/Server.cpp +++ b/cpp/Ice/minimal/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/Ice/mtalk/Client.cpp b/cpp/Ice/mtalk/Client.cpp index 676aca6f37..0717475b11 100644 --- a/cpp/Ice/mtalk/Client.cpp +++ b/cpp/Ice/mtalk/Client.cpp @@ -2,10 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "MTalk.h" #include -#include #include #include +#include #include using namespace std; @@ -15,8 +16,8 @@ class ChatApp public: int run(const shared_ptr&); - void discoveredPeer(const string&, const shared_ptr&); - void connect(const string&, const shared_ptr&); + void discoveredPeer(const string&, const optional&); + void connect(const string&, const optional&); void message(const string&); void disconnect(const Ice::Identity&, const shared_ptr&, bool); void closed(); @@ -32,9 +33,9 @@ class ChatApp string _name; shared_ptr _multicastAdapter; shared_ptr _peerAdapter; - shared_ptr _local; - shared_ptr _remote; - map> _peers; + optional _local; + optional _remote; + map> _peers; mutex _mutex; condition_variable _condition; }; @@ -42,12 +43,12 @@ class ChatApp // // This servant listens for multicast messages. // -class DiscoveryI : public MTalk::Discovery +class DiscoveryI final : public MTalk::Discovery { public: DiscoveryI(ChatApp* app) : _app(app) {} - virtual void announce(string name, shared_ptr peer, const Ice::Current&) override + void announce(string name, optional peer, const Ice::Current&) final { _app->discoveredPeer(name, peer); } @@ -59,19 +60,19 @@ class DiscoveryI : public MTalk::Discovery // // This servant listens for incoming connections from peers. // -class IncomingPeerI : public MTalk::Peer +class IncomingPeerI final : public MTalk::Peer { public: IncomingPeerI(ChatApp* app) : _app(app) {} - virtual void connect(string name, shared_ptr peer, const Ice::Current& current) override + void connect(string name, optional peer, const Ice::Current& current) final { _app->connect(name, peer->ice_fixed(current.con)); } - virtual void message(string text, const Ice::Current&) override { _app->message(text); } + void message(string text, const Ice::Current&) final { _app->message(text); } - virtual void disconnect(const Ice::Current& current) override { _app->disconnect(current.id, current.con, true); } + void disconnect(const Ice::Current& current) final { _app->disconnect(current.id, current.con, true); } private: ChatApp* _app; @@ -80,19 +81,19 @@ class IncomingPeerI : public MTalk::Peer // // This servant handles an outgoing session with a peer. // -class OutgoingPeerI : public MTalk::Peer +class OutgoingPeerI final : public MTalk::Peer { public: OutgoingPeerI(ChatApp* app) : _app(app) {} - virtual void connect(string, shared_ptr, const Ice::Current&) override + void connect(string, optional, const Ice::Current&) final { throw MTalk::ConnectionException("already connected"); } - virtual void message(string text, const Ice::Current&) override { _app->message(text); } + void message(string text, const Ice::Current&) final { _app->message(text); } - virtual void disconnect(const Ice::Current& current) override { _app->disconnect(current.id, current.con, false); } + void disconnect(const Ice::Current& current) final { _app->disconnect(current.id, current.con, false); } private: ChatApp* _app; @@ -104,7 +105,7 @@ class OutgoingPeerI : public MTalk::Peer class DiscoverTask { public: - DiscoverTask(shared_ptr d, string n, shared_ptr p) + DiscoverTask(optional d, string n, optional p) : _discovery(d), _name(n), _proxy(p) @@ -157,9 +158,9 @@ class DiscoverTask } private: - shared_ptr _discovery; + optional _discovery; string _name; - shared_ptr _proxy; + optional _proxy; bool _destroyed = false; mutex _mutex; condition_variable _condition; @@ -301,7 +302,7 @@ ChatApp::run(const shared_ptr& communicator) } void -ChatApp::discoveredPeer(const string& name, const shared_ptr& peer) +ChatApp::discoveredPeer(const string& name, const optional& peer) { const lock_guard lock(_mutex); @@ -326,7 +327,7 @@ ChatApp::discoveredPeer(const string& name, const shared_ptr& pe } void -ChatApp::connect(const string& name, const shared_ptr& peer) +ChatApp::connect(const string& name, const optional& peer) { // // Called for a new incoming connection request. @@ -344,7 +345,6 @@ ChatApp::connect(const string& name, const shared_ptr& peer) // auto con = peer->ice_getConnection(); con->setCloseCallback([this](const shared_ptr&) { this->closed(); }); - con->setACM(30, Ice::ACMClose::CloseOff, Ice::ACMHeartbeat::HeartbeatAlways); _remote = peer->ice_invocationTimeout(5000); @@ -377,7 +377,7 @@ ChatApp::disconnect(const Ice::Identity& id, const shared_ptr& if (_remote) { cout << ">>>> Peer disconnected" << endl; - _remote = nullptr; + _remote = nullopt; } if (!incoming) @@ -393,7 +393,7 @@ ChatApp::closed() { const lock_guard lock(_mutex); - _remote = nullptr; + _remote = nullopt; cout << ">>>> Connection to peer closed" << endl; } @@ -415,7 +415,7 @@ ChatApp::doConnect(const string& cmd) } auto name = cmd.substr(sp); - shared_ptr remote; + optional remote; { const lock_guard lock(_mutex); @@ -435,7 +435,7 @@ ChatApp::doConnect(const string& cmd) remote = _remote; } - shared_ptr localPeer; + optional localPeer; try { cout << ">>>> Connecting to " << name << endl; @@ -459,7 +459,6 @@ ChatApp::doConnect(const string& cmd) // Install a connection callback and enable ACM heartbeats. // con->setCloseCallback([this](const shared_ptr&) { this->closed(); }); - con->setACM(30, Ice::ACMClose::CloseOff, Ice::ACMHeartbeat::HeartbeatAlways); // // Now we're ready to notify the peer that we'd like to connect. @@ -474,7 +473,7 @@ ChatApp::doConnect(const string& cmd) { _peerAdapter->remove(localPeer->ice_getIdentity()); } - _remote = nullptr; + _remote = nullopt; return; } catch (const Ice::Exception& ex) @@ -484,7 +483,7 @@ ChatApp::doConnect(const string& cmd) { _peerAdapter->remove(localPeer->ice_getIdentity()); } - _remote = nullptr; + _remote = nullopt; return; } } @@ -510,7 +509,7 @@ ChatApp::doList() void ChatApp::doDisconnect() { - shared_ptr peer; + optional peer; { const lock_guard lock(_mutex); @@ -522,7 +521,7 @@ ChatApp::doDisconnect() } peer = _remote; - _remote = nullptr; + _remote = nullopt; } try @@ -537,7 +536,7 @@ ChatApp::doDisconnect() void ChatApp::doMessage(const string& text) { - shared_ptr peer; + optional peer; { const lock_guard lock(_mutex); @@ -564,12 +563,12 @@ ChatApp::doMessage(const string& text) void ChatApp::failed(const Ice::LocalException& ex) { - shared_ptr peer; + optional peer; { const lock_guard lock(_mutex); peer = _remote; - _remote = nullptr; + _remote = nullopt; } cout << ">>>> Action failed:" << endl << ex << endl; diff --git a/cpp/Ice/multicast/Client.cpp b/cpp/Ice/multicast/Client.cpp index 591f37fefc..5c49496bf5 100644 --- a/cpp/Ice/multicast/Client.cpp +++ b/cpp/Ice/multicast/Client.cpp @@ -2,22 +2,21 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Discovery.h" +#include "Hello.h" #include - -#include -#include - #include #include +#include #include using namespace std; using namespace Demo; -class DiscoverReplyI : public DiscoverReply +class DiscoverReplyI final : public DiscoverReply { public: - virtual void reply(shared_ptr obj, const Ice::Current&) override + void reply(optional obj, const Ice::Current&) final { { const lock_guard lock(_mutex); @@ -29,7 +28,7 @@ class DiscoverReplyI : public DiscoverReply _cond.notify_all(); } - shared_ptr waitReply(int seconds) + optional waitReply(int seconds) { auto until = chrono::system_clock::now() + chrono::seconds(seconds); unique_lock lock(_mutex); @@ -43,7 +42,7 @@ class DiscoverReplyI : public DiscoverReply } private: - shared_ptr _obj; + optional _obj; mutex _mutex; condition_variable _cond; }; diff --git a/cpp/Ice/multicast/Server.cpp b/cpp/Ice/multicast/Server.cpp index c4eb6e7e5c..f936e914fc 100644 --- a/cpp/Ice/multicast/Server.cpp +++ b/cpp/Ice/multicast/Server.cpp @@ -2,30 +2,33 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Discovery.h" +#include "Hello.h" #include - -#include -#include +#include using namespace std; using namespace Demo; -class HelloI : public Hello +class HelloI final : public Hello { public: - virtual void sayHello(const Ice::Current&) override { cout << "Hello World!" << endl; } + void sayHello(const Ice::Current&) final { cout << "Hello World!" << endl; } }; -class DiscoverI : public Discover +class DiscoverI final : public Discover { public: - DiscoverI(const shared_ptr& obj) : _obj(obj) {} + DiscoverI(const optional& obj) : _obj(obj) {} - virtual void lookup(shared_ptr reply, const Ice::Current&) override + void lookup(optional reply, const Ice::Current&) final { try { - reply->reply(_obj); + if (reply) + { + reply->reply(_obj); + } } catch (const Ice::LocalException&) { @@ -34,7 +37,7 @@ class DiscoverI : public Discover } private: - const shared_ptr _obj; + const optional _obj; }; int diff --git a/cpp/Ice/nested/Client.cpp b/cpp/Ice/nested/Client.cpp index bb8117765e..9638311af3 100644 --- a/cpp/Ice/nested/Client.cpp +++ b/cpp/Ice/nested/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "NestedI.h" #include -#include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/nested/NestedI.cpp b/cpp/Ice/nested/NestedI.cpp index d83858b67f..85d1f3d2d1 100644 --- a/cpp/Ice/nested/NestedI.cpp +++ b/cpp/Ice/nested/NestedI.cpp @@ -2,16 +2,17 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "NestedI.h" #include -#include +#include using namespace std; using namespace Demo; -NestedI::NestedI(shared_ptr self) : _self(std::move(self)) {} +NestedI::NestedI(optional self) : _self(std::move(self)) {} void -NestedI::nestedCall(int level, shared_ptr proxy, const Ice::Current&) +NestedI::nestedCall(int level, optional proxy, const Ice::Current&) { cout << level << endl; if (--level > 0) diff --git a/cpp/Ice/nested/NestedI.h b/cpp/Ice/nested/NestedI.h index ad67c26049..8863343315 100644 --- a/cpp/Ice/nested/NestedI.h +++ b/cpp/Ice/nested/NestedI.h @@ -5,16 +5,16 @@ #ifndef NESTED_I_H #define NESTED_I_H -#include +#include "Nested.h" -class NestedI : public Demo::Nested +class NestedI final : public Demo::Nested { public: - NestedI(std::shared_ptr); - virtual void nestedCall(int, std::shared_ptr, const Ice::Current&) override; + NestedI(std::optional); + void nestedCall(int, std::optional, const Ice::Current&) final; private: - const std::shared_ptr _self; + const std::optional _self; }; #endif diff --git a/cpp/Ice/nested/Server.cpp b/cpp/Ice/nested/Server.cpp index ebb7d1f7cc..d11bd1f482 100644 --- a/cpp/Ice/nested/Server.cpp +++ b/cpp/Ice/nested/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "NestedI.h" #include -#include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/optional/Client.cpp b/cpp/Ice/optional/Client.cpp index 679b0cfbb2..f405b75ab8 100644 --- a/cpp/Ice/optional/Client.cpp +++ b/cpp/Ice/optional/Client.cpp @@ -2,13 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -// TODO: remove when no longer needed -#ifdef _MSC_VER -# pragma warning(disable : 4702) // unreachable code in optional -#endif - -#include +#include "Contact.h" #include +#include using namespace std; using namespace Demo; @@ -65,8 +61,8 @@ main(int argc, char* argv[]) int run(const shared_ptr& communicator, const string& appName) { - auto contactdb = Ice::checkedCast(communicator->propertyToProxy("ContactDB.Proxy")); - if (!contactdb) + auto contactDb = Ice::checkedCast(communicator->propertyToProxy("ContactDB.Proxy")); + if (!contactDb) { cerr << appName << ": invalid proxy" << endl; return 1; @@ -76,7 +72,7 @@ run(const shared_ptr& communicator, const string& appName) // Add a contact for "john". All parameters are provided. // const string johnNumber = "123-456-7890"; - contactdb->addContact("john", NumberType::HOME, johnNumber, 0); + contactDb->addContact("john", NumberType::HOME, johnNumber, 0); cout << "Checking john... " << flush; @@ -86,7 +82,7 @@ run(const shared_ptr& communicator, const string& appName) // // number is an Ice::optional // - auto number = contactdb->queryNumber("john"); + auto number = contactDb->queryNumber("john"); // // tests if an optional value is set. // @@ -121,14 +117,14 @@ run(const shared_ptr& communicator, const string& appName) } // Optional can also be used in an out parameter. - Ice::optional dialgroup; - contactdb->queryDialgroup("john", dialgroup); - if (!dialgroup || dialgroup != 0) + optional dialGroup; + contactDb->queryDialgroup("john", dialGroup); + if (!dialGroup || dialGroup != 0) { - cout << "dialgroup is incorrect " << flush; + cout << "dialGroup is incorrect " << flush; } - auto info = contactdb->query("john"); + auto info = contactDb->query("john"); // // All of the info parameters should be set. // @@ -150,16 +146,16 @@ run(const shared_ptr& communicator, const string& appName) // the default value. // const string steveNumber = "234-567-8901"; - contactdb->addContact("steve", Ice::nullopt, steveNumber, 1); + contactDb->addContact("steve", nullopt, steveNumber, 1); cout << "Checking steve... " << flush; - number = contactdb->queryNumber("steve"); + number = contactDb->queryNumber("steve"); if (number != steveNumber) { cout << "number is incorrect " << flush; } - info = contactdb->query("steve"); + info = contactDb->query("steve"); // // Check the value for the NumberType. // @@ -173,10 +169,10 @@ run(const shared_ptr& communicator, const string& appName) cout << "info is incorrect " << flush; } - contactdb->queryDialgroup("steve", dialgroup); - if (!dialgroup || dialgroup != 1) + contactDb->queryDialgroup("steve", dialGroup); + if (!dialGroup || dialGroup != 1) { - cout << "dialgroup is incorrect " << flush; + cout << "dialGroup is incorrect " << flush; } cout << "ok" << endl; @@ -185,17 +181,17 @@ run(const shared_ptr& communicator, const string& appName) // Add a contact from "frank". Here the dialGroup field isn't set. // const string frankNumber = "345-678-9012"; - contactdb->addContact("frank", NumberType::CELL, frankNumber, Ice::nullopt); + contactDb->addContact("frank", NumberType::CELL, frankNumber, nullopt); cout << "Checking frank... " << flush; - number = contactdb->queryNumber("frank"); + number = contactDb->queryNumber("frank"); if (number != frankNumber) { cout << "number is incorrect " << flush; } - info = contactdb->query("frank"); + info = contactDb->query("frank"); // // The dial group field should be unset. // @@ -208,26 +204,26 @@ run(const shared_ptr& communicator, const string& appName) cout << "info is incorrect " << flush; } - contactdb->queryDialgroup("frank", dialgroup); - if (dialgroup) + contactDb->queryDialgroup("frank", dialGroup); + if (dialGroup) { - cout << "dialgroup is incorrect " << flush; + cout << "dialGroup is incorrect " << flush; } cout << "ok" << endl; // // Add a contact from "anne". The number field isn't set. // - contactdb->addContact("anne", NumberType::OFFICE, Ice::nullopt, 2); + contactDb->addContact("anne", NumberType::OFFICE, nullopt, 2); cout << "Checking anne... " << flush; - number = contactdb->queryNumber("anne"); + number = contactDb->queryNumber("anne"); if (number) { cout << "number is incorrect " << flush; } - info = contactdb->query("anne"); + info = contactDb->query("anne"); // // The number field should be unset. // @@ -240,10 +236,10 @@ run(const shared_ptr& communicator, const string& appName) cout << "info is incorrect " << flush; } - contactdb->queryDialgroup("anne", dialgroup); - if (!dialgroup || dialgroup != 2) + contactDb->queryDialgroup("anne", dialGroup); + if (!dialGroup || dialGroup != 2) { - cout << "dialgroup is incorrect " << flush; + cout << "dialGroup is incorrect " << flush; } // @@ -252,20 +248,20 @@ run(const shared_ptr& communicator, const string& appName) // the remainder of the fields are unchanged. // const string anneNumber = "456-789-0123"; - contactdb->updateContact("anne", Ice::nullopt, anneNumber, Ice::nullopt); - number = contactdb->queryNumber("anne"); + contactDb->updateContact("anne", nullopt, anneNumber, nullopt); + number = contactDb->queryNumber("anne"); if (number != anneNumber) { cout << "number is incorrect " << flush; } - info = contactdb->query("anne"); + info = contactDb->query("anne"); if (info->number != anneNumber || info->type != NumberType::OFFICE || info->dialGroup != 2) { cout << "info is incorrect " << flush; } cout << "ok" << endl; - contactdb->shutdown(); + contactDb->shutdown(); return 0; } diff --git a/cpp/Ice/optional/ContactDBI.cpp b/cpp/Ice/optional/ContactDBI.cpp index f1773ce2fa..89f73f461c 100644 --- a/cpp/Ice/optional/ContactDBI.cpp +++ b/cpp/Ice/optional/ContactDBI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "ContactDBI.h" #include +#include using namespace std; using namespace Demo; @@ -11,9 +12,9 @@ using namespace Demo; void ContactDBI::addContact( string name, - Ice::optional type, - Ice::optional number, - Ice::optional dialGroup, + optional type, + optional number, + optional dialGroup, const Ice::Current&) { auto contact = make_shared(); @@ -40,9 +41,9 @@ ContactDBI::addContact( void ContactDBI::updateContact( string name, - Ice::optional type, - Ice::optional number, - Ice::optional dialGroup, + optional type, + optional number, + optional dialGroup, const Ice::Current&) { auto p = _contacts.find(name); @@ -74,7 +75,7 @@ ContactDBI::query(string name, const Ice::Current&) return 0; } -Ice::optional +optional ContactDBI::queryNumber(string name, const Ice::Current&) { auto p = _contacts.find(name); @@ -82,11 +83,11 @@ ContactDBI::queryNumber(string name, const Ice::Current&) { return p->second->number; } - return Ice::nullopt; + return nullopt; } void -ContactDBI::queryDialgroup(string name, Ice::optional& dialGroup, const Ice::Current&) +ContactDBI::queryDialgroup(string name, optional& dialGroup, const Ice::Current&) { auto p = _contacts.find(name); if (p != _contacts.end()) diff --git a/cpp/Ice/optional/ContactDBI.h b/cpp/Ice/optional/ContactDBI.h index 1fb0f90d28..9f33759f65 100644 --- a/cpp/Ice/optional/ContactDBI.h +++ b/cpp/Ice/optional/ContactDBI.h @@ -5,32 +5,32 @@ #ifndef CONTACT_I_H #define CONTACT_I_H -#include +#include "Contact.h" -class ContactDBI : public Demo::ContactDB +class ContactDBI final : public Demo::ContactDB { public: - virtual void addContact( + void addContact( std::string, - Ice::optional, - Ice::optional, - Ice::optional, - const Ice::Current&) override; + std::optional, + std::optional, + std::optional, + const Ice::Current&) final; - virtual void updateContact( + void updateContact( std::string, - Ice::optional, - Ice::optional, - Ice::optional, - const Ice::Current&) override; + std::optional, + std::optional, + std::optional, + const Ice::Current&) final; - virtual Demo::ContactPtr query(std::string, const Ice::Current&) override; + Demo::ContactPtr query(std::string name, const Ice::Current& current) final; - virtual Ice::optional queryNumber(std::string, const Ice::Current&) override; + std::optional queryNumber(std::string, const Ice::Current&) final; - virtual void queryDialgroup(std::string, Ice::optional&, const Ice::Current&) override; + void queryDialgroup(std::string, std::optional&, const Ice::Current&) final; - virtual void shutdown(const Ice::Current&) override; + void shutdown(const Ice::Current&) final; private: std::map> _contacts; diff --git a/cpp/Ice/optional/Server.cpp b/cpp/Ice/optional/Server.cpp index 293b6c9b76..27fc45935e 100644 --- a/cpp/Ice/optional/Server.cpp +++ b/cpp/Ice/optional/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "ContactDBI.h" #include +#include using namespace std; diff --git a/cpp/Ice/plugin/Client.cpp b/cpp/Ice/plugin/Client.cpp index eb148aa6c6..4a5aa1b006 100644 --- a/cpp/Ice/plugin/Client.cpp +++ b/cpp/Ice/plugin/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/plugin/LoggerPluginI.cpp b/cpp/Ice/plugin/LoggerPluginI.cpp index df23b86ad3..6234858cf2 100644 --- a/cpp/Ice/plugin/LoggerPluginI.cpp +++ b/cpp/Ice/plugin/LoggerPluginI.cpp @@ -4,6 +4,8 @@ #include +#include + using namespace std; namespace diff --git a/cpp/Ice/plugin/Server.cpp b/cpp/Ice/plugin/Server.cpp index c2e989ed2d..9f5889643f 100644 --- a/cpp/Ice/plugin/Server.cpp +++ b/cpp/Ice/plugin/Server.cpp @@ -3,6 +3,7 @@ // #include +#include using namespace std; diff --git a/cpp/Ice/properties/Client.cpp b/cpp/Ice/properties/Client.cpp index cc9766254e..9133ea9cef 100644 --- a/cpp/Ice/properties/Client.cpp +++ b/cpp/Ice/properties/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Props.h" #include -#include +#include using namespace std; using namespace Demo; @@ -50,7 +51,7 @@ main(int argc, char* argv[]) } void menu(); -void show(const shared_ptr&); +void show(const optional&); int run(const shared_ptr& communicator) @@ -166,7 +167,7 @@ menu() } void -show(const shared_ptr& admin) +show(const optional& admin) { auto props = admin->getPropertiesForPrefix("Demo"); cout << "Server's current settings:" << endl; diff --git a/cpp/Ice/properties/Props.ice b/cpp/Ice/properties/Props.ice index 76a93c39bd..112c11f288 100644 --- a/cpp/Ice/properties/Props.ice +++ b/cpp/Ice/properties/Props.ice @@ -4,7 +4,7 @@ #pragma once -#include +#include module Demo { diff --git a/cpp/Ice/properties/Server.cpp b/cpp/Ice/properties/Server.cpp index e9de580b15..a191a127d5 100644 --- a/cpp/Ice/properties/Server.cpp +++ b/cpp/Ice/properties/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Props.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/session/Client.cpp b/cpp/Ice/session/Client.cpp index 18d92191b8..6d25d81474 100644 --- a/cpp/Ice/session/Client.cpp +++ b/cpp/Ice/session/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Session.h" #include -#include +#include using namespace std; using namespace Demo; @@ -72,7 +73,7 @@ run(const shared_ptr& communicator) auto session = factory->create(name); - vector> hellos; + vector> hellos; menu(); diff --git a/cpp/Ice/session/Server.cpp b/cpp/Ice/session/Server.cpp index 4353295ce5..07e759ebdf 100644 --- a/cpp/Ice/session/Server.cpp +++ b/cpp/Ice/session/Server.cpp @@ -2,7 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "SessionFactoryI.h" +#include using namespace std; using namespace Demo; diff --git a/cpp/Ice/session/SessionFactoryI.cpp b/cpp/Ice/session/SessionFactoryI.cpp index 7fbba47c69..d1502d936d 100644 --- a/cpp/Ice/session/SessionFactoryI.cpp +++ b/cpp/Ice/session/SessionFactoryI.cpp @@ -2,13 +2,14 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include -#include +#include "SessionFactoryI.h" +#include "SessionI.h" +#include using namespace std; using namespace Demo; -shared_ptr +optional SessionFactoryI::create(string name, const Ice::Current& current) { auto session = make_shared(name); @@ -21,10 +22,6 @@ SessionFactoryI::create(string name, const Ice::Current& current) // auto collocProxy = proxy->ice_endpoints(Ice::EndpointSeq()); - // - // Never close this connection from the client and turn on heartbeats with a timeout of 30s - // - current.con->setACM(30, Ice::ACMClose::CloseOff, Ice::ACMHeartbeat::HeartbeatAlways); current.con->setCloseCallback( [collocProxy](const shared_ptr&) { diff --git a/cpp/Ice/session/SessionFactoryI.h b/cpp/Ice/session/SessionFactoryI.h index 08a46588ec..4079019a60 100644 --- a/cpp/Ice/session/SessionFactoryI.h +++ b/cpp/Ice/session/SessionFactoryI.h @@ -5,14 +5,14 @@ #ifndef SESSION_FACTORY_I_H #define SESSION_FACTORY_I_H +#include "Session.h" #include -#include -class SessionFactoryI : public Demo::SessionFactory +class SessionFactoryI final : public Demo::SessionFactory { public: - virtual std::shared_ptr create(std::string, const Ice::Current&) override; - virtual void shutdown(const Ice::Current&) override; + std::optional create(std::string, const Ice::Current&) final; + void shutdown(const Ice::Current&) final; }; #endif diff --git a/cpp/Ice/session/SessionI.cpp b/cpp/Ice/session/SessionI.cpp index 0ecae68815..da1511f9ff 100644 --- a/cpp/Ice/session/SessionI.cpp +++ b/cpp/Ice/session/SessionI.cpp @@ -2,7 +2,8 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "SessionI.h" +#include using namespace std; using namespace Demo; @@ -30,7 +31,7 @@ SessionI::SessionI(string name) : _name(std::move(name)), _nextId(0), _destroy(f cout << "The session " << _name << " is now created." << endl; } -shared_ptr +optional SessionI::createHello(const Ice::Current& current) { const lock_guard sync(_mutex); diff --git a/cpp/Ice/session/SessionI.h b/cpp/Ice/session/SessionI.h index e845f7805d..8678a2675a 100644 --- a/cpp/Ice/session/SessionI.h +++ b/cpp/Ice/session/SessionI.h @@ -5,25 +5,25 @@ #ifndef SESSION_I_H #define SESSION_I_H +#include "Session.h" #include -#include #include #include -class SessionI : public Demo::Session +class SessionI final : public Demo::Session { public: SessionI(std::string); - virtual std::shared_ptr createHello(const Ice::Current&) override; - virtual std::string getName(const Ice::Current&) override; - virtual void destroy(const Ice::Current&) override; + std::optional createHello(const Ice::Current&) final; + std::string getName(const Ice::Current&) final; + void destroy(const Ice::Current&) final; private: std::mutex _mutex; const std::string _name; int _nextId; // The per-session id of the next hello object. This is used for tracing purposes. - std::list> _objs; // List of per-session allocated hello objects. + std::list> _objs; // List of per-session allocated hello objects. bool _destroy; }; #endif diff --git a/cpp/Ice/throughput/Client.cpp b/cpp/Ice/throughput/Client.cpp index 953ad78028..abb006a8d0 100644 --- a/cpp/Ice/throughput/Client.cpp +++ b/cpp/Ice/throughput/Client.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Throughput.h" #include -#include #include +#include using namespace std; using namespace Demo; @@ -69,7 +70,7 @@ run(const shared_ptr& communicator) auto byteArr = make_pair(byteSeq.data(), byteSeq.data() + byteSeq.size()); StringSeq stringSeq(StringSeqSize, "hello"); - const vector stringViewSeq(StringSeqSize, "hello"); + const vector stringViewSeq(StringSeqSize, "hello"); StringDoubleSeq structSeq(StringDoubleSeqSize, {"hello", 3.14}); const FixedSeq fixedSeq(FixedSeqSize, {0, 0, 0.0}); @@ -87,7 +88,7 @@ run(const shared_ptr& communicator) ByteSeq warmupBytesBuf(1); auto warmupBytes = make_pair(warmupBytesBuf.data(), warmupBytesBuf.data() + warmupBytesBuf.size()); - const vector warmupStringViews(1); + const vector warmupStringViews(1); const StringDoubleSeq warmupStructs(1); const FixedSeq warmupFixed(1); diff --git a/cpp/Ice/throughput/Server.cpp b/cpp/Ice/throughput/Server.cpp index 12441b35d9..a35d2e6b90 100644 --- a/cpp/Ice/throughput/Server.cpp +++ b/cpp/Ice/throughput/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "ThroughputI.h" #include -#include +#include using namespace std; diff --git a/cpp/Ice/throughput/Throughput.ice b/cpp/Ice/throughput/Throughput.ice index d038ed592c..431f749f69 100644 --- a/cpp/Ice/throughput/Throughput.ice +++ b/cpp/Ice/throughput/Throughput.ice @@ -41,10 +41,9 @@ module Demo ["marshaled-result", "cpp:array"] ByteSeq recvByteSeq(); ["marshaled-result", "cpp:array"] ByteSeq echoByteSeq(["cpp:array"] ByteSeq seq); - void sendStringSeq(["cpp:view-type:std::vector"] StringSeq seq); - ["marshaled-result", "cpp:view-type:std::vector"] StringSeq recvStringSeq(); - ["marshaled-result", "cpp:view-type:std::vector"] StringSeq echoStringSeq( - ["cpp:view-type:std::vector"] StringSeq seq); + void sendStringSeq(StringSeq seq); + ["marshaled-result"] StringSeq recvStringSeq(); + ["marshaled-result"] StringSeq echoStringSeq(StringSeq seq); void sendStructSeq(StringDoubleSeq seq); StringDoubleSeq recvStructSeq(); diff --git a/cpp/Ice/throughput/ThroughputI.cpp b/cpp/Ice/throughput/ThroughputI.cpp index 583217beb9..efcca90fba 100644 --- a/cpp/Ice/throughput/ThroughputI.cpp +++ b/cpp/Ice/throughput/ThroughputI.cpp @@ -8,7 +8,6 @@ ThroughputI::ThroughputI() : _byteSeq(Demo::ByteSeqSize), _stringSeq(Demo::StringSeqSize, "hello"), - _stringViewSeq(Demo::StringSeqSize, "hello"), _structSeq(Demo::StringDoubleSeqSize, {"hello", 3.14}), _fixedSeq(Demo::FixedSeqSize, {0, 0, 0.0}), _warmup(false) @@ -35,7 +34,7 @@ ThroughputI::endWarmup(const Ice::Current&) } void -ThroughputI::sendByteSeq(std::pair, const Ice::Current&) +ThroughputI::sendByteSeq(std::pair, const Ice::Current&) { } @@ -45,26 +44,26 @@ ThroughputI::recvByteSeq(const Ice::Current& current) if (_warmup) { Demo::ByteSeq warmupBytesBuf(1); - const std::pair ret = + const std::pair ret = std::make_pair(warmupBytesBuf.data(), warmupBytesBuf.data() + warmupBytesBuf.size()); return RecvByteSeqMarshaledResult(ret, current); } else { - const std::pair ret = + const std::pair ret = std::make_pair(_byteSeq.data(), _byteSeq.data() + _byteSeq.size()); return RecvByteSeqMarshaledResult(ret, current); } } Demo::Throughput::EchoByteSeqMarshaledResult -ThroughputI::echoByteSeq(std::pair seq, const Ice::Current& current) +ThroughputI::echoByteSeq(std::pair seq, const Ice::Current& current) { return EchoByteSeqMarshaledResult(seq, current); } void -ThroughputI::sendStringSeq(std::vector, const Ice::Current&) +ThroughputI::sendStringSeq(std::vector, const Ice::Current&) { } @@ -73,16 +72,16 @@ ThroughputI::recvStringSeq(const Ice::Current& current) { if (_warmup) { - return RecvStringSeqMarshaledResult(std::vector(1), current); + return RecvStringSeqMarshaledResult(std::vector(1), current); } else { - return RecvStringSeqMarshaledResult(_stringViewSeq, current); + return RecvStringSeqMarshaledResult(_stringSeq, current); } } Demo::Throughput::EchoStringSeqMarshaledResult -ThroughputI::echoStringSeq(std::vector seq, const Ice::Current& current) +ThroughputI::echoStringSeq(std::vector seq, const Ice::Current& current) { return EchoStringSeqMarshaledResult(seq, current); } diff --git a/cpp/Ice/throughput/ThroughputI.h b/cpp/Ice/throughput/ThroughputI.h index 7220a3f5a8..4cf5b64f39 100644 --- a/cpp/Ice/throughput/ThroughputI.h +++ b/cpp/Ice/throughput/ThroughputI.h @@ -5,40 +5,38 @@ #ifndef THROUGHPUT_I_H #define THROUGHPUT_I_H -#include +#include "Throughput.h" -class ThroughputI : public Demo::Throughput +class ThroughputI final : public Demo::Throughput { public: ThroughputI(); - virtual bool needsWarmup(const Ice::Current&) override; - virtual void startWarmup(const Ice::Current&) override; - virtual void endWarmup(const Ice::Current&) override; + bool needsWarmup(const Ice::Current&) final; + void startWarmup(const Ice::Current&) final; + void endWarmup(const Ice::Current&) final; - virtual void sendByteSeq(std::pair, const Ice::Current&) override; - virtual RecvByteSeqMarshaledResult recvByteSeq(const Ice::Current&) override; - virtual EchoByteSeqMarshaledResult - echoByteSeq(std::pair, const Ice::Current&) override; + void sendByteSeq(std::pair, const Ice::Current&) final; + RecvByteSeqMarshaledResult recvByteSeq(const Ice::Current&) final; + EchoByteSeqMarshaledResult echoByteSeq(std::pair, const Ice::Current&) final; - virtual void sendStringSeq(std::vector, const Ice::Current&) override; - virtual RecvStringSeqMarshaledResult recvStringSeq(const Ice::Current&) override; - virtual EchoStringSeqMarshaledResult echoStringSeq(std::vector, const Ice::Current&) override; + void sendStringSeq(std::vector, const Ice::Current&) final; + RecvStringSeqMarshaledResult recvStringSeq(const Ice::Current&) final; + EchoStringSeqMarshaledResult echoStringSeq(std::vector, const Ice::Current&) final; - virtual void sendStructSeq(Demo::StringDoubleSeq, const Ice::Current&) override; - virtual Demo::StringDoubleSeq recvStructSeq(const Ice::Current&) override; - virtual Demo::StringDoubleSeq echoStructSeq(Demo::StringDoubleSeq, const Ice::Current&) override; + void sendStructSeq(Demo::StringDoubleSeq, const Ice::Current&) final; + Demo::StringDoubleSeq recvStructSeq(const Ice::Current&) final; + Demo::StringDoubleSeq echoStructSeq(Demo::StringDoubleSeq, const Ice::Current&) final; - virtual void sendFixedSeq(Demo::FixedSeq, const Ice::Current&) override; - virtual Demo::FixedSeq recvFixedSeq(const Ice::Current&) override; - virtual Demo::FixedSeq echoFixedSeq(Demo::FixedSeq, const Ice::Current&) override; + void sendFixedSeq(Demo::FixedSeq, const Ice::Current&) final; + Demo::FixedSeq recvFixedSeq(const Ice::Current&) final; + Demo::FixedSeq echoFixedSeq(Demo::FixedSeq, const Ice::Current&) final; - virtual void shutdown(const Ice::Current&) override; + void shutdown(const Ice::Current&) final; private: Demo::ByteSeq _byteSeq; Demo::StringSeq _stringSeq; - std::vector _stringViewSeq; Demo::StringDoubleSeq _structSeq; Demo::FixedSeq _fixedSeq; diff --git a/cpp/IceBox/hello/Client.cpp b/cpp/IceBox/hello/Client.cpp index 63d54057f6..4ca5b629b9 100644 --- a/cpp/IceBox/hello/Client.cpp +++ b/cpp/IceBox/hello/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/IceBox/hello/HelloI.cpp b/cpp/IceBox/hello/HelloI.cpp index 03eec19da2..59710360f1 100644 --- a/cpp/IceBox/hello/HelloI.cpp +++ b/cpp/IceBox/hello/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceBox/hello/README.md b/cpp/IceBox/hello/README.md index 2721f01d8a..a0a48f5139 100644 --- a/cpp/IceBox/hello/README.md +++ b/cpp/IceBox/hello/README.md @@ -3,7 +3,7 @@ To run this demo, open two terminal windows. In the first window, start the IceBox server: ``` -icebox++11 --Ice.Config=config.icebox +icebox --Ice.Config=config.icebox ``` In the second window, run the client: @@ -20,6 +20,6 @@ Linux 32-bit ------------ If you are using 32-bit binaries on a Linux 64-bit host, use -`icebox32++11` instead of `icebox++11` to start the IceBox server. +`icebox32` instead of `icebox` to start the IceBox server. [1]: https://doc.zeroc.com/ice/3.7/icebox diff --git a/cpp/IceDiscovery/hello/Client.cpp b/cpp/IceDiscovery/hello/Client.cpp index 92a133fdb7..abe5d49585 100644 --- a/cpp/IceDiscovery/hello/Client.cpp +++ b/cpp/IceDiscovery/hello/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/IceDiscovery/hello/HelloI.cpp b/cpp/IceDiscovery/hello/HelloI.cpp index 07ef89de15..77b1464cea 100644 --- a/cpp/IceDiscovery/hello/HelloI.cpp +++ b/cpp/IceDiscovery/hello/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include #include using namespace std; diff --git a/cpp/IceDiscovery/hello/Server.cpp b/cpp/IceDiscovery/hello/Server.cpp index feaa75bd98..8945f4aa95 100644 --- a/cpp/IceDiscovery/hello/Server.cpp +++ b/cpp/IceDiscovery/hello/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceDiscovery/replication/Client.cpp b/cpp/IceDiscovery/replication/Client.cpp index 6760f167fb..73ce5a3dc2 100644 --- a/cpp/IceDiscovery/replication/Client.cpp +++ b/cpp/IceDiscovery/replication/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include #include using namespace std; diff --git a/cpp/IceDiscovery/replication/HelloI.cpp b/cpp/IceDiscovery/replication/HelloI.cpp index 65285839a4..f25ce4abde 100644 --- a/cpp/IceDiscovery/replication/HelloI.cpp +++ b/cpp/IceDiscovery/replication/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceDiscovery/replication/Server.cpp b/cpp/IceDiscovery/replication/Server.cpp index 2d4c0a5728..8258a8a368 100644 --- a/cpp/IceDiscovery/replication/Server.cpp +++ b/cpp/IceDiscovery/replication/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/allocate/Client.cpp b/cpp/IceGrid/allocate/Client.cpp index 5659cb56a5..9fe4348aa1 100644 --- a/cpp/IceGrid/allocate/Client.cpp +++ b/cpp/IceGrid/allocate/Client.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include #include +#include using namespace std; using namespace Demo; @@ -65,7 +66,7 @@ run(const shared_ptr& communicator) return 1; } - shared_ptr session; + optional session; while (!session) { cout << "This demo accepts any user-id / password combination.\n"; @@ -91,12 +92,6 @@ run(const shared_ptr& communicator) } } - // - // Enable heartbeats on the session connection to maintain the - // connection alive even if idle. - // - session->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatAlways); - try { // @@ -105,7 +100,7 @@ run(const shared_ptr& communicator) // we retrieve object by type, which will succeed if the // application-multiple.xml descriptor is used. // - shared_ptr hello; + optional hello; try { hello = Ice::checkedCast(session->allocateObjectById(Ice::stringToIdentity("hello"))); diff --git a/cpp/IceGrid/allocate/HelloI.cpp b/cpp/IceGrid/allocate/HelloI.cpp index 260bb15c54..435451f8d4 100644 --- a/cpp/IceGrid/allocate/HelloI.cpp +++ b/cpp/IceGrid/allocate/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/allocate/Server.cpp b/cpp/IceGrid/allocate/Server.cpp index fffacfff25..14dc5741e7 100644 --- a/cpp/IceGrid/allocate/Server.cpp +++ b/cpp/IceGrid/allocate/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/customLocator/Client.cpp b/cpp/IceGrid/customLocator/Client.cpp index 9a1cbb362f..feaa2db108 100644 --- a/cpp/IceGrid/customLocator/Client.cpp +++ b/cpp/IceGrid/customLocator/Client.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include #include +#include using namespace std; using namespace Demo; diff --git a/cpp/IceGrid/customLocator/HelloI.cpp b/cpp/IceGrid/customLocator/HelloI.cpp index 260bb15c54..435451f8d4 100644 --- a/cpp/IceGrid/customLocator/HelloI.cpp +++ b/cpp/IceGrid/customLocator/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/customLocator/Locator.cpp b/cpp/IceGrid/customLocator/Locator.cpp index 51cdc420dd..63ce2c7ab9 100644 --- a/cpp/IceGrid/customLocator/Locator.cpp +++ b/cpp/IceGrid/customLocator/Locator.cpp @@ -3,6 +3,7 @@ // #include +#include using namespace std; @@ -16,42 +17,42 @@ namespace class LocatorRegistryI : public Ice::LocatorRegistry { public: - explicit LocatorRegistryI(const shared_ptr& registry) : _registry(registry) {} + explicit LocatorRegistryI(const optional& registry) : _registry(registry) {} - virtual void setAdapterDirectProxyAsync( + void setAdapterDirectProxyAsync( string id, - shared_ptr proxy, + optional proxy, function response, function exception, - const Ice::Current&) override + const Ice::Current&) final { // AMI call using the AMD callbacks _registry->setAdapterDirectProxyAsync(id, proxy, response, exception); } - virtual void setReplicatedAdapterDirectProxyAsync( + void setReplicatedAdapterDirectProxyAsync( string id, string group, - shared_ptr proxy, + optional proxy, function response, function exception, - const Ice::Current&) override + const Ice::Current&) final { _registry->setReplicatedAdapterDirectProxyAsync(id, group, proxy, response, exception); } - virtual void setServerProcessProxyAsync( + void setServerProcessProxyAsync( string id, - shared_ptr proxy, + optional proxy, function response, function exception, - const Ice::Current&) override + const Ice::Current&) final { _registry->setServerProcessProxyAsync(id, proxy, response, exception); } private: - const shared_ptr _registry; + const optional _registry; }; // @@ -61,17 +62,17 @@ namespace class LocatorI : public Ice::Locator { public: - LocatorI(const shared_ptr& locator, const shared_ptr& registry) + LocatorI(const optional& locator, const optional& registry) : _locator(locator), _registry(registry) { } - virtual void findObjectByIdAsync( + void findObjectByIdAsync( Ice::Identity id, - function&)> response, + function&)> response, function exception, - const Ice::Current& current) const override + const Ice::Current& current) const final { auto p = current.ctx.find("SECRET"); if (p != current.ctx.end() && p->second == "LetMeIn") @@ -80,15 +81,15 @@ namespace } else { - response(nullptr); + response(nullopt); } } - virtual void findAdapterByIdAsync( + void findAdapterByIdAsync( string id, - function&)> response, + function&)> response, function exception, - const Ice::Current& current) const override + const Ice::Current& current) const final { auto p = current.ctx.find("SECRET"); if (p != current.ctx.end() && p->second == "LetMeIn") @@ -97,18 +98,15 @@ namespace } else { - response(nullptr); + response(nullopt); } } - virtual shared_ptr getRegistry(const Ice::Current&) const override - { - return _registry; - } + optional getRegistry(const Ice::Current&) const final { return _registry; } private: - const shared_ptr _locator; - const shared_ptr _registry; + const optional _locator; + const optional _registry; }; } diff --git a/cpp/IceGrid/customLocator/Server.cpp b/cpp/IceGrid/customLocator/Server.cpp index 79050b4521..f15d4c08e7 100644 --- a/cpp/IceGrid/customLocator/Server.cpp +++ b/cpp/IceGrid/customLocator/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/icebox/Client.cpp b/cpp/IceGrid/icebox/Client.cpp index e383e9fceb..f043104563 100644 --- a/cpp/IceGrid/icebox/Client.cpp +++ b/cpp/IceGrid/icebox/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/IceGrid/icebox/HelloI.cpp b/cpp/IceGrid/icebox/HelloI.cpp index 4d497c3477..915bf401b2 100644 --- a/cpp/IceGrid/icebox/HelloI.cpp +++ b/cpp/IceGrid/icebox/HelloI.cpp @@ -2,13 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#ifdef _MSC_VER -// For getenv -# define _CRT_SECURE_NO_WARNINGS -#endif - -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/icebox/application.xml b/cpp/IceGrid/icebox/application.xml index a44376d6e2..9380d0deef 100644 --- a/cpp/IceGrid/icebox/application.xml +++ b/cpp/IceGrid/icebox/application.xml @@ -4,10 +4,10 @@ - - - - + + + + @@ -18,8 +18,7 @@ - + @@ -34,7 +33,6 @@ - @@ -46,10 +44,7 @@ - + diff --git a/cpp/IceGrid/replication/Client.cpp b/cpp/IceGrid/replication/Client.cpp index afe1429aaa..51acaf271c 100644 --- a/cpp/IceGrid/replication/Client.cpp +++ b/cpp/IceGrid/replication/Client.cpp @@ -2,10 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include #include #include +#include #include using namespace std; diff --git a/cpp/IceGrid/replication/HelloI.cpp b/cpp/IceGrid/replication/HelloI.cpp index 9cce263e72..b3e97614f2 100644 --- a/cpp/IceGrid/replication/HelloI.cpp +++ b/cpp/IceGrid/replication/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/replication/Server.cpp b/cpp/IceGrid/replication/Server.cpp index a1559c0db9..218bf8df12 100644 --- a/cpp/IceGrid/replication/Server.cpp +++ b/cpp/IceGrid/replication/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/secure/Client.cpp b/cpp/IceGrid/secure/Client.cpp index c0f86954e7..3370714ad2 100644 --- a/cpp/IceGrid/secure/Client.cpp +++ b/cpp/IceGrid/secure/Client.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include #include +#include using namespace std; using namespace Demo; @@ -60,7 +61,7 @@ run(const shared_ptr& communicator) // identity. If it's not registered with the registry, we // search for an object with the ::Demo::Hello type. // - shared_ptr hello; + optional hello; try { hello = Ice::checkedCast(communicator->stringToProxy("hello")); diff --git a/cpp/IceGrid/secure/HelloI.cpp b/cpp/IceGrid/secure/HelloI.cpp index 260bb15c54..435451f8d4 100644 --- a/cpp/IceGrid/secure/HelloI.cpp +++ b/cpp/IceGrid/secure/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/secure/Server.cpp b/cpp/IceGrid/secure/Server.cpp index 9a7da54406..2dc0bf03ad 100644 --- a/cpp/IceGrid/secure/Server.cpp +++ b/cpp/IceGrid/secure/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/secure/config.glacier2 b/cpp/IceGrid/secure/config.glacier2 index a4db8a8372..77e1c92101 100644 --- a/cpp/IceGrid/secure/config.glacier2 +++ b/cpp/IceGrid/secure/config.glacier2 @@ -9,8 +9,6 @@ Glacier2.Server.Endpoints=ssl -h localhost Glacier2.SessionManager=DemoIceGrid/AdminSessionManager Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier -Glacier2.SessionTimeout=30 - Ice.Default.Locator=DemoIceGrid/Locator:ssl -h localhost -p 4062 # diff --git a/cpp/IceGrid/sessionActivation/Client.cpp b/cpp/IceGrid/sessionActivation/Client.cpp index 5ecdb54c0a..6bedd59b47 100644 --- a/cpp/IceGrid/sessionActivation/Client.cpp +++ b/cpp/IceGrid/sessionActivation/Client.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include #include +#include using namespace std; using namespace Demo; @@ -65,7 +66,7 @@ run(const shared_ptr& communicator) return 1; } - shared_ptr session; + optional session; while (!session) { cout << "This demo accepts any user-id / password combination.\n"; @@ -91,12 +92,6 @@ run(const shared_ptr& communicator) } } - // - // Enable heartbeats on the session connection to maintain the - // connection alive even if idle. - // - session->ice_getConnection()->setACM(registry->getACMTimeout(), Ice::nullopt, Ice::ACMHeartbeat::HeartbeatOnIdle); - try { auto hello = Ice::checkedCast(session->allocateObjectById(Ice::stringToIdentity("hello"))); diff --git a/cpp/IceGrid/sessionActivation/HelloI.cpp b/cpp/IceGrid/sessionActivation/HelloI.cpp index 7349636828..da44c0265d 100644 --- a/cpp/IceGrid/sessionActivation/HelloI.cpp +++ b/cpp/IceGrid/sessionActivation/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/sessionActivation/Server.cpp b/cpp/IceGrid/sessionActivation/Server.cpp index fffacfff25..14dc5741e7 100644 --- a/cpp/IceGrid/sessionActivation/Server.cpp +++ b/cpp/IceGrid/sessionActivation/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/simple/Client.cpp b/cpp/IceGrid/simple/Client.cpp index c0f86954e7..3370714ad2 100644 --- a/cpp/IceGrid/simple/Client.cpp +++ b/cpp/IceGrid/simple/Client.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "Hello.h" #include #include +#include using namespace std; using namespace Demo; @@ -60,7 +61,7 @@ run(const shared_ptr& communicator) // identity. If it's not registered with the registry, we // search for an object with the ::Demo::Hello type. // - shared_ptr hello; + optional hello; try { hello = Ice::checkedCast(communicator->stringToProxy("hello")); diff --git a/cpp/IceGrid/simple/HelloI.cpp b/cpp/IceGrid/simple/HelloI.cpp index f34c6681f7..86349ebcca 100644 --- a/cpp/IceGrid/simple/HelloI.cpp +++ b/cpp/IceGrid/simple/HelloI.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceGrid/simple/Server.cpp b/cpp/IceGrid/simple/Server.cpp index 6f4bcea8f6..7214aa3a4d 100644 --- a/cpp/IceGrid/simple/Server.cpp +++ b/cpp/IceGrid/simple/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "HelloI.h" #include +#include using namespace std; diff --git a/cpp/IceStorm/clock/Publisher.cpp b/cpp/IceStorm/clock/Publisher.cpp index e01b776e80..bde6fa9f58 100644 --- a/cpp/IceStorm/clock/Publisher.cpp +++ b/cpp/IceStorm/clock/Publisher.cpp @@ -2,16 +2,12 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#ifdef _MSC_VER -// For localtime warning -# define _CRT_SECURE_NO_WARNINGS -#endif - -#include +#include "Clock.h" #include #include #include #include +#include #include using namespace std; @@ -125,7 +121,7 @@ run(const shared_ptr& communicator, int argc, char* argv[]) // // Retrieve the topic. // - shared_ptr topic; + optional topic; try { topic = manager->retrieve(topicName); diff --git a/cpp/IceStorm/clock/Subscriber.cpp b/cpp/IceStorm/clock/Subscriber.cpp index acfacefaca..bf2496c051 100644 --- a/cpp/IceStorm/clock/Subscriber.cpp +++ b/cpp/IceStorm/clock/Subscriber.cpp @@ -2,10 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Clock.h" #include #include - -#include +#include using namespace std; using namespace Demo; @@ -164,7 +164,7 @@ run(const shared_ptr& communicator, int argc, char* argv[]) return 1; } - shared_ptr topic; + optional topic; try { topic = manager->retrieve(topicName); diff --git a/cpp/IceStorm/clock/config.icebox b/cpp/IceStorm/clock/config.icebox index 31773667a7..f6ef8b4de1 100644 --- a/cpp/IceStorm/clock/config.icebox +++ b/cpp/IceStorm/clock/config.icebox @@ -10,7 +10,7 @@ Ice.Admin.InstanceName=icebox # The IceStorm service. The service is configured using a separate # configuration file (see config.service). # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions diff --git a/cpp/IceStorm/counter/Client.cpp b/cpp/IceStorm/counter/Client.cpp index 8cdf3dd8e3..abaa1eaebd 100644 --- a/cpp/IceStorm/counter/Client.cpp +++ b/cpp/IceStorm/counter/Client.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "CounterObserverI.h" #include +#include using namespace std; using namespace Demo; diff --git a/cpp/IceStorm/counter/CounterI.cpp b/cpp/IceStorm/counter/CounterI.cpp index e1e5a6faf7..a39b676c8b 100644 --- a/cpp/IceStorm/counter/CounterI.cpp +++ b/cpp/IceStorm/counter/CounterI.cpp @@ -2,21 +2,20 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "CounterI.h" #include -#include - using namespace std; using namespace Demo; -CounterI::CounterI(const shared_ptr& topic) +CounterI::CounterI(const optional& topic) : _topic(topic), _publisher(Ice::uncheckedCast(topic->getPublisher())) { } void -CounterI::subscribe(shared_ptr observer, const Ice::Current&) +CounterI::subscribe(optional observer, const Ice::Current&) { const lock_guard sync(_mutex); @@ -30,7 +29,7 @@ CounterI::subscribe(shared_ptr observer, const Ice::Current& } void -CounterI::unsubscribe(shared_ptr observer, const Ice::Current&) +CounterI::unsubscribe(optional observer, const Ice::Current&) { _topic->unsubscribe(observer); } diff --git a/cpp/IceStorm/counter/CounterI.h b/cpp/IceStorm/counter/CounterI.h index 357c8731f5..ef59016aed 100644 --- a/cpp/IceStorm/counter/CounterI.h +++ b/cpp/IceStorm/counter/CounterI.h @@ -5,24 +5,24 @@ #ifndef COUNTER_I_H #define COUNTER_I_H -#include +#include "Counter.h" #include #include -class CounterI : public Demo::Counter +class CounterI final : public Demo::Counter { public: - CounterI(const std::shared_ptr&); + CounterI(const std::optional&); - virtual void subscribe(std::shared_ptr, const Ice::Current&) override; - virtual void unsubscribe(std::shared_ptr, const Ice::Current&) override; - virtual void inc(int value, const Ice::Current&) override; + void subscribe(std::optional, const Ice::Current&) final; + void unsubscribe(std::optional, const Ice::Current&) final; + void inc(int value, const Ice::Current&) final; private: std::mutex _mutex; int _value = 0; - std::shared_ptr _topic; - std::shared_ptr _publisher; + std::optional _topic; + std::optional _publisher; }; #endif diff --git a/cpp/IceStorm/counter/CounterObserverI.cpp b/cpp/IceStorm/counter/CounterObserverI.cpp index e9322757ed..b40079ec1b 100644 --- a/cpp/IceStorm/counter/CounterObserverI.cpp +++ b/cpp/IceStorm/counter/CounterObserverI.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "CounterObserverI.h" #include - -#include +#include using namespace std; diff --git a/cpp/IceStorm/counter/Server.cpp b/cpp/IceStorm/counter/Server.cpp index a65709f7fa..40ec8b440c 100644 --- a/cpp/IceStorm/counter/Server.cpp +++ b/cpp/IceStorm/counter/Server.cpp @@ -2,11 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "CounterI.h" #include #include - -#include - +#include #include using namespace std; @@ -53,7 +52,7 @@ main(int argc, char* argv[]) return 1; } - shared_ptr topic; + optional topic; try { topic = manager->retrieve("counter"); diff --git a/cpp/IceStorm/counter/config.icebox b/cpp/IceStorm/counter/config.icebox index 30e943fa14..7b051315ea 100644 --- a/cpp/IceStorm/counter/config.icebox +++ b/cpp/IceStorm/counter/config.icebox @@ -7,7 +7,7 @@ Ice.Admin.InstanceName=icebox # # The IceStorm service # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions diff --git a/cpp/IceStorm/replicated/Publisher.cpp b/cpp/IceStorm/replicated/Publisher.cpp index e01b776e80..bc9b051885 100644 --- a/cpp/IceStorm/replicated/Publisher.cpp +++ b/cpp/IceStorm/replicated/Publisher.cpp @@ -7,11 +7,12 @@ # define _CRT_SECURE_NO_WARNINGS #endif -#include +#include "Clock.h" #include #include #include #include +#include #include using namespace std; @@ -125,7 +126,7 @@ run(const shared_ptr& communicator, int argc, char* argv[]) // // Retrieve the topic. // - shared_ptr topic; + optional topic; try { topic = manager->retrieve(topicName); diff --git a/cpp/IceStorm/replicated/Subscriber.cpp b/cpp/IceStorm/replicated/Subscriber.cpp index dc7d217f0c..59abfbe191 100644 --- a/cpp/IceStorm/replicated/Subscriber.cpp +++ b/cpp/IceStorm/replicated/Subscriber.cpp @@ -2,18 +2,18 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Clock.h" #include #include - -#include +#include using namespace std; using namespace Demo; -class ClockI : public Clock +class ClockI final : public Clock { public: - virtual void tick(string time, const Ice::Current&) override { cout << time << endl; } + void tick(string time, const Ice::Current&) final { cout << time << endl; } }; int run(const shared_ptr& communicator, int argc, char* argv[]); @@ -177,7 +177,7 @@ run(const shared_ptr& communicator, int argc, char* argv[]) return 1; } - shared_ptr topic; + optional topic; try { topic = manager->retrieve(topicName); diff --git a/cpp/IceStorm/replicated/application.xml b/cpp/IceStorm/replicated/application.xml index f1dfdd1d43..2b85cdd530 100644 --- a/cpp/IceStorm/replicated/application.xml +++ b/cpp/IceStorm/replicated/application.xml @@ -3,66 +3,61 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cpp/IceStorm/replicated2/Publisher.cpp b/cpp/IceStorm/replicated2/Publisher.cpp index e01b776e80..bc9b051885 100644 --- a/cpp/IceStorm/replicated2/Publisher.cpp +++ b/cpp/IceStorm/replicated2/Publisher.cpp @@ -7,11 +7,12 @@ # define _CRT_SECURE_NO_WARNINGS #endif -#include +#include "Clock.h" #include #include #include #include +#include #include using namespace std; @@ -125,7 +126,7 @@ run(const shared_ptr& communicator, int argc, char* argv[]) // // Retrieve the topic. // - shared_ptr topic; + optional topic; try { topic = manager->retrieve(topicName); diff --git a/cpp/IceStorm/replicated2/Subscriber.cpp b/cpp/IceStorm/replicated2/Subscriber.cpp index f71bad9211..42f2875124 100644 --- a/cpp/IceStorm/replicated2/Subscriber.cpp +++ b/cpp/IceStorm/replicated2/Subscriber.cpp @@ -2,10 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Clock.h" #include #include - -#include +#include using namespace std; using namespace Demo; @@ -177,7 +177,7 @@ run(const shared_ptr& communicator, int argc, char* argv[]) return 1; } - shared_ptr topic; + optional topic; try { topic = manager->retrieve(topicName); diff --git a/cpp/IceStorm/replicated2/config.ib1 b/cpp/IceStorm/replicated2/config.ib1 index 5d1ef91d42..13bb2f86f9 100644 --- a/cpp/IceStorm/replicated2/config.ib1 +++ b/cpp/IceStorm/replicated2/config.ib1 @@ -7,7 +7,7 @@ Ice.Admin.InstanceName=icebox1 # # The IceStorm service # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.s1 +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.s1 # # Warn about connection exceptions diff --git a/cpp/IceStorm/replicated2/config.ib2 b/cpp/IceStorm/replicated2/config.ib2 index f277e91abc..2cae416a89 100644 --- a/cpp/IceStorm/replicated2/config.ib2 +++ b/cpp/IceStorm/replicated2/config.ib2 @@ -7,7 +7,7 @@ Ice.Admin.InstanceName=icebox2 # # The IceStorm service # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.s2 +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.s2 # # Warn about connection exceptions diff --git a/cpp/IceStorm/replicated2/config.ib3 b/cpp/IceStorm/replicated2/config.ib3 index bc1668d998..c92f18caef 100644 --- a/cpp/IceStorm/replicated2/config.ib3 +++ b/cpp/IceStorm/replicated2/config.ib3 @@ -7,7 +7,7 @@ Ice.Admin.InstanceName=icebox3 # # The IceStorm service # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.s3 +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.s3 # # Warn about connection exceptions diff --git a/cpp/Makefile b/cpp/Makefile index a73af538b3..f3512358e9 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -3,7 +3,7 @@ # top_srcdir := .. -lang_srcdir := $(top_srcdir)/cpp11 +lang_srcdir := $(top_srcdir)/cpp include $(top_srcdir)/make/Make.rules include $(lang_srcdir)/make/Make.rules diff --git a/cpp/Manual/evictor/EvictorBase.cpp b/cpp/Manual/evictor/EvictorBase.cpp deleted file mode 100644 index b112287261..0000000000 --- a/cpp/Manual/evictor/EvictorBase.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include - -using namespace std; - -EvictorBase::EvictorBase(int size) : _size(size) -{ - if (_size < 0) - { - _size = 1000; - } -} - -shared_ptr -EvictorBase::locate(const Ice::Current& c, shared_ptr& cookie) -{ - lock_guard lk(_mutex); - - // - // Check if we have a servant in the map already. - // - shared_ptr entry; - auto i = _map.find(c.id); - if (i != _map.end()) - { - // - // Got an entry already, dequeue the entry from its current position. - // - entry = i->second; - _queue.erase(entry->queuePos); - } - else - { - // - // We do not have an entry. Ask the derived class to - // instantiate a servant and add a new entry to the map. - // - entry = make_shared(); - entry->servant = add(c, entry->userCookie); // Down-call - if (!entry->servant) - { - return 0; - } - entry->useCount = 0; - i = _map.insert(make_pair(c.id, entry)).first; - } - - // - // Increment the use count of the servant and enqueue - // the entry at the front, so we get LRU order. - // - ++(entry->useCount); - entry->queuePos = _queue.insert(_queue.begin(), i); - - cookie = entry; - - return entry->servant; -} - -void -EvictorBase::finished(const Ice::Current&, const shared_ptr&, const shared_ptr& cookie) -{ - lock_guard lk(_mutex); - - auto entry = static_pointer_cast(cookie); - - // - // Decrement use count and check if there is something to evict. - // - --(entry->useCount); - evictServants(); -} - -void -EvictorBase::deactivate(const string&) -{ - lock_guard lk(_mutex); - - _size = 0; - evictServants(); -} - -void -EvictorBase::evictServants() -{ - // - // If the evictor queue has grown larger than the limit, - // look at the excess elements to see whether any of them - // can be evicted. - // - auto p = _queue.rbegin(); - auto excessEntries = static_cast(_map.size() - _size); - - for (int i = 0; i < excessEntries; ++i) - { - auto mapPos = *p; - if (mapPos->second->useCount == 0) - { - evict(mapPos->second->servant, mapPos->second->userCookie); // Down-call - p = EvictorQueue::reverse_iterator(_queue.erase(mapPos->second->queuePos)); - _map.erase(mapPos); - } - else - { - ++p; - } - } -} diff --git a/cpp/Manual/evictor/EvictorBase.h b/cpp/Manual/evictor/EvictorBase.h deleted file mode 100644 index 9e945883a9..0000000000 --- a/cpp/Manual/evictor/EvictorBase.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef EVICTORBASE_H -#define EVICTORBASE_H - -#include -#include -#include -#include - -class EvictorBase : public Ice::ServantLocator -{ -public: - EvictorBase(int size = 1000); - - virtual std::shared_ptr locate(const Ice::Current&, std::shared_ptr&) override; - virtual void - finished(const Ice::Current&, const std::shared_ptr&, const std::shared_ptr&) override; - virtual void deactivate(const std::string&) override; - -protected: - virtual std::shared_ptr add(const Ice::Current&, std::shared_ptr&) = 0; - virtual void evict(const std::shared_ptr&, const std::shared_ptr&) = 0; - -private: - struct EvictorEntry; - - using EvictorMap = std::map>; - using EvictorQueue = std::list; - - struct EvictorEntry - { - std::shared_ptr servant; - std::shared_ptr userCookie; - EvictorQueue::iterator queuePos; - int useCount; - }; - - EvictorMap _map; - EvictorQueue _queue; - int _size; - - std::mutex _mutex; - - void evictServants(); -}; -#endif diff --git a/cpp/Manual/evictor/README.md b/cpp/Manual/evictor/README.md deleted file mode 100644 index ae31e3d62e..0000000000 --- a/cpp/Manual/evictor/README.md +++ /dev/null @@ -1,12 +0,0 @@ -The source code provided here implements a C++ evictor base class. To -use it, you must derive a class from `EvictorBase` and implement the -pure virtual functions `add` and `evict`. - -`add` is called when the evictor needs to instantiate a servant, and -`evict` is called when the evictor has decided to evict a servant. -Note that you can pass information from `add` to the corresponding -call to `evict` via the cookie argument. - -For more details on this evictor, see [Servant Evictors][1]. - -[1]: https://doc.zeroc.com/ice/3.7/best-practices/servant-evictors diff --git a/cpp/Manual/lifecycle/Client.cpp b/cpp/Manual/lifecycle/Client.cpp deleted file mode 100644 index 22db632986..0000000000 --- a/cpp/Manual/lifecycle/Client.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include -#include -#include - -using namespace std; -using namespace Filesystem; - -int -main(int argc, char* argv[]) -{ - int status = 0; - - try - { - // - // CommunicatorHolder's ctor initializes an Ice communicator, - // and its dtor destroys this communicator. - // - const Ice::CommunicatorHolder ich(argc, argv); - - // - // Create a proxy for the root directory - // - auto base = ich->stringToProxy("RootDir:default -p 10000"); - - // - // Down-cast the proxy to a Directory proxy. - // - auto rootDir = Ice::checkedCast(base); - if (!rootDir) - { - cerr << "Invalid proxy" << endl; - status = 1; - } - else - { - unique_ptr p(new Parser(rootDir)); - status = p->parse(); - } - } - catch (const std::exception& ex) - { - cerr << argv[0] << ": " << ex.what() << endl; - status = 1; - } - - return status; -} diff --git a/cpp/Manual/lifecycle/Filesystem.ice b/cpp/Manual/lifecycle/Filesystem.ice deleted file mode 100644 index 11b2a46a40..0000000000 --- a/cpp/Manual/lifecycle/Filesystem.ice +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -module Filesystem { - exception GenericError - { - string reason; - } - exception PermissionDenied extends GenericError {} - exception NameInUse extends GenericError {} - exception NoSuchName extends GenericError {} - - interface Node - { - idempotent string name(); - void destroy() throws PermissionDenied; - } - - sequence Lines; - - interface File extends Node - { - idempotent Lines read(); - idempotent void write(Lines text) throws GenericError; - } - - enum NodeType { DirType, FileType } - - struct NodeDesc - { - string name; - NodeType type; - Node* proxy; - } - - sequence NodeDescSeq; - - interface Directory extends Node - { - idempotent NodeDescSeq list(); - idempotent NodeDesc find(string name) throws NoSuchName; - File* createFile(string name) throws NameInUse; - Directory* createDirectory(string name) throws NameInUse; - } -} diff --git a/cpp/Manual/lifecycle/FilesystemI.cpp b/cpp/Manual/lifecycle/FilesystemI.cpp deleted file mode 100644 index 0b1ee68ada..0000000000 --- a/cpp/Manual/lifecycle/FilesystemI.cpp +++ /dev/null @@ -1,249 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include - -using namespace std; -using namespace Filesystem; -using namespace FilesystemI; - -// Slice Node::name() operation. - -std::string -FilesystemI::NodeI::name(const Ice::Current& c) -{ - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - return _name; -} - -// Return the object identity for this node. - -Ice::Identity -FilesystemI::NodeI::id() const -{ - return _id; -} - -// NodeI constructor. - -FilesystemI::NodeI::NodeI(const string& nm, const shared_ptr& parent) - : _name(nm), - _parent(parent), - _destroyed(false) -{ - // - // Create an identity. The root directory has the fixed identity "RootDir". - // - if (parent != nullptr) - { - _id.name = Ice::generateUUID(); - } - else - { - _id.name = "RootDir"; - } -} - -// Slice File::read() operation. - -Lines -FilesystemI::FileI::read(const Ice::Current& c) -{ - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - return _lines; -} - -// Slice File::write() operation. - -void -FilesystemI::FileI::write(Lines text, const Ice::Current& c) -{ - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - _lines = std::move(text); -} - -// Slice File::destroy() operation. - -void -FilesystemI::FileI::destroy(const Ice::Current& c) -{ - { - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - c.adapter->remove(id()); - _destroyed = true; - } - - _parent->removeEntry(_name); -} - -// FileI constructor. - -FilesystemI::FileI::FileI(const string& nm, const shared_ptr& parent) : NodeI(nm, parent) {} - -// Slice Directory::list() operation. - -NodeDescSeq -FilesystemI::DirectoryI::list(const Ice::Current& c) -{ - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - NodeDescSeq ret; - for (const auto& i : _contents) - { - NodeDesc d; - d.name = i.first; - d.type = dynamic_pointer_cast(i.second) ? NodeType::FileType : NodeType::DirType; - d.proxy = Ice::uncheckedCast(c.adapter->createProxy(i.second->id())); - ret.push_back(d); - } - return ret; -} - -// Slice Directory::find() operation. - -NodeDesc -FilesystemI::DirectoryI::find(string nm, const Ice::Current& c) -{ - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - auto pos = _contents.find(nm); - if (pos == _contents.end()) - { - throw NoSuchName(nm); - } - - auto p = pos->second; - NodeDesc d; - d.name = nm; - d.type = dynamic_pointer_cast(p) ? NodeType::FileType : NodeType::DirType; - d.proxy = Ice::uncheckedCast(c.adapter->createProxy(p->id())); - return d; -} - -// Slice Directory::createFile() operation. - -shared_ptr -FilesystemI::DirectoryI::createFile(string nm, const Ice::Current& c) -{ - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - if (nm.empty() || _contents.find(nm) != _contents.end()) - { - throw NameInUse(nm); - } - - auto f = make_shared(nm, shared_from_this()); - auto node = c.adapter->add(f, f->id()); - _contents[nm] = f; - return Ice::uncheckedCast(node); -} - -// Slice Directory::createDirectory() operation. - -shared_ptr -FilesystemI::DirectoryI::createDirectory(string nm, const Ice::Current& c) -{ - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - if (nm.empty() || _contents.find(nm) != _contents.end()) - { - throw NameInUse(nm); - } - - auto d = make_shared(nm, shared_from_this()); - auto node = c.adapter->add(d, d->id()); - _contents[nm] = d; - return Ice::uncheckedCast(node); -} - -// Slice Directory::destroy() operation. - -void -FilesystemI::DirectoryI::destroy(const Ice::Current& c) -{ - if (!_parent) - { - throw PermissionDenied("Cannot destroy root directory"); - } - - { - const lock_guard lock(_mutex); - - if (_destroyed) - { - throw Ice::ObjectNotExistException(__FILE__, __LINE__, c.id, c.facet, c.operation); - } - - if (!_contents.empty()) - { - throw PermissionDenied("Cannot destroy non-empty directory"); - } - - c.adapter->remove(id()); - _destroyed = true; - } - - _parent->removeEntry(_name); -} - -// DirectoryI constructor. - -FilesystemI::DirectoryI::DirectoryI(const string& nm, const shared_ptr& parent) : NodeI(nm, parent) {} - -// Remove the entry from the _contents map. - -void -FilesystemI::DirectoryI::removeEntry(const string& nm) -{ - const lock_guard lock(_mutex); - auto i = _contents.find(nm); - if (i != _contents.end()) - { - _contents.erase(i); - } -} diff --git a/cpp/Manual/lifecycle/FilesystemI.h b/cpp/Manual/lifecycle/FilesystemI.h deleted file mode 100644 index ba9d18a3f6..0000000000 --- a/cpp/Manual/lifecycle/FilesystemI.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef __FilesystemI_h__ -#define __FilesystemI_h__ - -#include -#include -#include -#include - -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable : 4250) // ... : inherits ... via dominance -#endif - -namespace FilesystemI -{ - - class DirectoryI; - - class NodeI : public virtual Filesystem::Node - { - public: - virtual std::string name(const Ice::Current&) override; - Ice::Identity id() const; - - protected: - NodeI(const std::string&, const std::shared_ptr&); - - const std::string _name; - const std::shared_ptr _parent; - bool _destroyed; - Ice::Identity _id; - std::mutex _mutex; - }; - - class FileI : public Filesystem::File, public NodeI - { - public: - virtual Filesystem::Lines read(const Ice::Current&) override; - virtual void write(Filesystem::Lines, const Ice::Current&) override; - virtual void destroy(const Ice::Current&) override; - - FileI(const std::string&, const std::shared_ptr&); - - private: - Filesystem::Lines _lines; - }; - - class DirectoryI : public NodeI, public Filesystem::Directory, public std::enable_shared_from_this - { - public: - virtual Filesystem::NodeDescSeq list(const Ice::Current&) override; - virtual Filesystem::NodeDesc find(std::string, const Ice::Current&) override; - std::shared_ptr createFile(std::string, const Ice::Current&) override; - std::shared_ptr createDirectory(std::string, const Ice::Current&) override; - virtual void destroy(const Ice::Current&) override; - - DirectoryI(const std::string& = "/", const std::shared_ptr& = nullptr); - - void removeEntry(const std::string&); - - private: - using Contents = std::map>; - Contents _contents; - }; -} - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -#endif diff --git a/cpp/Manual/lifecycle/Grammar.cpp b/cpp/Manual/lifecycle/Grammar.cpp deleted file mode 100644 index bf22b310bd..0000000000 --- a/cpp/Manual/lifecycle/Grammar.cpp +++ /dev/null @@ -1,1661 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.7" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 1 "Manual/lifecycle/Grammar.y" - -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include -#include - -#ifdef _MSC_VER -// I get these warnings from some bison versions: -// warning C4102: 'yyoverflowlab' : unreferenced label -# pragma warning(disable : 4102) -// warning C4065: switch statement contains 'default' but no 'case' labels -# pragma warning(disable : 4065) -// warning C4127: conditional expression is constant -# pragma warning(disable : 4127) -// warning C4244: '=' : conversion from 'int' to 'yytype_int16', possible loss of data -# pragma warning(disable : 4244) -// warning C4702: unreachable code -# pragma warning(disable : 4702) -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunused-but-set-variable" -#endif - -using namespace std; - -void -yyerror(const char* s) -{ - parser->error(s); -} - -/* Line 371 of yacc.c */ -#line 103 "Manual/lifecycle/Grammar.cpp" - -#ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "Grammar.hpp". */ -#ifndef YY_YY_MANUAL_LIFECYCLE_GRAMMAR_HPP_INCLUDED -# define YY_YY_MANUAL_LIFECYCLE_GRAMMAR_HPP_INCLUDED -/* Enabling traces. */ -# ifndef YYDEBUG -# define YYDEBUG 1 -# endif -# if YYDEBUG -extern int yydebug; -# endif - -/* Tokens. */ -# ifndef YYTOKENTYPE -# define YYTOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - TOK_HELP = 258, - TOK_EXIT = 259, - TOK_STRING = 260, - TOK_LIST = 261, - TOK_LIST_RECURSIVE = 262, - TOK_CREATE_FILE = 263, - TOK_CREATE_DIR = 264, - TOK_PWD = 265, - TOK_CD = 266, - TOK_CAT = 267, - TOK_WRITE = 268, - TOK_RM = 269 -}; -# endif - -# if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -# endif - -# ifdef YYPARSE_PARAM -# if defined __STDC__ || defined __cplusplus -int yyparse(void* YYPARSE_PARAM); -# else -int yyparse(); -# endif -# else /* ! YYPARSE_PARAM */ -# if defined __STDC__ || defined __cplusplus -int yyparse(void); -# else -int yyparse(); -# endif -# endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_YY_MANUAL_LIFECYCLE_GRAMMAR_HPP_INCLUDED */ - -/* Copy the second part of user declarations. */ - -/* Line 390 of yacc.c */ -#line 182 "Manual/lifecycle/Grammar.cpp" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif !defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) - 1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if !defined lint || defined __GNUC__ -# define YYUSE(E) ((void)(E)) -#else -# define YYUSE(E) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) -#else -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static int -YYID(int yyi) -# else -static int -YYID(yyi) -int yyi; -# endif -{ - return yyi; -} -#endif - -#if !defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if !defined _ALLOCA_H && !defined EXIT_SUCCESS && \ - (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -/* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC -/* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) \ - do \ - { /* empty */ \ - ; \ - } while (YYID(0)) -# ifndef YYSTACK_ALLOC_MAXIMUM -/* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if ( \ - defined __cplusplus && !defined EXIT_SUCCESS && \ - !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if !defined malloc && !defined EXIT_SUCCESS && \ - (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -void* malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if !defined free && !defined EXIT_SUCCESS && \ - (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -void free(void*); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - -#if (!defined yyoverflow && (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY(&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof(*yyptr); \ - } while (YYID(0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) __builtin_memcpy(Dst, Src, (Count) * sizeof(*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } while (YYID(0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 27 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 45 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 16 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 5 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 21 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 30 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 269 - -#define YYTRANSLATE(YYX) ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 15, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs[] = {0, 0, 3, 5, 6, 9, 11, 14, 17, 19, 21, 24, 27, 29, 31, 34, 37, 40, 43, 46, 48, 51}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = {17, 0, -1, 18, -1, -1, 18, 19, -1, 19, -1, 3, 15, -1, 4, 15, -1, 6, - -1, 7, -1, 8, 20, -1, 9, 20, -1, 10, -1, 11, -1, 11, 20, -1, 12, 5, - -1, 13, 20, -1, 14, 20, -1, 1, 15, -1, 15, -1, 5, 20, -1, 5, -1}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = {0, 56, 56, 60, 67, 70, 78, 82, 86, 90, 94, - 98, 102, 106, 110, 114, 118, 122, 126, 131, 139, 144}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char* const yytname[] = { - "$end", - "error", - "$undefined", - "TOK_HELP", - "TOK_EXIT", - "TOK_STRING", - "TOK_LIST", - "TOK_LIST_RECURSIVE", - "TOK_CREATE_FILE", - "TOK_CREATE_DIR", - "TOK_PWD", - "TOK_CD", - "TOK_CAT", - "TOK_WRITE", - "TOK_RM", - "';'", - "$accept", - "start", - "commands", - "command", - "strings", - YY_NULL}; -#endif - -#ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = {0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 59}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = {0, 16, 17, 17, 18, 18, 19, 19, 19, 19, 19, - 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = {0, 2, 1, 0, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1}; - -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = {0, 0, 0, 0, 8, 9, 0, 0, 12, 13, 0, 0, 0, 19, 0, - 0, 5, 18, 6, 7, 21, 10, 11, 14, 15, 16, 17, 1, 4, 20}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = {-1, 14, 15, 16, 21}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -14 -static const yytype_int8 yypact[] = {0, -13, -10, 3, -14, -14, 28, 28, -14, 28, 30, 28, 28, -14, 21, - 16, -14, -14, -14, -14, 28, -14, -14, -14, -14, -14, -14, -14, -14, -14}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = {-14, -14, -14, 23, 25}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -4 -static const yytype_int8 yytable[] = {-3, 1, 17, 2, 3, 18, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - -2, 1, 19, 2, 3, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 22, 20, 23, 24, 25, 26, 28, 0, 0, 0, 0, 0, 0, 29}; - -#define yypact_value_is_default(Yystate) (!!((Yystate) == (-14))) - -#define yytable_value_is_error(Yytable_value) YYID(0) - -static const yytype_int8 yycheck[] = {0, 1, 15, 3, 4, 15, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 0, 1, 15, 3, 4, 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 7, 5, 9, 5, 11, 12, 15, -1, -1, -1, -1, -1, -1, 20}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = {0, 1, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, - 18, 19, 15, 15, 15, 5, 20, 20, 20, 5, 20, 20, 0, 19, 20}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL -/* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK(yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror(YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (YYID(0)) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void)0) -#endif - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex(&yylval) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ - do \ - { \ - if (yydebug) \ - YYFPRINTF Args; \ - } while (YYID(0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ - do \ - { \ - if (yydebug) \ - { \ - YYFPRINTF(stderr, "%s ", Title); \ - yy_symbol_print(stderr, Type, Value); \ - YYFPRINTF(stderr, "\n"); \ - } \ - } while (YYID(0)) - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print(FILE* yyoutput, int yytype, YYSTYPE const* const yyvaluep) -# else -static void yy_symbol_value_print(yyoutput, yytype, yyvaluep) FILE* yyoutput; -int yytype; -YYSTYPE const* const yyvaluep; -# endif -{ - FILE* yyo = yyoutput; - YYUSE(yyo); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE(yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print(FILE* yyoutput, int yytype, YYSTYPE const* const yyvaluep) -# else -static void yy_symbol_print(yyoutput, yytype, yyvaluep) FILE* yyoutput; -int yytype; -YYSTYPE const* const yyvaluep; -# endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF(yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF(yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print(yyoutput, yytype, yyvaluep); - YYFPRINTF(yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print(yytype_int16* yybottom, yytype_int16* yytop) -# else -static void yy_stack_print(yybottom, yytop) yytype_int16* yybottom; -yytype_int16* yytop; -# endif -{ - YYFPRINTF(stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF(stderr, " %d", yybot); - } - YYFPRINTF(stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ - do \ - { \ - if (yydebug) \ - yy_stack_print((Bottom), (Top)); \ - } while (YYID(0)) - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print(YYSTYPE* yyvsp, int yyrule) -# else -static void yy_reduce_print(yyvsp, yyrule) YYSTYPE* yyvsp; -int yyrule; -# endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF(stderr, " $%d = ", yyi + 1); - yy_symbol_print(stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)])); - YYFPRINTF(stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ - do \ - { \ - if (yydebug) \ - yy_reduce_print(yyvsp, Rule); \ - } while (YYID(0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen(const char* yystr) -# else -static YYSIZE_T yystrlen(yystr) const char* yystr; -# endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static char* -yystpcpy(char* yydest, const char* yysrc) -# else -static char* -yystpcpy(yydest, yysrc) -char* yydest; -const char* yysrc; -# endif -{ - char* yyd = yydest; - const char* yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr(char* yyres, const char* yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const* yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes:; - } - - if (!yyres) - return yystrlen(yystr); - - return yystpcpy(yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error(YYSIZE_T* yymsg_alloc, char** yymsg, yytype_int16* yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr(YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum - { - YYERROR_VERBOSE_ARGS_MAXIMUM = 5 - }; - /* Internationalized format string. */ - const char* yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const* yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default(yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error(yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr(YY_NULL, yytname[yyx]); - if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen(yyformat); - if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char* yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr(yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -static void -yydestruct(const char* yymsg, int yytype, YYSTYPE* yyvaluep) -#else -static void yydestruct(yymsg, yytype, yyvaluep) const char* yymsg; -int yytype; -YYSTYPE* yyvaluep; -#endif -{ - YYUSE(yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - default: - break; - } -} - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -int -yyparse(void* YYPARSE_PARAM) -# else -int yyparse(YYPARSE_PARAM) void* YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -# if (defined __STDC__ || defined __C99__FUNC__ || defined __cplusplus || defined _MSC_VER) -int -yyparse(void) -# else -int -yyparse() - -# endif -#endif -{ - /* The lookahead symbol. */ - int yychar; - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop") -#else - /* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ - static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - /* The semantic value of the lookahead symbol. */ - YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16* yyss; - yytype_int16* yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE* yyvs; - YYSTYPE* yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char* yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - /*------------------------------------------------------------. - | yynewstate -- Push a new state, which is found in yystate. | - `------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - -yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE* yyvs1 = yyvs; - yytype_int16* yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow( - YY_("memory exhausted"), - &yyss1, - yysize * sizeof(*yyssp), - &yyvs1, - yysize * sizeof(*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16* yyss1 = yyss; - union yyalloc* yyptr = (union yyalloc*)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize)); - if (!yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE(yyss_alloc, yyss); - YYSTACK_RELOCATE(yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE(yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long int)yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default(yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE(yychar); - YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error(yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1 - yylen]; - - YY_REDUCE_PRINT(yyn); - switch (yyn) - { - case 2: -/* Line 1792 of yacc.c */ -#line 57 "Manual/lifecycle/Grammar.y" - { - } - break; - - case 3: -/* Line 1792 of yacc.c */ -#line 60 "Manual/lifecycle/Grammar.y" - { - } - break; - - case 4: -/* Line 1792 of yacc.c */ -#line 68 "Manual/lifecycle/Grammar.y" - { - } - break; - - case 5: -/* Line 1792 of yacc.c */ -#line 71 "Manual/lifecycle/Grammar.y" - { - } - break; - - case 6: -/* Line 1792 of yacc.c */ -#line 79 "Manual/lifecycle/Grammar.y" - { - parser->usage(); - } - break; - - case 7: -/* Line 1792 of yacc.c */ -#line 83 "Manual/lifecycle/Grammar.y" - { - return 0; - } - break; - - case 8: -/* Line 1792 of yacc.c */ -#line 87 "Manual/lifecycle/Grammar.y" - { - parser->list(false); - } - break; - - case 9: -/* Line 1792 of yacc.c */ -#line 91 "Manual/lifecycle/Grammar.y" - { - parser->list(true); - } - break; - - case 10: -/* Line 1792 of yacc.c */ -#line 95 "Manual/lifecycle/Grammar.y" - { - parser->createFile((yyvsp[(2) - (2)])); - } - break; - - case 11: -/* Line 1792 of yacc.c */ -#line 99 "Manual/lifecycle/Grammar.y" - { - parser->createDir((yyvsp[(2) - (2)])); - } - break; - - case 12: -/* Line 1792 of yacc.c */ -#line 103 "Manual/lifecycle/Grammar.y" - { - parser->pwd(); - } - break; - - case 13: -/* Line 1792 of yacc.c */ -#line 107 "Manual/lifecycle/Grammar.y" - { - parser->cd("/"); - } - break; - - case 14: -/* Line 1792 of yacc.c */ -#line 111 "Manual/lifecycle/Grammar.y" - { - parser->cd((yyvsp[(2) - (2)]).front()); - } - break; - - case 15: -/* Line 1792 of yacc.c */ -#line 115 "Manual/lifecycle/Grammar.y" - { - parser->cat((yyvsp[(2) - (2)]).front()); - } - break; - - case 16: -/* Line 1792 of yacc.c */ -#line 119 "Manual/lifecycle/Grammar.y" - { - parser->write((yyvsp[(2) - (2)])); - } - break; - - case 17: -/* Line 1792 of yacc.c */ -#line 123 "Manual/lifecycle/Grammar.y" - { - parser->destroy((yyvsp[(2) - (2)])); - } - break; - - case 18: -/* Line 1792 of yacc.c */ -#line 127 "Manual/lifecycle/Grammar.y" - { - parser->usage(); - yyerrok; - } - break; - - case 19: -/* Line 1792 of yacc.c */ -#line 132 "Manual/lifecycle/Grammar.y" - { - } - break; - - case 20: -/* Line 1792 of yacc.c */ -#line 140 "Manual/lifecycle/Grammar.y" - { - (yyval) = (yyvsp[(2) - (2)]); - (yyval).push_front((yyvsp[(1) - (2)]).front()); - } - break; - - case 21: -/* Line 1792 of yacc.c */ -#line 145 "Manual/lifecycle/Grammar.y" - { - (yyval) = (yyvsp[(1) - (1)]); - } - break; - -/* Line 1792 of yacc.c */ -#line 1558 "Manual/lifecycle/Grammar.cpp" - default: - break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK(yylen); - yylen = 0; - YY_STACK_PRINT(yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if !YYERROR_VERBOSE - yyerror(YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken) - { - char const* yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); - yymsg = (char*)YYSTACK_ALLOC(yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror(yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct("Error: discarding", yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK(yylen); - yylen = 0; - YY_STACK_PRINT(yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default(yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yydestruct("Error: popping", yystos[yystate], yyvsp); - YYPOPSTACK(1); - yystate = *yyssp; - YY_STACK_PRINT(yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - /* Shift the error token. */ - YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror(YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE(yychar); - yydestruct("Cleanup: discarding lookahead", yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK(yylen); - YY_STACK_PRINT(yyss, yyssp); - while (yyssp != yyss) - { - yydestruct("Cleanup: popping", yystos[*yyssp], yyvsp); - YYPOPSTACK(1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE(yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE(yymsg); -#endif - /* Make sure YYID is used. */ - return YYID(yyresult); -} - -/* Line 2055 of yacc.c */ -#line 150 "Manual/lifecycle/Grammar.y" - -#include diff --git a/cpp/Manual/lifecycle/Grammar.h b/cpp/Manual/lifecycle/Grammar.h deleted file mode 100644 index 3741593217..0000000000 --- a/cpp/Manual/lifecycle/Grammar.h +++ /dev/null @@ -1,86 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.7. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_YY_MANUAL_LIFECYCLE_GRAMMAR_HPP_INCLUDED -#define YY_YY_MANUAL_LIFECYCLE_GRAMMAR_HPP_INCLUDED -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE -/* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ -enum yytokentype -{ - TOK_HELP = 258, - TOK_EXIT = 259, - TOK_STRING = 260, - TOK_LIST = 261, - TOK_LIST_RECURSIVE = 262, - TOK_CREATE_FILE = 263, - TOK_CREATE_DIR = 264, - TOK_PWD = 265, - TOK_CD = 266, - TOK_CAT = 267, - TOK_WRITE = 268, - TOK_RM = 269 -}; -#endif - -#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - -#ifdef YYPARSE_PARAM -# if defined __STDC__ || defined __cplusplus -int yyparse(void* YYPARSE_PARAM); -# else -int yyparse(); -# endif -#else /* ! YYPARSE_PARAM */ -# if defined __STDC__ || defined __cplusplus -int yyparse(void); -# else -int yyparse(); -# endif -#endif /* ! YYPARSE_PARAM */ - -#endif /* !YY_YY_MANUAL_LIFECYCLE_GRAMMAR_HPP_INCLUDED */ diff --git a/cpp/Manual/lifecycle/Grammar.y b/cpp/Manual/lifecycle/Grammar.y deleted file mode 100644 index 949039c6c3..0000000000 --- a/cpp/Manual/lifecycle/Grammar.y +++ /dev/null @@ -1,154 +0,0 @@ -%{ - -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include -#include - -#ifdef _MSC_VER -// I get these warnings from some bison versions: -// warning C4102: 'yyoverflowlab' : unreferenced label -# pragma warning( disable : 4102 ) -// warning C4065: switch statement contains 'default' but no 'case' labels -# pragma warning( disable : 4065 ) -// warning C4127: conditional expression is constant -# pragma warning( disable : 4127 ) -// warning C4244: '=' : conversion from 'int' to 'yytype_int16', possible loss of data -# pragma warning( disable : 4244 ) -// warning C4702: unreachable code -# pragma warning( disable : 4702 ) -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wunused-but-set-variable" -#endif - -using namespace std; - -void -yyerror(const char* s) -{ - parser->error(s); -} - -%} - -%pure_parser - -%token TOK_HELP -%token TOK_EXIT -%token TOK_STRING -%token TOK_LIST -%token TOK_LIST_RECURSIVE -%token TOK_CREATE_FILE -%token TOK_CREATE_DIR -%token TOK_PWD -%token TOK_CD -%token TOK_CAT -%token TOK_WRITE -%token TOK_RM - -%% - -// ---------------------------------------------------------------------- -start -// ---------------------------------------------------------------------- -: commands -{ -} -| -{ -} -; - -// ---------------------------------------------------------------------- -commands -// ---------------------------------------------------------------------- -: commands command -{ -} -| command -{ -} -; - -// ---------------------------------------------------------------------- -command -// ---------------------------------------------------------------------- -: TOK_HELP ';' -{ - parser->usage(); -} -| TOK_EXIT ';' -{ - return 0; -} -| TOK_LIST -{ - parser->list(false); -} -| TOK_LIST_RECURSIVE -{ - parser->list(true); -} -| TOK_CREATE_FILE strings -{ - parser->createFile($2); -} -| TOK_CREATE_DIR strings -{ - parser->createDir($2); -} -| TOK_PWD -{ - parser->pwd(); -} -| TOK_CD -{ - parser->cd("/"); -} -| TOK_CD strings -{ - parser->cd($2.front()); -} -| TOK_CAT TOK_STRING -{ - parser->cat($2.front()); -} -| TOK_WRITE strings -{ - parser->write($2); -} -| TOK_RM strings -{ - parser->destroy($2); -} -| error ';' -{ - parser->usage(); - yyerrok; -} -| ';' -{ -} -; - -// ---------------------------------------------------------------------- -strings -// ---------------------------------------------------------------------- -: TOK_STRING strings -{ - $$ = $2; - $$.push_front($1.front()); -} -| TOK_STRING -{ - $$ = $1; -} -; - -%% - -#include diff --git a/cpp/Manual/lifecycle/Makefile.mk b/cpp/Manual/lifecycle/Makefile.mk deleted file mode 100644 index 611a7f0435..0000000000 --- a/cpp/Manual/lifecycle/Makefile.mk +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright (c) ZeroC, Inc. All rights reserved. -# - -$(demo)_client_sources = Filesystem.ice Client.cpp Grammar.cpp Parser.cpp Scanner.cpp - -demos += $(demo) diff --git a/cpp/Manual/lifecycle/Parser.cpp b/cpp/Manual/lifecycle/Parser.cpp deleted file mode 100644 index 5b9c682725..0000000000 --- a/cpp/Manual/lifecycle/Parser.cpp +++ /dev/null @@ -1,445 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include - -#ifdef HAVE_READLINE -# include -# include -#endif - -using namespace std; -using namespace Filesystem; - -extern FILE* yyin; - -Parser* parser; - -Parser::Parser(const shared_ptr& root) { _dirs.push_front(root); } - -void -Parser::usage() -{ - cout << "help Print this message.\n" - "pwd Print current directory (/ = root).\n" - "cd [DIR] Change directory (/ or empty = root).\n" - "ls List current directory.\n" - "lr Recursively list current directory.\n" - "mkdir DIR [DIR...] Create directories DIR in current directory.\n" - "mkfile FILE [FILE...] Create files FILE in current directory.\n" - "rm NAME [NAME...] Delete directory or file NAME (rm * to delete all).\n" - "cat FILE List the contents of FILE.\n" - "write FILE [STRING...] Write STRING to FILE.\n" - "exit, quit Exit this program.\n"; -} - -// Print the contents of directory "dir". If recursive is true, -// print in tree fashion. -// For files, show the contents of each file. The "depth" -// parameter is the current nesting level (for indentation). - -void -Parser::list(bool recursive) -{ - list(_dirs.front(), recursive, 0); -} - -void -Parser::list(const shared_ptr& dir, bool recursive, size_t depth) -{ - const string indent(depth++, '\t'); - - auto contents = dir->list(); - - for (const auto& i : contents) - { - shared_ptr d; - if (i.type == NodeType::DirType) - { - d = Ice::uncheckedCast(i.proxy); - } - cout << indent << i.name << (d ? " (directory)" : " (file)"); - if (d && recursive) - { - cout << ":" << endl; - list(d, true, depth); - } - else - { - cout << endl; - } - } -} - -void -Parser::createFile(const std::list& names) -{ - auto dir = _dirs.front(); - - for (const auto& i : names) - { - if (i == "..") - { - cout << "Cannot create a file named `..'" << endl; - continue; - } - - try - { - dir->createFile(i); - } - catch (const NameInUse&) - { - cout << "`" << i << "' exists already" << endl; - } - } -} - -void -Parser::createDir(const std::list& names) -{ - auto dir = _dirs.front(); - - for (const auto& i : names) - { - if (i == "..") - { - cout << "Cannot create a directory named `..'" << endl; - continue; - } - - try - { - dir->createDirectory(i); - } - catch (const NameInUse&) - { - cout << "`" << i << "' exists already" << endl; - } - } -} - -void -Parser::pwd() -{ - if (_dirs.size() == 1) - { - cout << "/"; - } - else - { - auto i = _dirs.rbegin(); - ++i; - while (i != _dirs.rend()) - { - cout << "/" << (*i)->name(); - ++i; - } - } - cout << endl; -} - -void -Parser::cd(const string& name) -{ - if (name == "/") - { - while (_dirs.size() > 1) - { - _dirs.pop_front(); - } - return; - } - - if (name == "..") - { - if (_dirs.size() > 1) - { - _dirs.pop_front(); - } - return; - } - - auto dir = _dirs.front(); - NodeDesc d; - try - { - d = dir->find(name); - } - catch (const NoSuchName&) - { - cout << "`" << name << "': no such directory" << endl; - return; - } - if (d.type == NodeType::FileType) - { - cout << "`" << name << "': not a directory" << endl; - return; - } - _dirs.push_front(Ice::uncheckedCast(d.proxy)); -} - -void -Parser::cat(const string& name) -{ - auto dir = _dirs.front(); - NodeDesc d; - try - { - d = dir->find(name); - } - catch (const NoSuchName&) - { - cout << "`" << name << "': no such file" << endl; - return; - } - if (d.type == NodeType::DirType) - { - cout << "`" << name << "': not a file" << endl; - return; - } - auto f = Ice::uncheckedCast(d.proxy); - auto lines = f->read(); - for (const auto& i : lines) - { - cout << i << endl; - } -} - -void -Parser::write(std::list& args) -{ - auto dir = _dirs.front(); - auto name = args.front(); - args.pop_front(); - NodeDesc d; - try - { - d = dir->find(name); - } - catch (const NoSuchName&) - { - cout << "`" << name << "': no such file" << endl; - return; - } - if (d.type == NodeType::DirType) - { - cout << "`" << name << "': not a file" << endl; - return; - } - auto f = Ice::uncheckedCast(d.proxy); - - Lines l; - for (const auto& i : args) - { - l.push_back(i); - } - f->write(l); -} - -void -Parser::destroy(const std::list& names) -{ - auto dir = _dirs.front(); - - for (const auto& i : names) - { - if (i == "*") - { - auto nodes = dir->list(); - for (auto& j : nodes) - { - try - { - j.proxy->destroy(); - } - catch (const PermissionDenied& ex) - { - cout << "cannot remove `" << j.name << "': " << ex.reason << endl; - } - } - return; - } - else - { - NodeDesc d; - try - { - d = dir->find(i); - } - catch (const NoSuchName&) - { - cout << "`" << i << "': no such file or directory" << endl; - return; - } - try - { - d.proxy->destroy(); - } - catch (const PermissionDenied& ex) - { - cout << "cannot remove `" << i << "': " << ex.reason << endl; - } - } - } -} - -// -// With older flex version <= 2.5.35 YY_INPUT second -// paramenter is of type int&, in newer versions it -// changes to size_t& -// -void -Parser::getInput(char* buf, int& result, size_t maxSize) -{ - auto r = static_cast(result); - getInput(buf, r, maxSize); - result = static_cast(r); -} - -void -Parser::getInput(char* buf, size_t& result, size_t maxSize) -{ -#ifdef HAVE_READLINE - - auto prompt = parser->getPrompt(); - auto line = readline(const_cast(prompt)); - if (!line) - { - result = 0; - } - else - { - if (*line) - { - add_history(line); - } - - result = strlen(line) + 1; - if (result > maxSize) - { - free(line); - error("input line too long"); - result = 0; - } - else - { - strcpy(buf, line); - strcat(buf, "\n"); - free(line); - } - } - -#else - - cout << parser->getPrompt() << flush; - - string line; - int c; - do - { - c = getc(yyin); - if (c == EOF) - { - if (line.size()) - { - line += '\n'; - } - } - else - { - line += static_cast(c); - } - } while (c != EOF && c != '\n'); - - result = line.length(); - if (result > maxSize) - { - error("input line too long"); - buf[0] = EOF; - result = 1; - } - else - { -# ifdef _WIN32 - strcpy_s(buf, result + 1, line.c_str()); -# else - strcpy(buf, line.c_str()); -# endif - } - -#endif -} - -void -Parser::continueLine() -{ - _continue = true; -} - -const char* -Parser::getPrompt() -{ - if (_continue) - { - _continue = false; - return "(cont) "; - } - else - { - return "> "; - } -} - -void -Parser::error(const char* s) -{ - cerr << "error: " << s << endl; - _errors++; -} - -void -Parser::error(const string& s) -{ - error(s.c_str()); -} - -void -Parser::warning(const char* s) -{ - cerr << "warning: " << s << endl; -} - -void -Parser::warning(const string& s) -{ - warning(s.c_str()); -} - -int -Parser::parse(bool debug) -{ - extern int yydebug; - yydebug = debug ? 1 : 0; - - assert(!parser); - parser = this; - - _errors = 0; - yyin = stdin; - assert(yyin); - - _continue = false; - - usage(); - - int status = yyparse(); - if (_errors) - { - status = 1; - } - - parser = 0; - return status; -} diff --git a/cpp/Manual/lifecycle/Parser.h b/cpp/Manual/lifecycle/Parser.h deleted file mode 100644 index 2cc2e93209..0000000000 --- a/cpp/Manual/lifecycle/Parser.h +++ /dev/null @@ -1,85 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef PARSER_H -#define PARSER_H - -#include -#include -#include -#include - -// -// Stuff for flex and bison -// - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wconversion" -#endif - -#define YYSTYPE std::list -#define YY_DECL int yylex(YYSTYPE* yylvalp) -YY_DECL; -int yyparse(); - -// -// I must set the initial stack depth to the maximum stack depth to -// disable bison stack resizing. The bison stack resizing routines use -// simple malloc/alloc/memcpy calls, which do not work for the -// YYSTYPE, since YYSTYPE is a C++ type, with constructor, destructor, -// assignment operator, etc. -// -#define YYMAXDEPTH 10000 -#define YYINITDEPTH YYMAXDEPTH // Initial depth is set to max depth, for the reasons described above. - -// -// Newer bison versions allow to disable stack resizing by defining -// yyoverflow. -// -#define yyoverflow(a, b, c, d, e, f) yyerror(a) - -class Parser -{ -public: - Parser(const std::shared_ptr&); - - void usage(); - void list(bool); - void list(const std::shared_ptr&, bool, size_t); - void createFile(const std::list&); - void createDir(const std::list&); - void pwd(); - void cd(const std::string&); - void cat(const std::string&); - void write(std::list&); - void destroy(const std::list&); - - // - // With older flex version <= 2.5.35 YY_INPUT second - // paramenter is of type int&, in newer versions it - // changes to size_t& - // - void getInput(char*, int&, size_t); - void getInput(char*, size_t&, size_t); - void continueLine(); - const char* getPrompt(); - - void error(const char*); - void error(const std::string&); - - void warning(const char*); - void warning(const std::string&); - - int parse(bool = false); - -private: - std::list> _dirs; - - bool _continue; - int _errors; -}; - -extern Parser* parser; // The current parser for bison/flex - -#endif diff --git a/cpp/Manual/lifecycle/README.md b/cpp/Manual/lifecycle/README.md deleted file mode 100644 index 55565c39f1..0000000000 --- a/cpp/Manual/lifecycle/README.md +++ /dev/null @@ -1,18 +0,0 @@ -This demo implements [the file system with life cycle support][1] -example in the Ice Manual. - -To run it, start the server in a window: - -``` -server -``` - -Then run the client in a separate window: - -``` -client -``` - -Type "help" at the client prompt to see a list of commands. - -[1]: https://doc.zeroc.com/ice/3.7/best-practices/object-life-cycle/object-life-cycle-for-the-file-system-application diff --git a/cpp/Manual/lifecycle/Scanner.cpp b/cpp/Manual/lifecycle/Scanner.cpp deleted file mode 100644 index eae6fba4f7..0000000000 --- a/cpp/Manual/lifecycle/Scanner.cpp +++ /dev/null @@ -1,2048 +0,0 @@ -#include -#line 2 "Manual/lifecycle/Scanner.cpp" - -#line 4 "Manual/lifecycle/Scanner.cpp" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 -#if YY_FLEX_SUBMINOR_VERSION > 0 -# define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -# define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -# ifndef __STDC_LIMIT_MACROS -# define __STDC_LIMIT_MACROS 1 -# endif - -# include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -# else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -# ifndef INT8_MIN -# define INT8_MIN (-128) -# endif -# ifndef INT16_MIN -# define INT16_MIN (-32767 - 1) -# endif -# ifndef INT32_MIN -# define INT32_MIN (-2147483647 - 1) -# endif -# ifndef INT8_MAX -# define INT8_MAX (127) -# endif -# ifndef INT16_MAX -# define INT16_MAX (32767) -# endif -# ifndef INT32_MAX -# define INT32_MAX (2147483647) -# endif -# ifndef UINT8_MAX -# define UINT8_MAX (255U) -# endif -# ifndef UINT16_MAX -# define UINT16_MAX (65535U) -# endif -# ifndef UINT32_MAX -# define UINT32_MAX (4294967295U) -# endif - -# endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -# define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -# if defined(__STDC__) - -# define YY_USE_CONST - -# endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -# define yyconst const -#else -# define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int)(unsigned char)c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -# define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -# define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state* YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -# define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -#define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } while (0) - -#define unput(c) yyunput(c, (yytext_ptr)) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -# define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state -{ - FILE* yy_input_file; - - char* yy_ch_buf; /* input buffer */ - char* yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -# define YY_BUFFER_NEW 0 -# define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -# define YY_BUFFER_EOF_PENDING 2 -}; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE* yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ((yy_buffer_stack) ? (yy_buffer_stack)[(yy_buffer_stack_top)] : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; - -/* Points to current character in buffer. */ -static char* yy_c_buf_p = (char*)0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart(FILE* input_file); -void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer); -YY_BUFFER_STATE yy_create_buffer(FILE* file, int size); -void yy_delete_buffer(YY_BUFFER_STATE b); -void yy_flush_buffer(YY_BUFFER_STATE b); -void yypush_buffer_state(YY_BUFFER_STATE new_buffer); -void yypop_buffer_state(void); - -static void yyensure_buffer_stack(void); -static void yy_load_buffer_state(void); -static void yy_init_buffer(YY_BUFFER_STATE b, FILE* file); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER) - -YY_BUFFER_STATE yy_scan_buffer(char* base, yy_size_t size); -YY_BUFFER_STATE yy_scan_string(yyconst char* yy_str); -YY_BUFFER_STATE yy_scan_bytes(yyconst char* bytes, yy_size_t len); - -void* yyalloc(yy_size_t); -void* yyrealloc(void*, yy_size_t); -void yyfree(void*); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if (!YY_CURRENT_BUFFER) \ - { \ - yyensure_buffer_stack(); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if (!YY_CURRENT_BUFFER) \ - { \ - yyensure_buffer_stack(); \ - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define yywrap() 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE*)0, *yyout = (FILE*)0; - -typedef int yy_state_type; - -extern int yylineno; - -int yylineno = 1; - -extern char* yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state(void); -static yy_state_type yy_try_NUL_trans(yy_state_type current_state); -static int yy_get_next_buffer(void); -static void yy_fatal_error(yyconst char msg[]); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t)(yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 19 -#define YY_END_OF_BUFFER 20 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info -{ - flex_int32_t yy_verify; - flex_int32_t yy_nxt; -}; -static yyconst flex_int16_t yy_accept[56] = {0, 14, 14, 20, 18, 14, 15, 16, 17, 18, 15, 18, 18, 18, 18, 18, 18, 18, 18, - 18, 18, 14, 0, 2, 1, 0, 14, 0, 10, 0, 0, 6, 5, 0, 0, 0, 13, 0, - 11, 0, 0, 0, 0, 9, 0, 0, 4, 3, 0, 0, 0, 8, 0, 12, 7, 0}; - -static yyconst flex_int32_t yy_ec[256] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 1, 5, 1, 1, 6, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 10, 1, 11, 12, - - 13, 14, 1, 15, 16, 1, 17, 18, 19, 1, 1, 20, 21, 22, 23, 24, 25, 1, 26, 27, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - -static yyconst flex_int32_t yy_meta[28] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - -static yyconst flex_int16_t yy_base[56] = {0, 0, 0, 69, 70, 26, 70, 70, 70, 23, 70, 29, 24, 41, 54, 15, 49, 39, 39, - 44, 40, 31, 39, 70, 70, 41, 70, 37, 70, 44, 41, 70, 70, 33, 46, 41, 70, 40, - 70, 31, 34, 37, 36, 70, 27, 26, 70, 70, 27, 30, 33, 70, 26, 70, 70, 70}; - -static yyconst flex_int16_t yy_def[56] = {0, 55, 1, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 0}; - -static yyconst flex_int16_t yy_nxt[98] = { - 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 4, 12, 4, 13, 4, 14, 4, 4, 15, 16, 17, 18, 19, 4, 4, - 4, 20, 4, 21, 23, 24, 25, 26, 21, 27, 22, 28, 31, 32, 54, 22, 25, 26, 25, 26, 41, 53, 42, 52, 51, - 50, 46, 49, 48, 47, 46, 45, 44, 43, 40, 39, 38, 37, 36, 35, 34, 33, 30, 29, 55, 3, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55 - -}; - -static yyconst flex_int16_t yy_chk[98] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 5, 9, 9, 11, 11, 21, 12, 5, 12, 15, 15, 52, 21, 22, 22, 25, 25, 33, 50, 33, 49, 48, - 45, 44, 42, 41, 40, 39, 37, 35, 34, 30, 29, 27, 20, 19, 18, 17, 16, 14, 13, 3, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55 - -}; - -static yy_state_type yy_last_accepting_state; -static char* yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char* yytext; -#line 1 "Manual/lifecycle/Scanner.l" -#line 2 "Manual/lifecycle/Scanner.l" - -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include -#include -#include - -#if defined(_MSC_VER) -# if defined(ICE_64) -// -// '=' : conversion from 'size_t' to 'int', possible loss of data -// The result of fread() is a size_t and gets inserted into an int -// -# pragma warning(disable : 4267) -# endif -// -// 'initializing' : conversion from '__int64' to 'int', possible loss of data -// Puts a pointer-difference into an int -// -# pragma warning(disable : 4244) -// -// conditional expression is constant -// -# pragma warning(disable : 4127) -// -// '<': signed/unsigned mismatch -// -# pragma warning(disable : 4018) -#endif - -#if defined(__GNUC__) -# pragma GCC diagnostic ignored "-Wsign-compare" -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wregister" -#endif - -using namespace std; - -#ifdef _MSC_VER -# ifdef yywrap -# undef yywrap -# define yywrap() 1 -# endif -# define YY_NO_UNISTD_H -#endif - -#ifdef __SUNPRO_CC -# ifdef yywrap -# undef yywrap -# define yywrap() 1 -# endif -# ifdef ICE_64 -# pragma error_messages(off, truncwarn) -# endif -#endif - -#define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) - -#line 552 "Manual/lifecycle/Scanner.cpp" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -# include -#endif - -#ifndef YY_EXTRA_TYPE -# define YY_EXTRA_TYPE void* -#endif - -static int yy_init_globals(void); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy(void); - -int yyget_debug(void); - -void yyset_debug(int debug_flag); - -YY_EXTRA_TYPE yyget_extra(void); - -void yyset_extra(YY_EXTRA_TYPE user_defined); - -FILE* yyget_in(void); - -void yyset_in(FILE* in_str); - -FILE* yyget_out(void); - -void yyset_out(FILE* out_str); - -yy_size_t yyget_leng(void); - -char* yyget_text(void); - -int yyget_lineno(void); - -void yyset_lineno(int line_number); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -# ifdef __cplusplus -extern "C" int yywrap(void); -# else -extern int yywrap(void); -# endif -#endif - -static void yyunput(int c, char* buf_ptr); - -#ifndef yytext_ptr -static void yy_flex_strncpy(char*, yyconst char*, int); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen(yyconst char*); -#endif - -#ifndef YY_NO_INPUT - -# ifdef __cplusplus -static int yyinput(void); -# else -static int input(void); -# endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -# define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -# define ECHO \ - do \ - { \ - if (fwrite(yytext, yyleng, 1, yyout)) \ - { \ - } \ - } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -# define YY_INPUT(buf, result, max_size) \ - if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive) \ - { \ - int c = '*'; \ - size_t n; \ - for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n) \ - buf[n] = (char)c; \ - if (c == '\n') \ - buf[n++] = (char)c; \ - if (c == EOF && ferror(yyin)) \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - result = n; \ - } \ - else \ - { \ - errno = 0; \ - while ((result = fread(buf, 1, max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if (errno != EINTR) \ - { \ - YY_FATAL_ERROR("input in flex scanner failed"); \ - break; \ - } \ - errno = 0; \ - clearerr(yyin); \ - } \ - } - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -# define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -# define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -# define YY_FATAL_ERROR(msg) yy_fatal_error(msg) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -# define YY_DECL_IS_OURS 1 - -extern int yylex(void); - -# define YY_DECL int yylex(void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -# define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -# define YY_BREAK break; -#endif - -#define YY_RULE_SETUP YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 70 "Manual/lifecycle/Scanner.l" - -#line 737 "Manual/lifecycle/Scanner.cpp" - - if (!(yy_init)) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if (!(yy_start)) - (yy_start) = 1; /* first start state */ - - if (!yyin) - yyin = stdin; - - if (!yyout) - yyout = stdout; - - if (!YY_CURRENT_BUFFER) - { - yyensure_buffer_stack(); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); - } - - yy_load_buffer_state(); - } - - while (1) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if (yy_accept[yy_current_state]) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 56) - yy_c = yy_meta[(unsigned int)yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - ++yy_cp; - } while (yy_base[yy_current_state] != 70); - - yy_find_action: - yy_act = yy_accept[yy_current_state]; - if (yy_act == 0) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - do_action: /* This label is used only to access EOF actions. */ - - switch (yy_act) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - - case 1: - YY_RULE_SETUP -#line 72 "Manual/lifecycle/Scanner.l" - { - // C++-style comment - int c; - do - { - c = yyinput(); - } while (c != '\n' && c != EOF); - } - YY_BREAK - case 2: - YY_RULE_SETUP -#line 82 "Manual/lifecycle/Scanner.l" - { - // C-style comment - while (true) - { - int c = yyinput(); - if (c == '*') - { - int next = yyinput(); - if (next == '/') - { - break; - } - else - { - unput(next); - } - } - else if (c == EOF) - { - parser->warning("EOF in comment"); - break; - } - } - } - YY_BREAK - case 3: - YY_RULE_SETUP -#line 107 "Manual/lifecycle/Scanner.l" - { - return TOK_HELP; - } - YY_BREAK - case 4: - YY_RULE_SETUP -#line 111 "Manual/lifecycle/Scanner.l" - { - return TOK_EXIT; - } - YY_BREAK - case 5: - YY_RULE_SETUP -#line 115 "Manual/lifecycle/Scanner.l" - { - return TOK_LIST; - } - YY_BREAK - case 6: - YY_RULE_SETUP -#line 119 "Manual/lifecycle/Scanner.l" - { - return TOK_LIST_RECURSIVE; - } - YY_BREAK - case 7: - YY_RULE_SETUP -#line 123 "Manual/lifecycle/Scanner.l" - { - return TOK_CREATE_FILE; - } - YY_BREAK - case 8: - YY_RULE_SETUP -#line 127 "Manual/lifecycle/Scanner.l" - { - return TOK_CREATE_DIR; - } - YY_BREAK - case 9: - YY_RULE_SETUP -#line 131 "Manual/lifecycle/Scanner.l" - { - return TOK_PWD; - } - YY_BREAK - case 10: - YY_RULE_SETUP -#line 135 "Manual/lifecycle/Scanner.l" - { - return TOK_CD; - } - YY_BREAK - case 11: - YY_RULE_SETUP -#line 139 "Manual/lifecycle/Scanner.l" - { - return TOK_CAT; - } - YY_BREAK - case 12: - YY_RULE_SETUP -#line 143 "Manual/lifecycle/Scanner.l" - { - return TOK_WRITE; - } - YY_BREAK - case 13: - YY_RULE_SETUP -#line 147 "Manual/lifecycle/Scanner.l" - { - return TOK_RM; - } - YY_BREAK - case 14: - /* rule 14 can match eol */ - YY_RULE_SETUP -#line 151 "Manual/lifecycle/Scanner.l" - { - size_t len = strlen(yytext); - for (size_t i = 0; i < len; ++i) - { - if (yytext[i] == '\\') - { - parser->continueLine(); - } - } - } - YY_BREAK - case 15: - /* rule 15 can match eol */ - YY_RULE_SETUP -#line 162 "Manual/lifecycle/Scanner.l" - { - return ';'; - } - YY_BREAK - case 16: - YY_RULE_SETUP -#line 166 "Manual/lifecycle/Scanner.l" - { - // "..."-type strings - string s; - while (true) - { - int c = yyinput(); - if (c == '"') - { - break; - } - else if (c == EOF) - { - parser->warning("EOF in string"); - break; - } - else if (c == '\\') - { - int next = yyinput(); - switch (next) - { - case '\\': - case '"': - { - s += next; - break; - } - - case 'n': - { - s += '\n'; - break; - } - - case 'r': - { - s += '\r'; - break; - } - - case 't': - { - s += '\t'; - break; - } - - case 'v': - { - s += '\v'; - break; - } - - case 'f': - { - s += '\f'; - break; - } - - default: - { - s += c; - unput(next); - } - } - } - else - { - s += c; - } - } - yylvalp->clear(); - yylvalp->push_back(s); - return TOK_STRING; - } - YY_BREAK - case 17: - YY_RULE_SETUP -#line 240 "Manual/lifecycle/Scanner.l" - { - // '...'-type strings - string s; - while (true) - { - int c = yyinput(); - if (c == '\'') - { - break; - } - else if (c == EOF) - { - parser->warning("EOF in string"); - break; - } - else - { - s += c; - } - } - yylvalp->clear(); - yylvalp->push_back(s); - return TOK_STRING; - } - YY_BREAK - case 18: - YY_RULE_SETUP -#line 265 "Manual/lifecycle/Scanner.l" - { - // Simple strings - string s; - s += yytext[0]; - while (true) - { - int c = yyinput(); - if (c == EOF) - { - break; - } - else if (isspace(c) || c == ';') - { - unput(c); - break; - } - - s += c; - } - yylvalp->clear(); - yylvalp->push_back(s); - return TOK_STRING; - } - YY_BREAK - case 19: - YY_RULE_SETUP -#line 289 "Manual/lifecycle/Scanner.l" - ECHO; - YY_BREAK -#line 1098 "Manual/lifecycle/Scanner.cpp" - case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int)(yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ((yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans(yy_current_state); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if (yy_next_state) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else - switch (yy_get_next_buffer()) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if (yywrap()) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if (!(yy_did_buffer_switch_on_eof)) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR("fatal flex scanner internal error--no action found"); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int -yy_get_next_buffer(void) -{ - register char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char* source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1]) - YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed"); - - if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)) - 1; - - for (i = 0; i < number_to_move; ++i) - *(dest++) = *(source++); - - if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while (num_to_read <= 0) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf); - - if (b->yy_is_our_buffer) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if (new_size <= 0) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char*) - /* Include room in for 2 EOB chars. */ - yyrealloc((void*)b->yy_ch_buf, b->yy_buf_size + 2); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if (!b->yy_ch_buf) - YY_FATAL_ERROR("fatal error - scanner input buffer overflow"); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - } - - if (num_to_read > YY_READ_BUF_SIZE) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ((yy_n_chars) == 0) - { - if (number_to_move == YY_MORE_ADJ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t)((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) - { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char*)yyrealloc((void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size); - if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()"); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type -yy_get_previous_state(void) -{ - register yy_state_type yy_current_state; - register char* yy_cp; - - yy_current_state = (yy_start); - - for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if (yy_accept[yy_current_state]) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 56) - yy_c = yy_meta[(unsigned int)yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ -static yy_state_type -yy_try_NUL_trans(yy_state_type yy_current_state) -{ - register int yy_is_jam; - register char* yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if (yy_accept[yy_current_state]) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) - { - yy_current_state = (int)yy_def[yy_current_state]; - if (yy_current_state >= 56) - yy_c = yy_meta[(unsigned int)yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)yy_c]; - yy_is_jam = (yy_current_state == 55); - - return yy_is_jam ? 0 : yy_current_state; -} - -static void -yyunput(int c, register char* yy_bp) -{ - register char* yy_cp; - - yy_cp = (yy_c_buf_p); - - /* undo effects of setting up yytext */ - *yy_cp = (yy_hold_char); - - if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register yy_size_t number_to_move = (yy_n_chars) + 2; - register char* dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - - while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) - *--dest = *--source; - - yy_cp += (int)(dest - source); - yy_bp += (int)(dest - source); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - - if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) - YY_FATAL_ERROR("flex scanner push-back overflow"); - } - - *--yy_cp = (char)c; - - (yytext_ptr) = yy_bp; - (yy_hold_char) = *yy_cp; - (yy_c_buf_p) = yy_cp; -} - -#ifndef YY_NO_INPUT -# ifdef __cplusplus -static int -yyinput(void) -# else -static int -input(void) -# endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch (yy_get_next_buffer()) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if (yywrap()) - return EOF; - - if (!(yy_did_buffer_switch_on_eof)) - YY_NEW_FILE; -# ifdef __cplusplus - return yyinput(); -# else - return input(); -# endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char*)(yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ -void -yyrestart(FILE* input_file) -{ - if (!YY_CURRENT_BUFFER) - { - yyensure_buffer_stack(); - YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE); - } - - yy_init_buffer(YY_CURRENT_BUFFER, input_file); - yy_load_buffer_state(); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ -void -yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) -{ - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack(); - if (YY_CURRENT_BUFFER == new_buffer) - return; - - if (YY_CURRENT_BUFFER) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void -yy_load_buffer_state(void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ -YY_BUFFER_STATE -yy_create_buffer(FILE* file, int size) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state)); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char*)yyalloc(b->yy_buf_size + 2); - if (!b->yy_ch_buf) - YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()"); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b, file); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ -void -yy_delete_buffer(YY_BUFFER_STATE b) -{ - if (!b) - return; - - if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0; - - if (b->yy_is_our_buffer) - yyfree((void*)b->yy_ch_buf); - - yyfree((void*)b); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ -static void -yy_init_buffer(YY_BUFFER_STATE b, FILE* file) - -{ - int oerrno = errno; - - yy_flush_buffer(b); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER) - { - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 1; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ -void -yy_flush_buffer(YY_BUFFER_STATE b) -{ - if (!b) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if (b == YY_CURRENT_BUFFER) - yy_load_buffer_state(); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void -yypush_buffer_state(YY_BUFFER_STATE new_buffer) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if (YY_CURRENT_BUFFER) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state(); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void -yypop_buffer_state(void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) - { - yy_load_buffer_state(); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void -yyensure_buffer_stack(void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) - { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc(num_to_alloc * sizeof(struct yy_buffer_state*)); - if (!(yy_buffer_stack)) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) - { - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = - (struct yy_buffer_state**)yyrealloc((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*)); - if (!(yy_buffer_stack)) - YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()"); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE -yy_scan_buffer(char* base, yy_size_t size) -{ - YY_BUFFER_STATE b; - - if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR || base[size - 1] != YY_END_OF_BUFFER_CHAR) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state)); - if (!b) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()"); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE -yy_scan_string(yyconst char* yystr) { return yy_scan_bytes(yystr, strlen(yystr)); } - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE -yy_scan_bytes(yyconst char* yybytes, yy_size_t _yybytes_len) -{ - YY_BUFFER_STATE b; - char* buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char*)yyalloc(n); - if (!buf) - YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()"); - - for (i = 0; i < _yybytes_len; ++i) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf, n); - if (!b) - YY_FATAL_ERROR("bad buffer in yy_scan_bytes()"); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -# define YY_EXIT_FAILURE 2 -#endif - -static void -yy_fatal_error(yyconst char* msg) -{ - (void)fprintf(stderr, "%s\n", msg); - exit(YY_EXIT_FAILURE); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg); \ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } while (0) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int -yyget_lineno(void) -{ - return yylineno; -} - -/** Get the input stream. - * - */ -FILE* -yyget_in(void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE* -yyget_out(void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -yy_size_t -yyget_leng(void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char* -yyget_text(void) -{ - return yytext; -} - -/** Set the current line number. - * @param line_number - * - */ -void -yyset_lineno(int line_number) -{ - yylineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void -yyset_in(FILE* in_str) -{ - yyin = in_str; -} - -void -yyset_out(FILE* out_str) -{ - yyout = out_str; -} - -int -yyget_debug(void) -{ - return yy_flex_debug; -} - -void -yyset_debug(int bdebug) -{ - yy_flex_debug = bdebug; -} - -static int -yy_init_globals(void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char*)0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE*)0; - yyout = (FILE*)0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int -yylex_destroy(void) -{ - /* Pop the buffer stack, destroying each element. */ - while (YY_CURRENT_BUFFER) - { - yy_delete_buffer(YY_CURRENT_BUFFER); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack)); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals(); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void -yy_flex_strncpy(char* s1, yyconst char* s2, int n) -{ - register int i; - for (i = 0; i < n; ++i) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int -yy_flex_strlen(yyconst char* s) -{ - register int n; - for (n = 0; s[n]; ++n) - ; - - return n; -} -#endif - -void* -yyalloc(yy_size_t size) -{ - return (void*)malloc(size); -} - -void* -yyrealloc(void* ptr, yy_size_t size) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void*)realloc((char*)ptr, size); -} - -void -yyfree(void* ptr) -{ - free((char*)ptr); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 289 "Manual/lifecycle/Scanner.l" - -#include diff --git a/cpp/Manual/lifecycle/Scanner.l b/cpp/Manual/lifecycle/Scanner.l deleted file mode 100644 index d594be6f72..0000000000 --- a/cpp/Manual/lifecycle/Scanner.l +++ /dev/null @@ -1,293 +0,0 @@ -%{ - -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include -#include -#include - -#if defined(_MSC_VER) -#if defined(ICE_64) -// -// '=' : conversion from 'size_t' to 'int', possible loss of data -// The result of fread() is a size_t and gets inserted into an int -// -# pragma warning(disable:4267) -#endif -// -// 'initializing' : conversion from '__int64' to 'int', possible loss of data -// Puts a pointer-difference into an int -// -# pragma warning(disable:4244) -// -// conditional expression is constant -// -# pragma warning(disable:4127) -// -// '<': signed/unsigned mismatch -// -# pragma warning(disable:4018) -#endif - -#if defined(__GNUC__) -# pragma GCC diagnostic ignored "-Wsign-compare" -#endif - -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wconversion" -#endif - -using namespace std; - -#ifdef _MSC_VER -# ifdef yywrap -# undef yywrap -# define yywrap() 1 -# endif -# define YY_NO_UNISTD_H -#endif - -#ifdef __SUNPRO_CC -# ifdef yywrap -# undef yywrap -# define yywrap() 1 -# endif -# ifdef ICE_64 -# pragma error_messages(off,truncwarn) -# endif -#endif - -#define YY_INPUT(buf, result, maxSize) parser->getInput(buf, result, maxSize) - -%} - -WS [ \t\v\f\r] -NL [\n] - -%option noyywrap -%option always-interactive - -%% - -"//" { - // C++-style comment - int c; - do - { - c = yyinput(); - } - while(c != '\n' && c != EOF); -} - -"/*" { - // C-style comment - while(true) - { - int c = yyinput(); - if(c == '*') - { - int next = yyinput(); - if(next == '/') - { - break; - } - else - { - unput(next); - } - } - else if(c == EOF) - { - parser->warning("EOF in comment"); - break; - } - } -} - -"help" { - return TOK_HELP; -} - -"quit"|"exit" { - return TOK_EXIT; -} - -"ls" { - return TOK_LIST; -} - -"lr" { - return TOK_LIST_RECURSIVE; -} - -"mkfile" { - return TOK_CREATE_FILE; -} - -"mkdir" { - return TOK_CREATE_DIR; -} - -"pwd" { - return TOK_PWD; -} - -"cd" { - return TOK_CD; -} - -"cat" { - return TOK_CAT; -} - -"write" { - return TOK_WRITE; -} - -"rm" { - return TOK_RM; -} - -{WS}*(\\{WS}*{NL})? { - size_t len = strlen(yytext); - for(size_t i = 0; i < len; ++i) - { - if(yytext[i] == '\\') - { - parser->continueLine(); - } - } -} - -{NL}|; { - return ';'; -} - -\" { - // "..."-type strings - string s; - while(true) - { - int c = yyinput(); - if(c == '"') - { - break; - } - else if(c == EOF) - { - parser->warning("EOF in string"); - break; - } - else if(c == '\\') - { - int next = yyinput(); - switch(next) - { - case '\\': - case '"': - { - s += next; - break; - } - - case 'n': - { - s += '\n'; - break; - } - - case 'r': - { - s += '\r'; - break; - } - - case 't': - { - s += '\t'; - break; - } - - case 'v': - { - s += '\v'; - break; - } - - case 'f': - { - s += '\f'; - break; - } - - default: - { - s += c; - unput(next); - } - } - } - else - { - s += c; - } - } - yylvalp->clear(); - yylvalp->push_back(s); - return TOK_STRING; -} - -\' { - // '...'-type strings - string s; - while(true) - { - int c = yyinput(); - if(c == '\'') - { - break; - } - else if(c == EOF) - { - parser->warning("EOF in string"); - break; - } - else - { - s += c; - } - } - yylvalp->clear(); - yylvalp->push_back(s); - return TOK_STRING; -} - -. { - // Simple strings - string s; - s += yytext[0]; - while(true) - { - int c = yyinput(); - if(c == EOF) - { - break; - } - else if(isspace(c) || c == ';') - { - unput(c); - break; - } - - s += c; - } - yylvalp->clear(); - yylvalp->push_back(s); - return TOK_STRING; -} - -%% - -#include diff --git a/cpp/Manual/lifecycle/Server.cpp b/cpp/Manual/lifecycle/Server.cpp deleted file mode 100644 index 8d8d7d827c..0000000000 --- a/cpp/Manual/lifecycle/Server.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include -#include - -using namespace std; -using namespace Filesystem; -using namespace FilesystemI; - -int -main(int argc, char* argv[]) -{ - int status = 0; - - try - { - // - // CtrlCHandler must be created before the communicator or any other threads are started - // - Ice::CtrlCHandler ctrlCHandler; - - // - // CommunicatorHolder's ctor initializes an Ice communicator, - // and its dtor destroys this communicator. - // - const Ice::CommunicatorHolder ich(argc, argv); - const auto& communicator = ich.communicator(); - - auto appName = argv[0]; - ctrlCHandler.setCallback( - [communicator, appName](int) - { - communicator->shutdown(); - cerr << appName << ": received signal, shutting down" << endl; - }); - - // - // The communicator initialization removes all Ice-related arguments from argc/argv - // - if (argc > 1) - { - cerr << argv[0] << ": too many arguments" << endl; - status = 1; - } - else - { - // - // Create an object adapter. - // - auto adapter = - communicator->createObjectAdapterWithEndpoints("SimpleFilesystem", "default -h 127.0.0.1 -p 10000"); - - // - // Create the root directory. - // - auto root = make_shared(); - Ice::Identity id; - id.name = "RootDir"; - adapter->add(root, id); - - // - // All objects are created, allow client requests now. - // - adapter->activate(); - - // - // Wait until we are done. - // - communicator->waitForShutdown(); - } - } - catch (const std::exception& ex) - { - cerr << ex.what() << endl; - status = 1; - } - - return status; -} diff --git a/cpp/Manual/lifecycle/msbuild/client/client.vcxproj b/cpp/Manual/lifecycle/msbuild/client/client.vcxproj deleted file mode 100644 index c71604be4f..0000000000 --- a/cpp/Manual/lifecycle/msbuild/client/client.vcxproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - client - {332A63F9-BBD9-4324-8C1E-26604C71D54F} - - - - Application - false - $(DefaultPlatformToolset) - true - - - Application - false - Unicode - $(DefaultPlatformToolset) - false - - - Application - false - $(DefaultPlatformToolset) - true - - - Application - false - Unicode - $(DefaultPlatformToolset) - false - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\ - $(Platform)\$(Configuration)\ - false - ..\..\ - $(Platform)\$(Configuration)\ - false - ..\..\ - $(Platform)\$(Configuration)\ - ..\..\ - $(Platform)\$(Configuration)\ - - - cpp98 - - - - OnlyExplicitInline - ICE_CPP11_MAPPING;_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO /IGNORE:4089 %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX86 - - - - - OnlyExplicitInline - ICE_CPP11_MAPPING;_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO /IGNORE:4089 %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX64 - - - - - ICE_CPP11_MAPPING;_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX86 - - - - - ICE_CPP11_MAPPING;_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX64 - - - - - $(Platform)\$(Configuration) - - - - - - - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - - - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - - \ No newline at end of file diff --git a/cpp/Manual/lifecycle/msbuild/client/client.vcxproj.filters b/cpp/Manual/lifecycle/msbuild/client/client.vcxproj.filters deleted file mode 100644 index 10c679ff00..0000000000 --- a/cpp/Manual/lifecycle/msbuild/client/client.vcxproj.filters +++ /dev/null @@ -1,110 +0,0 @@ - - - - - {fe251ff8-d9d5-4963-a8d8-732c824d8e5f} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {a5fa7e8b-6bc1-48f2-8663-9617c0fd949f} - h;hpp;hxx;hm;inl - - - {5985c286-d8de-440e-a59d-2b9c2a77be24} - - - {d76fb713-3805-4347-b9df-4825050cdb7e} - ice - - - {f0a2f179-523c-4372-b20e-5c00bf40e832} - - - {c02204f4-e2bb-4c5d-bedb-469fb8161867} - - - {16b125e8-e15d-4ac1-8121-f34c2b76b229} - - - {aca62e10-a3d0-4e0f-a6d3-2a0d71da7861} - - - {30a402f4-fad4-46dc-a0a2-6935fa4fc362} - - - {acb04099-fa63-4148-b31e-e74171d8385d} - - - {916993c5-47a1-45d3-b197-2ac6fd53e85b} - - - {2d45376e-fd94-416d-adb3-0c6a21796639} - - - {fa572afc-6124-4528-a901-da395f71fb83} - - - {714bbd91-903b-4e52-bcfe-26bc3f2320e1} - - - {520397b3-1c67-4662-a958-2932e7d10c2e} - - - {5203e0ce-a945-41f2-b573-fb22540945c3} - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files\Win32\Debug - - - Source Files\x64\Debug - - - Source Files\Win32\Release - - - Source Files\x64\Release - - - - - Header Files - - - Header Files - - - Header Files\Win32\Debug - - - Header Files\x64\Debug - - - Header Files\Win32\Release - - - Header Files\x64\Release - - - - - - - - Slice Files - - - \ No newline at end of file diff --git a/cpp/Manual/lifecycle/msbuild/client/client.vcxproj.user b/cpp/Manual/lifecycle/msbuild/client/client.vcxproj.user deleted file mode 100644 index cedf471f6b..0000000000 --- a/cpp/Manual/lifecycle/msbuild/client/client.vcxproj.user +++ /dev/null @@ -1,19 +0,0 @@ - - - - ..\.. - WindowsLocalDebugger - - - ..\.. - WindowsLocalDebugger - - - ..\.. - WindowsLocalDebugger - - - ..\.. - WindowsLocalDebugger - - \ No newline at end of file diff --git a/cpp/Manual/lifecycle/msbuild/client/packages.config b/cpp/Manual/lifecycle/msbuild/client/packages.config deleted file mode 100644 index 0d37245cd4..0000000000 --- a/cpp/Manual/lifecycle/msbuild/client/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cpp/Manual/lifecycle/msbuild/server/packages.config b/cpp/Manual/lifecycle/msbuild/server/packages.config deleted file mode 100644 index 0d37245cd4..0000000000 --- a/cpp/Manual/lifecycle/msbuild/server/packages.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cpp/Manual/lifecycle/msbuild/server/server.vcxproj b/cpp/Manual/lifecycle/msbuild/server/server.vcxproj deleted file mode 100644 index 6336d429b5..0000000000 --- a/cpp/Manual/lifecycle/msbuild/server/server.vcxproj +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - server - {95043699-A842-4E16-A95B-13E02709B210} - - - - Application - false - $(DefaultPlatformToolset) - true - - - Application - false - Unicode - $(DefaultPlatformToolset) - false - - - Application - false - $(DefaultPlatformToolset) - true - - - Application - false - Unicode - $(DefaultPlatformToolset) - false - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - ..\..\ - $(Platform)\$(Configuration)\ - false - ..\..\ - $(Platform)\$(Configuration)\ - false - ..\..\ - $(Platform)\$(Configuration)\ - ..\..\ - $(Platform)\$(Configuration)\ - - - cpp98 - - - - OnlyExplicitInline - ICE_CPP11_MAPPING;_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO /IGNORE:4089 %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX86 - - - - - OnlyExplicitInline - ICE_CPP11_MAPPING;_CONSOLE;NDEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO /IGNORE:4089 %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX64 - - - - - ICE_CPP11_MAPPING;_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX86 - - - - - ICE_CPP11_MAPPING;_CONSOLE;_DEBUG;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Level4 - true - $(Platform)\$(Configuration);..\..;%(AdditionalIncludeDirectories) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - /FIXED:NO %(AdditionalOptions) - setargv.obj;%(AdditionalDependencies) - Console - - - MachineX64 - - - - - $(Platform)\$(Configuration) - - - - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - - - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - true - true - true - ..\..\Filesystem.ice - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - - - - \ No newline at end of file diff --git a/cpp/Manual/lifecycle/msbuild/server/server.vcxproj.filters b/cpp/Manual/lifecycle/msbuild/server/server.vcxproj.filters deleted file mode 100644 index 51dc62bb8e..0000000000 --- a/cpp/Manual/lifecycle/msbuild/server/server.vcxproj.filters +++ /dev/null @@ -1,102 +0,0 @@ - - - - - {363bd847-1218-472b-9afe-326a231eef25} - h;hpp;hxx;hm;inl - - - {3270663e-4dfd-40dd-92e0-4d9754151590} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {e0064836-3aec-4669-9f2d-1d1b062120a6} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - {0dd46bd7-5c10-4a1d-bdd8-8f63403b6983} - ice - - - {750cd9d0-afaf-4ec3-b4ff-75bd7903d22a} - - - {de5c1c6b-ab69-4a33-bf7f-2238ee6b3a78} - - - {1cd9cb54-d822-4e9f-ba99-c9a2a17c8640} - - - {34e2ff1d-fcac-4d21-96ec-5b5247cee3ca} - - - {dfd5bebf-62ef-4232-98ec-c84feb8f01a8} - - - {826d3c80-a746-4541-bc38-30cdd80ccfd3} - - - {6b2455f5-ebdb-44ba-a614-3cd582e2213e} - - - {131abd80-82bb-4833-9978-57e5be894aa6} - - - {da6478b0-405a-4d49-ad01-ac9a8ae93035} - - - {d6b1a19e-25ed-4877-aada-b45adc65d4da} - - - {59074003-c881-4d83-a66e-da4a8831b703} - - - {bc8a034c-d836-46b3-83ce-80adeec3fed1} - - - - - Header Files - - - Header Files\Win32\Debug - - - Header Files\x64\Debug - - - Header Files\Win32\Release - - - Header Files\x64\Release - - - - - Source Files - - - Source Files - - - Source Files\Win32\Debug - - - Source Files\x64\Debug - - - Source Files\Win32\Release - - - Source Files\x64\Release - - - - - - - - Slice Files - - - \ No newline at end of file diff --git a/cpp/Manual/lifecycle/msbuild/server/server.vcxproj.user b/cpp/Manual/lifecycle/msbuild/server/server.vcxproj.user deleted file mode 100644 index cedf471f6b..0000000000 --- a/cpp/Manual/lifecycle/msbuild/server/server.vcxproj.user +++ /dev/null @@ -1,19 +0,0 @@ - - - - ..\.. - WindowsLocalDebugger - - - ..\.. - WindowsLocalDebugger - - - ..\.. - WindowsLocalDebugger - - - ..\.. - WindowsLocalDebugger - - \ No newline at end of file diff --git a/cpp/Manual/printer/Client.cpp b/cpp/Manual/printer/Client.cpp index a5ba08bcb1..880b8acd9f 100644 --- a/cpp/Manual/printer/Client.cpp +++ b/cpp/Manual/printer/Client.cpp @@ -2,9 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Printer.h" #include -#include -#include +#include using namespace std; using namespace Demo; diff --git a/cpp/Manual/printer/Server.cpp b/cpp/Manual/printer/Server.cpp index 26b61cbc2b..0dcf787dcd 100644 --- a/cpp/Manual/printer/Server.cpp +++ b/cpp/Manual/printer/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Printer.h" #include -#include +#include using namespace std; using namespace Demo; diff --git a/cpp/Manual/simpleFilesystem/Client.cpp b/cpp/Manual/simpleFilesystem/Client.cpp index 84e4ceb668..355c0afccb 100644 --- a/cpp/Manual/simpleFilesystem/Client.cpp +++ b/cpp/Manual/simpleFilesystem/Client.cpp @@ -5,8 +5,6 @@ #include #include #include -#include -#include using namespace std; using namespace Filesystem; @@ -16,7 +14,7 @@ using namespace Filesystem; // parameter is the current nesting level (for indentation). static void -listRecursive(const shared_ptr& dir, size_t depth = 0) +listRecursive(const optional& dir, size_t depth = 0) { const string indent(++depth, '\t'); diff --git a/cpp/Manual/simpleFilesystem/FilesystemI.cpp b/cpp/Manual/simpleFilesystem/FilesystemI.cpp index 91a86f14e7..d392d543bb 100644 --- a/cpp/Manual/simpleFilesystem/FilesystemI.cpp +++ b/cpp/Manual/simpleFilesystem/FilesystemI.cpp @@ -64,7 +64,7 @@ Filesystem::DirectoryI::DirectoryI(string name, const shared_ptr& pa // addChild is called by the child in order to add // itself to the _contents member of the parent void -Filesystem::DirectoryI::addChild(const shared_ptr& child) +Filesystem::DirectoryI::addChild(const optional& child) { _contents.push_back(child); } diff --git a/cpp/Manual/simpleFilesystem/FilesystemI.h b/cpp/Manual/simpleFilesystem/FilesystemI.h index 308c577838..c75365e88d 100644 --- a/cpp/Manual/simpleFilesystem/FilesystemI.h +++ b/cpp/Manual/simpleFilesystem/FilesystemI.h @@ -31,11 +31,11 @@ namespace Filesystem std::shared_ptr _parent; }; - class FileI : public File, public NodeI + class FileI final : public File, public NodeI { public: - virtual Lines read(const Ice::Current&) override; - virtual void write(Lines, const Ice::Current&) override; + Lines read(const Ice::Current&) final; + void write(Lines, const Ice::Current&) final; FileI(std::string, const std::shared_ptr&); @@ -46,9 +46,9 @@ namespace Filesystem class DirectoryI : public Directory, public NodeI { public: - virtual NodeSeq list(const Ice::Current&) override; + NodeSeq list(const Ice::Current&) final; DirectoryI(std::string, const std::shared_ptr&); - void addChild(const std::shared_ptr&); + void addChild(const std::optional&); private: NodeSeq _contents; diff --git a/cpp/Manual/simpleFilesystem/Server.cpp b/cpp/Manual/simpleFilesystem/Server.cpp index a859cb6505..6d73629ccf 100644 --- a/cpp/Manual/simpleFilesystem/Server.cpp +++ b/cpp/Manual/simpleFilesystem/Server.cpp @@ -2,8 +2,9 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -#include +#include "FilesystemI.h" #include +#include using namespace std; using namespace Filesystem; diff --git a/cpp/make/Make.rules b/cpp/make/Make.rules index 6983285427..34f7e4beee 100644 --- a/cpp/make/Make.rules +++ b/cpp/make/Make.rules @@ -36,10 +36,6 @@ cpp-dependencies += IceBT IceBT_dependencies := Ice endif -# Append ++11 suffix to libraries -shared_targetname = $(if $(filter-out $($1_target),program),++11) -static_targetname = $(if $(filter-out $($1_target),program),++11) - # Create component dependency variables $(eval $(call create-project-dependencies,ice,$(ICE_HOME),cpp,cpp,$(cpp-dependencies))) @@ -52,14 +48,6 @@ $(foreach v,$(supported-platforms) platform config,$(eval $v_targetdir := ) $(ev slice2cpp_targetext = cpp slice2cpp_path = $(or $(ice_bindir[$(build-platform)]),$(ice_bindir))/slice2cpp -# With Xcode 14.3 C++17 deprecations apply when building with -std=c++11, we pass -std=c++17 -# to enable C++17 mode conditional code. -ifeq ($(os),Darwin) -ice_cpp_mode = c++17 -else -ice_cpp_mode = c++11 -endif - ifeq ($(wildcard $(slice2cpp_path)),) $(error Can't find Ice distribution, please set ICE_HOME to the Ice installation directory) endif @@ -73,7 +61,7 @@ $1_srcext := cpp $1_dependencies := $$(or $$($1_dependencies),Ice) $1_slicecompiler := slice2cpp $1_sliceflags := -I$(ice_slicedir) -I$1 $$($1_sliceflags) -$1_cppflags := -DICE_CPP11_MAPPING -std=$(ice_cpp_mode) -I$1 -I$1/generated $(ice_cppflags) $$($1_cppflags) +$1_cppflags := -DICE_CPP11_MAPPING -std=c++17 -I$1 -I$1/generated $(ice_cppflags) $$($1_cppflags) $1_caninstall := no # Also link with IceSSL, IceDiscovery and IceLocatorDiscovery when compiling the project with the static configuration diff --git a/csharp/Glacier2/callback/config.glacier2 b/csharp/Glacier2/callback/config.glacier2 index 07c23c3eb6..1927863457 100644 --- a/csharp/Glacier2/callback/config.glacier2 +++ b/csharp/Glacier2/callback/config.glacier2 @@ -23,13 +23,6 @@ Glacier2.Server.Endpoints=tcp -h localhost # Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 - # # Glacier can forward requests buffered or unbuffered. Unbuffered # means a lower resource consumption, as buffering requires one diff --git a/csharp/IceStorm/clock/config.icebox b/csharp/IceStorm/clock/config.icebox index 07df371852..6a9d4b9357 100644 --- a/csharp/IceStorm/clock/config.icebox +++ b/csharp/IceStorm/clock/config.icebox @@ -9,7 +9,7 @@ Ice.Admin.InstanceName=icebox # The IceStorm service. The service is configured using a separate # configuration file (see config.service). # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions diff --git a/java/Database/library/config.glacier2 b/java/Database/library/config.glacier2 index 3164dd4d3f..d6b7850235 100644 --- a/java/Database/library/config.glacier2 +++ b/java/Database/library/config.glacier2 @@ -29,13 +29,6 @@ Glacier2.SessionManager=LibrarySessionManager:tcp -h localhost -p 10000 # Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 - # # Security Tracing # diff --git a/java/Glacier2/callback/config.glacier2 b/java/Glacier2/callback/config.glacier2 index f38ed422cb..ed378f8b38 100644 --- a/java/Glacier2/callback/config.glacier2 +++ b/java/Glacier2/callback/config.glacier2 @@ -23,13 +23,6 @@ Glacier2.Server.Endpoints=tcp -h localhost # Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 - # # Glacier can forward requests buffered or unbuffered. Unbuffered # means a lower resource consumption, as buffering requires one diff --git a/java/IceGrid/icebox/application.xml b/java/IceGrid/icebox/application.xml index 23ae94a1ed..c92e331dd6 100644 --- a/java/IceGrid/icebox/application.xml +++ b/java/IceGrid/icebox/application.xml @@ -4,10 +4,10 @@ - - - - + + + + @@ -18,8 +18,7 @@ - + @@ -27,14 +26,12 @@ - - @@ -45,10 +42,7 @@ - + diff --git a/java/IceStorm/clock/config.icebox b/java/IceStorm/clock/config.icebox index c55ca9dcd6..b6b1d14255 100644 --- a/java/IceStorm/clock/config.icebox +++ b/java/IceStorm/clock/config.icebox @@ -9,7 +9,7 @@ Ice.Admin.InstanceName=icebox # The IceStorm service. The service is configured using a separate # configuration file (see config.service). # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions diff --git a/make/Make.rules b/make/Make.rules index 436b71e352..f45afe100b 100644 --- a/make/Make.rules +++ b/make/Make.rules @@ -49,8 +49,8 @@ include $(top_srcdir)/make/Make.demos.rules # # The version/soversion variables are used for versionning plugins built with the demos. # -version = 3.7.10 -soversion = 37 +version = 3.8.0 +soversion = 38a0 compatversion = $(version) static_projects = % diff --git a/php/Glacier2/hello/config.glacier2 b/php/Glacier2/hello/config.glacier2 index 31745e1fc2..4ae3f1bf1c 100644 --- a/php/Glacier2/hello/config.glacier2 +++ b/php/Glacier2/hello/config.glacier2 @@ -14,10 +14,3 @@ Glacier2.Client.Endpoints=tcp -p 4063 -h localhost # verifier allows any user-id / password combination. # Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier - -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 diff --git a/python/Glacier2/callback/config.glacier2 b/python/Glacier2/callback/config.glacier2 index f930c8cb43..9ee609006e 100644 --- a/python/Glacier2/callback/config.glacier2 +++ b/python/Glacier2/callback/config.glacier2 @@ -23,13 +23,6 @@ Glacier2.Server.Endpoints=tcp -h 127.0.0.1 # Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 - # # Glacier can forward requests buffered or unbuffered. Unbuffered # means a lower resource consumption, as buffering requires one diff --git a/python/IceStorm/clock/config.icebox b/python/IceStorm/clock/config.icebox index c55ca9dcd6..b6b1d14255 100644 --- a/python/IceStorm/clock/config.icebox +++ b/python/IceStorm/clock/config.icebox @@ -9,7 +9,7 @@ Ice.Admin.InstanceName=icebox # The IceStorm service. The service is configured using a separate # configuration file (see config.service). # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions diff --git a/swift/Glacier2/callback/config.glacier2 b/swift/Glacier2/callback/config.glacier2 index 8abf11f145..e773f87aad 100644 --- a/swift/Glacier2/callback/config.glacier2 +++ b/swift/Glacier2/callback/config.glacier2 @@ -23,13 +23,6 @@ Glacier2.Server.Endpoints=tcp -h localhost # Glacier2.PermissionsVerifier=DemoGlacier2/NullPermissionsVerifier -# -# The timeout for inactive sessions. If any client session is inactive -# for longer than this value, the session expires and is removed. The -# unit is seconds. -# -Glacier2.SessionTimeout=30 - # # Glacier can forward requests buffered or unbuffered. Unbuffered # means a lower resource consumption, as buffering requires one diff --git a/swift/IceStorm/clock/config.icebox b/swift/IceStorm/clock/config.icebox index 31773667a7..f6ef8b4de1 100644 --- a/swift/IceStorm/clock/config.icebox +++ b/swift/IceStorm/clock/config.icebox @@ -10,7 +10,7 @@ Ice.Admin.InstanceName=icebox # The IceStorm service. The service is configured using a separate # configuration file (see config.service). # -IceBox.Service.IceStorm=IceStormService,37:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,38a0:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions From 7409f297f10f4751e208bbec21910e4211c600ad Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 12:07:35 -0400 Subject: [PATCH 02/18] Fixe --- .github/workflows/ci.yml | 17 +++++++++++++++-- .gitignore | 6 ++++-- cpp/Chat/server/ChatSessionI.cpp | 2 -- cpp/Glacier2/callback/Client.cpp | 2 +- cpp/Glacier2/simpleChat/Client.cpp | 2 +- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48979ca54b..9fca097625 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,13 +13,16 @@ concurrency: group: ${{ github.head_ref || github.run_id }} cancel-in-progress: true +env: + ICE_HOME: ${{ github.workspace }}/ice + jobs: ci: name: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-22.04, macos-14, windows-2022] runs-on: ${{ matrix.os }} steps: @@ -37,7 +40,8 @@ jobs: uses: ./ice/.github/actions/build timeout-minutes: 90 with: - working_directory: ice/cpp + working_directory: ice + build_flags: srcs - name: Checkout repository uses: actions/checkout@v4 @@ -50,3 +54,12 @@ jobs: run: | export ICE_HOME=$GITHUB_WORKSPACE/ice make + if: ${{ runner.os != 'Windows' }} + + - name: Build Ice Demos on ${{ matrix.os }} + timeout-minutes: 90 + working-directory: ice-demos/cpp + run: | + export ICE_HOME=$GITHUB_WORKSPACE/ice + make + if: ${{ runner.os == 'Windows' }} diff --git a/.gitignore b/.gitignore index 877862daa1..9945c77f50 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,11 @@ publisher subscriber talk chatserver +chatgl2client +chatpollclient -!Chat/client/ -!Chat/server/ +!**/Chat/client/ +!**/Chat/server/ !**/msbuild/client !**/msbuild/server diff --git a/cpp/Chat/server/ChatSessionI.cpp b/cpp/Chat/server/ChatSessionI.cpp index 42ae9a9816..6ad761370c 100644 --- a/cpp/Chat/server/ChatSessionI.cpp +++ b/cpp/Chat/server/ChatSessionI.cpp @@ -131,8 +131,6 @@ ChatSessionI::setCallback(optional callback, const Ic return; } - callback->ice_ping(); - Ice::Context ctx; ctx["_fwd"] = "o"; _callback = make_shared( diff --git a/cpp/Glacier2/callback/Client.cpp b/cpp/Glacier2/callback/Client.cpp index dc9058e60f..0fe5810741 100644 --- a/cpp/Glacier2/callback/Client.cpp +++ b/cpp/Glacier2/callback/Client.cpp @@ -65,7 +65,7 @@ run(const shared_ptr& communicator) if (!defaultRouter) { cerr << "no router configured" << endl; - return; + exit(1); } const Glacier2::RouterPrx router = Glacier2::RouterPrx(*communicator->getDefaultRouter()); diff --git a/cpp/Glacier2/simpleChat/Client.cpp b/cpp/Glacier2/simpleChat/Client.cpp index 21bc05b929..6d6ab01e6d 100644 --- a/cpp/Glacier2/simpleChat/Client.cpp +++ b/cpp/Glacier2/simpleChat/Client.cpp @@ -73,7 +73,7 @@ run(const shared_ptr& communicator) if (!defaultRouter) { cerr << "no router configured" << endl; - return; + exit(1); } const Glacier2::RouterPrx router = Glacier2::RouterPrx(*communicator->getDefaultRouter()); optional session; From 0466885802c79da2023d632bfaf61089d151495a Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 12:11:11 -0400 Subject: [PATCH 03/18] CI cleanup --- .github/workflows/ci.yml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fca097625..1c6222e8f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Setup Ice Build Dependencies uses: ./ice/.github/actions/setup-dependencies - - name: Build Iice on ${{ matrix.os }} + - name: Build Ice on ${{ matrix.os }} uses: ./ice/.github/actions/build timeout-minutes: 90 with: @@ -48,18 +48,9 @@ jobs: with: path: ice-demos - - name: Build Ice Demos on ${{ matrix.os }} - timeout-minutes: 90 - working-directory: ice-demos/cpp - run: | - export ICE_HOME=$GITHUB_WORKSPACE/ice - make - if: ${{ runner.os != 'Windows' }} - - - name: Build Ice Demos on ${{ matrix.os }} - timeout-minutes: 90 - working-directory: ice-demos/cpp - run: | - export ICE_HOME=$GITHUB_WORKSPACE/ice - make - if: ${{ runner.os == 'Windows' }} + - name: Build C++ Demos on ${{ matrix.os }} + uses: ./ice/.github/actions/build + timeout-minutes: 30 + with: + working_directory: ice/cpp + msbuild_project: C++11 demos.sln From 80b123640b410450563a80e2356272ce7a091b3d Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 13:56:07 -0400 Subject: [PATCH 04/18] Another CI fix --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c6222e8f1..7778cb3788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,6 @@ jobs: timeout-minutes: 90 with: working_directory: ice - build_flags: srcs - name: Checkout repository uses: actions/checkout@v4 From a4b186956a4186bc87487ced4a3c899df1470627 Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 14:00:51 -0400 Subject: [PATCH 05/18] Review fixes --- .github/workflows/ci.yml | 2 +- cpp/{C++11 Qt demos.sln => C++ Qt demos.sln} | 0 cpp/{C++11 demos.sln => C++ demos.sln} | 0 cpp/Chat/client/Client.cpp | 6 ++---- cpp/Glacier2/callback/Client.cpp | 5 ++--- cpp/Glacier2/simpleChat/Client.cpp | 5 ++--- 6 files changed, 7 insertions(+), 11 deletions(-) rename cpp/{C++11 Qt demos.sln => C++ Qt demos.sln} (100%) rename cpp/{C++11 demos.sln => C++ demos.sln} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7778cb3788..a842cb5974 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,4 +52,4 @@ jobs: timeout-minutes: 30 with: working_directory: ice/cpp - msbuild_project: C++11 demos.sln + msbuild_project: C++ demos.sln diff --git a/cpp/C++11 Qt demos.sln b/cpp/C++ Qt demos.sln similarity index 100% rename from cpp/C++11 Qt demos.sln rename to cpp/C++ Qt demos.sln diff --git a/cpp/C++11 demos.sln b/cpp/C++ demos.sln similarity index 100% rename from cpp/C++11 demos.sln rename to cpp/C++ demos.sln diff --git a/cpp/Chat/client/Client.cpp b/cpp/Chat/client/Client.cpp index d229b1134b..c4ec459a31 100644 --- a/cpp/Chat/client/Client.cpp +++ b/cpp/Chat/client/Client.cpp @@ -84,8 +84,7 @@ createSession(Glacier2::RouterPrx router) optional session{router->createSession(id, pw)}; if (!session) { - cerr << "Glaicer2::createSession return null. Is the SessionManager configured?" << endl; - exit(1); + throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); } router->ice_getCachedConnection()->setCloseCallback( [](Ice::ConnectionPtr) @@ -116,8 +115,7 @@ run(shared_ptr communicator) optional router{communicator->getDefaultRouter()}; if (!router) { - cerr << "No router configured" << endl; - exit(1); + throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); } // Create a session with the Glacier2 router diff --git a/cpp/Glacier2/callback/Client.cpp b/cpp/Glacier2/callback/Client.cpp index 0fe5810741..5147f1d18c 100644 --- a/cpp/Glacier2/callback/Client.cpp +++ b/cpp/Glacier2/callback/Client.cpp @@ -64,10 +64,9 @@ run(const shared_ptr& communicator) optional defaultRouter = communicator->getDefaultRouter(); if (!defaultRouter) { - cerr << "no router configured" << endl; - exit(1); + throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); } - const Glacier2::RouterPrx router = Glacier2::RouterPrx(*communicator->getDefaultRouter()); + const Glacier2::RouterPrx router = Glacier2::RouterPrx(*defaultRouter); optional session; // diff --git a/cpp/Glacier2/simpleChat/Client.cpp b/cpp/Glacier2/simpleChat/Client.cpp index 6d6ab01e6d..a5e831aba5 100644 --- a/cpp/Glacier2/simpleChat/Client.cpp +++ b/cpp/Glacier2/simpleChat/Client.cpp @@ -72,10 +72,9 @@ run(const shared_ptr& communicator) optional defaultRouter = communicator->getDefaultRouter(); if (!defaultRouter) { - cerr << "no router configured" << endl; - exit(1); + throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); } - const Glacier2::RouterPrx router = Glacier2::RouterPrx(*communicator->getDefaultRouter()); + const Glacier2::RouterPrx router = Glacier2::RouterPrx(*defaultRouter); optional session; while (!session) { From 72f29dfa092ef2210a66d1f76fecb510528cf47b Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 14:06:10 -0400 Subject: [PATCH 06/18] More review fixes --- cpp/Glacier2/simpleChat/ChatSessionI.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cpp/Glacier2/simpleChat/ChatSessionI.cpp b/cpp/Glacier2/simpleChat/ChatSessionI.cpp index c8ef8f6c43..7b63879f90 100644 --- a/cpp/Glacier2/simpleChat/ChatSessionI.cpp +++ b/cpp/Glacier2/simpleChat/ChatSessionI.cpp @@ -19,8 +19,8 @@ class ChatRoom public: static ChatRoom* instance(); - void enter(const ChatSessionPrx&, const ChatCallbackPrx&, const Ice::Current&); - void leave(const ChatCallbackPrx&, const Ice::Current&); + void enter(ChatSessionPrx, ChatCallbackPrx, const Ice::Current&); + void leave(ChatCallbackPrx, const Ice::Current&); void message(const string&) const; void deadRouter(const shared_ptr&); void destroy(); @@ -43,7 +43,7 @@ ChatRoom::instance() } void -ChatRoom::enter(const ChatSessionPrx& session, const ChatCallbackPrx& callback, const Ice::Current& current) +ChatRoom::enter(ChatSessionPrx session, ChatCallbackPrx callback, const Ice::Current& current) { const lock_guard sync(_mutex); _callbacks.push_back(callback); @@ -73,11 +73,12 @@ ChatRoom::enter(const ChatSessionPrx& session, const ChatCallbackPrx& callback, } void -ChatRoom::leave(const ChatCallbackPrx& callback, const Ice::Current& current) +ChatRoom::leave(ChatCallbackPrx callback, const Ice::Current& current) { const lock_guard sync(_mutex); - _callbacks.remove_if([&callback](const ChatCallbackPrx& cb) { return Ice::proxyIdentityEqual(callback, cb); }); + _callbacks.remove_if([callback = std::move(callback)](const ChatCallbackPrx& cb) + { return Ice::proxyIdentityEqual(callback, cb); }); _connectionMap[current.con].remove_if([¤t](const ChatSessionPrx& s) { return current.id == s->ice_getIdentity(); }); } From bffd443ff734486b06687d2590ef14324fd17580 Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 14:28:53 -0400 Subject: [PATCH 07/18] Remove Ice::registerIceSSL --- cpp/Chat/client/Client.cpp | 5 ----- cpp/Chat/client/PollingClient.cpp | 5 ----- cpp/Chat/server/ChatServer.cpp | 4 ---- cpp/Glacier2/callback/Client.cpp | 4 ---- cpp/Glacier2/callback/Server.cpp | 4 ---- cpp/Glacier2/simpleChat/Client.cpp | 4 ---- cpp/Glacier2/simpleChat/Server.cpp | 4 ---- cpp/Ice/bidir/Client.cpp | 4 ---- cpp/Ice/bidir/Server.cpp | 4 ---- cpp/Ice/callback/Client.cpp | 4 ---- cpp/Ice/callback/Server.cpp | 4 ---- cpp/Ice/context/Client.cpp | 4 ---- cpp/Ice/context/Server.cpp | 4 ---- cpp/Ice/hello/Client.cpp | 1 - cpp/Ice/hello/Server.cpp | 1 - cpp/Ice/interleaved/Client.cpp | 4 ---- cpp/Ice/interleaved/Server.cpp | 4 ---- cpp/Ice/invoke/Client.cpp | 4 ---- cpp/Ice/invoke/Server.cpp | 4 ---- cpp/Ice/latency/Client.cpp | 1 - cpp/Ice/latency/Server.cpp | 1 - cpp/Ice/mtalk/Client.cpp | 4 ---- cpp/Ice/nested/Client.cpp | 4 ---- cpp/Ice/nested/Server.cpp | 4 ---- cpp/Ice/optional/Client.cpp | 4 ---- cpp/Ice/optional/Server.cpp | 4 ---- cpp/Ice/properties/Client.cpp | 4 ---- cpp/Ice/properties/Server.cpp | 4 ---- cpp/Ice/session/Client.cpp | 4 ---- cpp/Ice/session/Server.cpp | 4 ---- cpp/Ice/throughput/Client.cpp | 1 - cpp/Ice/throughput/Server.cpp | 1 - cpp/IceBT/talk/App.cpp | 1 - cpp/IceBox/hello/Client.cpp | 1 - cpp/IceDiscovery/hello/Client.cpp | 1 - cpp/IceDiscovery/hello/Server.cpp | 1 - cpp/IceDiscovery/replication/Client.cpp | 1 - cpp/IceDiscovery/replication/Server.cpp | 1 - cpp/IceGrid/secure/Server.cpp | 4 ---- 39 files changed, 122 deletions(-) diff --git a/cpp/Chat/client/Client.cpp b/cpp/Chat/client/Client.cpp index c4ec459a31..8f10714512 100644 --- a/cpp/Chat/client/Client.cpp +++ b/cpp/Chat/client/Client.cpp @@ -171,11 +171,6 @@ run(shared_ptr communicator) int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); - Ice::registerIceWS(); -#endif - int status = 0; try diff --git a/cpp/Chat/client/PollingClient.cpp b/cpp/Chat/client/PollingClient.cpp index cf57556151..9b3d37f689 100644 --- a/cpp/Chat/client/PollingClient.cpp +++ b/cpp/Chat/client/PollingClient.cpp @@ -125,11 +125,6 @@ int run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); - Ice::registerIceWS(); -#endif - int status = 0; try diff --git a/cpp/Chat/server/ChatServer.cpp b/cpp/Chat/server/ChatServer.cpp index 29a672ab34..9b2526beac 100644 --- a/cpp/Chat/server/ChatServer.cpp +++ b/cpp/Chat/server/ChatServer.cpp @@ -78,10 +78,6 @@ ChatServer::stop() int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); - Ice::registerIceWS(); -#endif ChatServer app; return app.main(argc, argv); } diff --git a/cpp/Glacier2/callback/Client.cpp b/cpp/Glacier2/callback/Client.cpp index 5147f1d18c..35cf22b511 100644 --- a/cpp/Glacier2/callback/Client.cpp +++ b/cpp/Glacier2/callback/Client.cpp @@ -21,10 +21,6 @@ void run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Glacier2/callback/Server.cpp b/cpp/Glacier2/callback/Server.cpp index 413c191c1b..de7996fbd9 100644 --- a/cpp/Glacier2/callback/Server.cpp +++ b/cpp/Glacier2/callback/Server.cpp @@ -12,10 +12,6 @@ using namespace Demo; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Glacier2/simpleChat/Client.cpp b/cpp/Glacier2/simpleChat/Client.cpp index a5e831aba5..f916fc0642 100644 --- a/cpp/Glacier2/simpleChat/Client.cpp +++ b/cpp/Glacier2/simpleChat/Client.cpp @@ -28,10 +28,6 @@ void run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Glacier2/simpleChat/Server.cpp b/cpp/Glacier2/simpleChat/Server.cpp index 74a735967d..788d90d8e4 100644 --- a/cpp/Glacier2/simpleChat/Server.cpp +++ b/cpp/Glacier2/simpleChat/Server.cpp @@ -23,10 +23,6 @@ class DummyPermissionsVerifierI : public Glacier2::PermissionsVerifier int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/bidir/Client.cpp b/cpp/Ice/bidir/Client.cpp index 49e3b63a4a..19e51e58b3 100644 --- a/cpp/Ice/bidir/Client.cpp +++ b/cpp/Ice/bidir/Client.cpp @@ -20,10 +20,6 @@ int run(const shared_ptr&, const string&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceWS(); -#endif - int status = 0; try diff --git a/cpp/Ice/bidir/Server.cpp b/cpp/Ice/bidir/Server.cpp index 67e2a54cf5..303bb92ffe 100644 --- a/cpp/Ice/bidir/Server.cpp +++ b/cpp/Ice/bidir/Server.cpp @@ -12,10 +12,6 @@ using namespace Demo; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceWS(); -#endif - int status = 0; try diff --git a/cpp/Ice/callback/Client.cpp b/cpp/Ice/callback/Client.cpp index 53d06b2970..e05d7aec99 100644 --- a/cpp/Ice/callback/Client.cpp +++ b/cpp/Ice/callback/Client.cpp @@ -20,10 +20,6 @@ int run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/callback/Server.cpp b/cpp/Ice/callback/Server.cpp index d47187f07a..968168e79c 100644 --- a/cpp/Ice/callback/Server.cpp +++ b/cpp/Ice/callback/Server.cpp @@ -12,10 +12,6 @@ using namespace Demo; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/context/Client.cpp b/cpp/Ice/context/Client.cpp index dda7503991..477d88e36b 100644 --- a/cpp/Ice/context/Client.cpp +++ b/cpp/Ice/context/Client.cpp @@ -14,10 +14,6 @@ int run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/context/Server.cpp b/cpp/Ice/context/Server.cpp index e4aea7d650..dc01a07d5d 100644 --- a/cpp/Ice/context/Server.cpp +++ b/cpp/Ice/context/Server.cpp @@ -11,10 +11,6 @@ using namespace std; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/hello/Client.cpp b/cpp/Ice/hello/Client.cpp index 72ae948fd3..18b48f592d 100644 --- a/cpp/Ice/hello/Client.cpp +++ b/cpp/Ice/hello/Client.cpp @@ -15,7 +15,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceUDP(); Ice::registerIceWS(); #endif diff --git a/cpp/Ice/hello/Server.cpp b/cpp/Ice/hello/Server.cpp index 8635ee5d63..be4a50c891 100644 --- a/cpp/Ice/hello/Server.cpp +++ b/cpp/Ice/hello/Server.cpp @@ -12,7 +12,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceUDP(); Ice::registerIceWS(); #endif diff --git a/cpp/Ice/interleaved/Client.cpp b/cpp/Ice/interleaved/Client.cpp index 83f88c0046..f3cf940f26 100644 --- a/cpp/Ice/interleaved/Client.cpp +++ b/cpp/Ice/interleaved/Client.cpp @@ -16,10 +16,6 @@ int run(const shared_ptr&, const string&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/interleaved/Server.cpp b/cpp/Ice/interleaved/Server.cpp index eb90945383..61b67aa8a5 100644 --- a/cpp/Ice/interleaved/Server.cpp +++ b/cpp/Ice/interleaved/Server.cpp @@ -11,10 +11,6 @@ using namespace std; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/invoke/Client.cpp b/cpp/Ice/invoke/Client.cpp index d877d3f056..92104f280c 100644 --- a/cpp/Ice/invoke/Client.cpp +++ b/cpp/Ice/invoke/Client.cpp @@ -32,10 +32,6 @@ int run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/invoke/Server.cpp b/cpp/Ice/invoke/Server.cpp index 22f42fc333..b84536e8db 100644 --- a/cpp/Ice/invoke/Server.cpp +++ b/cpp/Ice/invoke/Server.cpp @@ -13,10 +13,6 @@ using namespace std; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/latency/Client.cpp b/cpp/Ice/latency/Client.cpp index 9d3eb56f1b..54ce8d3da1 100644 --- a/cpp/Ice/latency/Client.cpp +++ b/cpp/Ice/latency/Client.cpp @@ -15,7 +15,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceWS(); #endif diff --git a/cpp/Ice/latency/Server.cpp b/cpp/Ice/latency/Server.cpp index 88468b8f0c..d5d0f3446b 100644 --- a/cpp/Ice/latency/Server.cpp +++ b/cpp/Ice/latency/Server.cpp @@ -15,7 +15,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceWS(); #endif diff --git a/cpp/Ice/mtalk/Client.cpp b/cpp/Ice/mtalk/Client.cpp index 0717475b11..f14b224a59 100644 --- a/cpp/Ice/mtalk/Client.cpp +++ b/cpp/Ice/mtalk/Client.cpp @@ -170,10 +170,6 @@ class DiscoverTask int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/nested/Client.cpp b/cpp/Ice/nested/Client.cpp index 9638311af3..b19c2d6a33 100644 --- a/cpp/Ice/nested/Client.cpp +++ b/cpp/Ice/nested/Client.cpp @@ -14,10 +14,6 @@ int run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/nested/Server.cpp b/cpp/Ice/nested/Server.cpp index d11bd1f482..32d6306faf 100644 --- a/cpp/Ice/nested/Server.cpp +++ b/cpp/Ice/nested/Server.cpp @@ -12,10 +12,6 @@ using namespace Demo; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/optional/Client.cpp b/cpp/Ice/optional/Client.cpp index f405b75ab8..fb84644bbd 100644 --- a/cpp/Ice/optional/Client.cpp +++ b/cpp/Ice/optional/Client.cpp @@ -14,10 +14,6 @@ int run(const shared_ptr&, const string&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/optional/Server.cpp b/cpp/Ice/optional/Server.cpp index 27fc45935e..d378b2eb66 100644 --- a/cpp/Ice/optional/Server.cpp +++ b/cpp/Ice/optional/Server.cpp @@ -11,10 +11,6 @@ using namespace std; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/properties/Client.cpp b/cpp/Ice/properties/Client.cpp index 9133ea9cef..b8648dc70a 100644 --- a/cpp/Ice/properties/Client.cpp +++ b/cpp/Ice/properties/Client.cpp @@ -14,10 +14,6 @@ int run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/properties/Server.cpp b/cpp/Ice/properties/Server.cpp index a191a127d5..deef5b4ee7 100644 --- a/cpp/Ice/properties/Server.cpp +++ b/cpp/Ice/properties/Server.cpp @@ -52,10 +52,6 @@ class PropsI : public Demo::Props int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/session/Client.cpp b/cpp/Ice/session/Client.cpp index 6d25d81474..3e314d4c67 100644 --- a/cpp/Ice/session/Client.cpp +++ b/cpp/Ice/session/Client.cpp @@ -14,10 +14,6 @@ int run(const shared_ptr&); int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/session/Server.cpp b/cpp/Ice/session/Server.cpp index 07e759ebdf..2f385cfbda 100644 --- a/cpp/Ice/session/Server.cpp +++ b/cpp/Ice/session/Server.cpp @@ -11,10 +11,6 @@ using namespace Demo; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try diff --git a/cpp/Ice/throughput/Client.cpp b/cpp/Ice/throughput/Client.cpp index abb006a8d0..e557f444b0 100644 --- a/cpp/Ice/throughput/Client.cpp +++ b/cpp/Ice/throughput/Client.cpp @@ -16,7 +16,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceWS(); #endif diff --git a/cpp/Ice/throughput/Server.cpp b/cpp/Ice/throughput/Server.cpp index a35d2e6b90..5846b844ab 100644 --- a/cpp/Ice/throughput/Server.cpp +++ b/cpp/Ice/throughput/Server.cpp @@ -12,7 +12,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceWS(); #endif diff --git a/cpp/IceBT/talk/App.cpp b/cpp/IceBT/talk/App.cpp index 38e9303022..60516e6c29 100644 --- a/cpp/IceBT/talk/App.cpp +++ b/cpp/IceBT/talk/App.cpp @@ -83,7 +83,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceBT(); #endif diff --git a/cpp/IceBox/hello/Client.cpp b/cpp/IceBox/hello/Client.cpp index 4ca5b629b9..389bcd5c33 100644 --- a/cpp/IceBox/hello/Client.cpp +++ b/cpp/IceBox/hello/Client.cpp @@ -15,7 +15,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceUDP(); Ice::registerIceWS(); #endif diff --git a/cpp/IceDiscovery/hello/Client.cpp b/cpp/IceDiscovery/hello/Client.cpp index abe5d49585..72fe8be203 100644 --- a/cpp/IceDiscovery/hello/Client.cpp +++ b/cpp/IceDiscovery/hello/Client.cpp @@ -15,7 +15,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceDiscovery(false); #endif diff --git a/cpp/IceDiscovery/hello/Server.cpp b/cpp/IceDiscovery/hello/Server.cpp index 8945f4aa95..ed9dfdac5c 100644 --- a/cpp/IceDiscovery/hello/Server.cpp +++ b/cpp/IceDiscovery/hello/Server.cpp @@ -12,7 +12,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceDiscovery(false); #endif diff --git a/cpp/IceDiscovery/replication/Client.cpp b/cpp/IceDiscovery/replication/Client.cpp index 73ce5a3dc2..16d87441e8 100644 --- a/cpp/IceDiscovery/replication/Client.cpp +++ b/cpp/IceDiscovery/replication/Client.cpp @@ -16,7 +16,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceDiscovery(false); #endif diff --git a/cpp/IceDiscovery/replication/Server.cpp b/cpp/IceDiscovery/replication/Server.cpp index 8258a8a368..5c32000687 100644 --- a/cpp/IceDiscovery/replication/Server.cpp +++ b/cpp/IceDiscovery/replication/Server.cpp @@ -12,7 +12,6 @@ int main(int argc, char* argv[]) { #ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); Ice::registerIceDiscovery(false); #endif diff --git a/cpp/IceGrid/secure/Server.cpp b/cpp/IceGrid/secure/Server.cpp index 2dc0bf03ad..f15d4c08e7 100644 --- a/cpp/IceGrid/secure/Server.cpp +++ b/cpp/IceGrid/secure/Server.cpp @@ -11,10 +11,6 @@ using namespace std; int main(int argc, char* argv[]) { -#ifdef ICE_STATIC_LIBS - Ice::registerIceSSL(); -#endif - int status = 0; try From be0c1c51ff917661b22599d466d9d03469959a19 Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 14:36:31 -0400 Subject: [PATCH 08/18] Fix demo ci build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a842cb5974..a82d3f5625 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,5 +51,5 @@ jobs: uses: ./ice/.github/actions/build timeout-minutes: 30 with: - working_directory: ice/cpp + working_directory: ice-demos/cpp msbuild_project: C++ demos.sln From ea65f9d81c53eecbbc6be8ef840b6b602389d2f2 Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 15:36:45 -0400 Subject: [PATCH 09/18] Build fixes --- cpp/Chat/client/Client.cpp | 6 +++--- cpp/Chat/server/ChatRoom.cpp | 2 +- cpp/Chat/server/ChatRoom.h | 2 +- cpp/Chat/server/ChatSessionI.cpp | 2 +- cpp/Chat/server/ChatSessionI.h | 2 +- cpp/Chat/server/PollingChatSessionI.h | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cpp/Chat/client/Client.cpp b/cpp/Chat/client/Client.cpp index 8f10714512..02ac30f99c 100644 --- a/cpp/Chat/client/Client.cpp +++ b/cpp/Chat/client/Client.cpp @@ -43,19 +43,19 @@ class ChatRoomCallbackI final : public Chat::ChatRoomCallback cout << endl; } - void join(long long, string name, const Ice::Current&) final + void join(int64_t, string name, const Ice::Current&) final { const lock_guard lock(coutMutex); cout << ">>>> " << name << " joined." << endl; } - void leave(long long, string name, const Ice::Current&) final + void leave(int64_t, string name, const Ice::Current&) final { const lock_guard lock(coutMutex); cout << "<<<< " << name << " left." << endl; } - void send(long long, string name, string message, const Ice::Current&) final + void send(int64_t, string name, string message, const Ice::Current&) final { const lock_guard lock(coutMutex); cout << name << " > " << ChatUtils::unstripHtml(message) << endl; diff --git a/cpp/Chat/server/ChatRoom.cpp b/cpp/Chat/server/ChatRoom.cpp index 6be0d1785b..2980471ff8 100644 --- a/cpp/Chat/server/ChatRoom.cpp +++ b/cpp/Chat/server/ChatRoom.cpp @@ -30,7 +30,7 @@ void ChatRoom::join(const string& name, const shared_ptr& callback) { const lock_guard sync(_mutex); - const long long timestamp = + const auto timestamp = chrono::duration_cast(chrono::system_clock::now().time_since_epoch()).count(); _reserved.erase(name); diff --git a/cpp/Chat/server/ChatRoom.h b/cpp/Chat/server/ChatRoom.h index dc7c5def18..444dfb8df4 100644 --- a/cpp/Chat/server/ChatRoom.h +++ b/cpp/Chat/server/ChatRoom.h @@ -28,7 +28,7 @@ class ChatRoom void unreserve(const std::string&); void join(const std::string&, const std::shared_ptr&); void leave(const std::string&); - long long send(const std::string&, const std::string&); + int64_t send(const std::string&, const std::string&); private: using ChatRoomCallbackMap = std::map>; diff --git a/cpp/Chat/server/ChatSessionI.cpp b/cpp/Chat/server/ChatSessionI.cpp index 6ad761370c..34026f9093 100644 --- a/cpp/Chat/server/ChatSessionI.cpp +++ b/cpp/Chat/server/ChatSessionI.cpp @@ -142,7 +142,7 @@ ChatSessionI::setCallback(optional callback, const Ic _chatRoom->join(_name, _callback); } -long long +int64_t ChatSessionI::send(string message, const Ice::Current&) { const lock_guard sync(_mutex); diff --git a/cpp/Chat/server/ChatSessionI.h b/cpp/Chat/server/ChatSessionI.h index dbf050372e..d21b204632 100644 --- a/cpp/Chat/server/ChatSessionI.h +++ b/cpp/Chat/server/ChatSessionI.h @@ -14,7 +14,7 @@ class ChatSessionI final : public Chat::ChatSession ChatSessionI(const std::shared_ptr&, std::string, bool trace, const std::shared_ptr& logger); void setCallback(std::optional, const Ice::Current&) final; - long long send(std::string, const Ice::Current&) final; + std::int64_t send(std::string, const Ice::Current&) final; void destroy(const Ice::Current&) final; private: diff --git a/cpp/Chat/server/PollingChatSessionI.h b/cpp/Chat/server/PollingChatSessionI.h index 03df1cc8be..d85bbf3ee6 100644 --- a/cpp/Chat/server/PollingChatSessionI.h +++ b/cpp/Chat/server/PollingChatSessionI.h @@ -11,7 +11,7 @@ class PollCallbackAdapter; -class PollingChatSessionI : public PollingChat::PollingChatSession +class PollingChatSessionI final : public PollingChat::PollingChatSession { public: PollingChatSessionI( @@ -20,10 +20,10 @@ class PollingChatSessionI : public PollingChat::PollingChatSession bool trace, const std::shared_ptr& logger); - virtual void destroy(const Ice::Current&) override; - virtual Ice::StringSeq getInitialUsers(const Ice::Current&) override; - virtual PollingChat::ChatRoomEventSeq getUpdates(const Ice::Current&) override; - virtual long long send(std::string, const Ice::Current&) override; + void destroy(const Ice::Current&) final; + Ice::StringSeq getInitialUsers(const Ice::Current&) final; + PollingChat::ChatRoomEventSeq getUpdates(const Ice::Current&) final; + int64_t send(std::string, const Ice::Current&) final; private: const std::shared_ptr _chatRoom; From 6ed7addaf2149328921b978de97eac8a29fedb90 Mon Sep 17 00:00:00 2001 From: Joe George Date: Tue, 28 May 2024 17:02:59 -0400 Subject: [PATCH 10/18] Windows fixes --- .github/workflows/ci.yml | 1 + cpp/msbuild/ice.proj | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a82d3f5625..0d394457fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ concurrency: env: ICE_HOME: ${{ github.workspace }}/ice + PLATFORM: x64 jobs: ci: diff --git a/cpp/msbuild/ice.proj b/cpp/msbuild/ice.proj index 066661b6de..9316156819 100644 --- a/cpp/msbuild/ice.proj +++ b/cpp/msbuild/ice.proj @@ -22,7 +22,7 @@ - + From 9208c1b887d6c57ba9f568d0de9996c8fac4ecab Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 10:22:45 -0400 Subject: [PATCH 11/18] Build fixes --- .github/workflows/ci.yml | 2 +- cpp/IceBT/talk/App.cpp | 51 ++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d394457fd..4702e6b91c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,4 +53,4 @@ jobs: timeout-minutes: 30 with: working_directory: ice-demos/cpp - msbuild_project: C++ demos.sln + msbuild_project: "C++ demos.sln" diff --git a/cpp/IceBT/talk/App.cpp b/cpp/IceBT/talk/App.cpp index 60516e6c29..a1e4437e59 100644 --- a/cpp/IceBT/talk/App.cpp +++ b/cpp/IceBT/talk/App.cpp @@ -2,9 +2,10 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#include "Talk.h" #include #include -#include +#include #include using namespace std; @@ -14,7 +15,7 @@ class TalkApp public: int run(const shared_ptr& communicator); - void connect(const shared_ptr&); + void connect(const optional&); void message(const string&); void disconnect(const Ice::Identity&, const shared_ptr&, bool); void closed(); @@ -29,27 +30,27 @@ class TalkApp shared_ptr _communicator; shared_ptr _adapter; - shared_ptr _local; - shared_ptr _remote; + optional _local; + optional _remote; mutex _mutex; }; // // This servant listens for incoming connections from peers. // -class IncomingPeerI : public Talk::Peer +class IncomingPeerI final : public Talk::Peer { public: IncomingPeerI(TalkApp* app) : _app(app) {} - virtual void connect(shared_ptr peer, const Ice::Current& current) override + void connect(optional peer, const Ice::Current& current) final { _app->connect(peer->ice_fixed(current.con)); } - virtual void send(string text, const Ice::Current&) override { _app->message(text); } + void send(string text, const Ice::Current&) final { _app->message(text); } - virtual void disconnect(const Ice::Current& current) override { _app->disconnect(current.id, current.con, true); } + void disconnect(const Ice::Current& current) final { _app->disconnect(current.id, current.con, true); } private: TalkApp* _app; @@ -58,19 +59,19 @@ class IncomingPeerI : public Talk::Peer // // This servant handles an outgoing session with a peer. // -class OutgoingPeerI : public Talk::Peer +class OutgoingPeerI final : public Talk::Peer { public: OutgoingPeerI(TalkApp* app) : _app(app) {} - virtual void connect(shared_ptr, const Ice::Current&) override + void connect(optional, const Ice::Current&) final { throw Talk::ConnectionException("already connected"); } - virtual void send(string text, const Ice::Current&) override { _app->message(text); } + void send(string text, const Ice::Current&) final { _app->message(text); } - virtual void disconnect(const Ice::Current& current) override { _app->disconnect(current.id, current.con, false); } + void disconnect(const Ice::Current& current) final { _app->disconnect(current.id, current.con, false); } private: TalkApp* _app; @@ -190,7 +191,7 @@ TalkApp::run(const shared_ptr& communicator) } void -TalkApp::connect(const shared_ptr& peer) +TalkApp::connect(const optional& peer) { // // Called for a new incoming connection request. @@ -208,7 +209,6 @@ TalkApp::connect(const shared_ptr& peer) // auto con = peer->ice_getConnection(); con->setCloseCallback([this](const shared_ptr&) { this->closed(); }); - con->setACM(30, Ice::ACMClose::CloseOff, Ice::ACMHeartbeat::HeartbeatAlways); _remote = peer->ice_invocationTimeout(10000); @@ -241,7 +241,7 @@ TalkApp::disconnect(const Ice::Identity& id, const shared_ptr& if (_remote) { cout << ">>>> Peer disconnected" << endl; - _remote = nullptr; + _remote = nullopt; } if (!incoming) @@ -257,7 +257,7 @@ TalkApp::closed() { lock_guard lock(_mutex); - _remote = nullptr; + _remote = nullopt; cout << ">>>> Connection to peer closed" << endl; } @@ -281,8 +281,8 @@ TalkApp::doConnect(const string& cmd) } string addr = cmd.substr(sp); - shared_ptr remote; - shared_ptr local; + optional remote; + optional local; try { { @@ -326,7 +326,6 @@ TalkApp::doConnect(const string& cmd) // Install a connection callback and enable ACM heartbeats. // con->setCloseCallback([this](const shared_ptr&) { this->closed(); }); - con->setACM(30, Ice::ACMClose::CloseOff, Ice::ACMHeartbeat::HeartbeatAlways); // // Now we're ready to notify the peer that we'd like to connect. @@ -346,7 +345,7 @@ TalkApp::doConnect(const string& cmd) if (_remote == remote) { - _remote = nullptr; + _remote = nullopt; } } catch (const Ice::Exception& ex) @@ -361,7 +360,7 @@ TalkApp::doConnect(const string& cmd) if (_remote == remote) { - _remote = nullptr; + _remote = nullopt; } } } @@ -406,7 +405,7 @@ TalkApp::doList() void TalkApp::doDisconnect() { - shared_ptr peer; + optional peer; { lock_guard lock(_mutex); @@ -418,7 +417,7 @@ TalkApp::doDisconnect() } peer = _remote; - _remote = nullptr; + _remote = nullopt; } auto con = peer->ice_getCachedConnection(); @@ -441,7 +440,7 @@ TalkApp::doDisconnect() void TalkApp::doMessage(const string& text) { - shared_ptr peer; + optional peer; { lock_guard lock(_mutex); @@ -468,12 +467,12 @@ TalkApp::doMessage(const string& text) void TalkApp::failed(const Ice::LocalException& ex) { - shared_ptr peer; + optional peer; { lock_guard lock(_mutex); peer = _remote; - _remote = nullptr; + _remote = nullopt; } cout << ">>>> Action failed:" << endl << ex << endl; From 30f5c7e1acaf2d5f49b119298619b494b4f349fd Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 11:03:00 -0400 Subject: [PATCH 12/18] Escape windows demo sln name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4702e6b91c..87420428c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,4 +53,4 @@ jobs: timeout-minutes: 30 with: working_directory: ice-demos/cpp - msbuild_project: "C++ demos.sln" + msbuild_project: \"C++ demos.sln\" From 4f917534340a11646f22f8f7be393c918fca0242 Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 11:35:55 -0400 Subject: [PATCH 13/18] Delete qt demo --- cpp/C++ Qt demos.sln | 25 -- cpp/Ice/qt/.gitignore | 5 - cpp/Ice/qt/Client.cpp | 370 ------------------- cpp/Ice/qt/Client.h | 41 -- cpp/Ice/qt/GeneratedFiles/Debug/.gitignore | 0 cpp/Ice/qt/GeneratedFiles/Release/.gitignore | 0 cpp/Ice/qt/Hello.ice | 14 - cpp/Ice/qt/README.md | 55 --- cpp/Ice/qt/config.client | 28 -- cpp/Ice/qt/msbuild/client.vcxproj | 154 -------- cpp/Ice/qt/msbuild/client.vcxproj.filters | 98 ----- cpp/Ice/qt/msbuild/client.vcxproj.user | 16 - cpp/Ice/qt/msbuild/packages.config | 6 - cpp/Ice/qt/qt.pro | 94 ----- cpp/README.md | 9 +- 15 files changed, 4 insertions(+), 911 deletions(-) delete mode 100644 cpp/C++ Qt demos.sln delete mode 100644 cpp/Ice/qt/.gitignore delete mode 100644 cpp/Ice/qt/Client.cpp delete mode 100644 cpp/Ice/qt/Client.h delete mode 100644 cpp/Ice/qt/GeneratedFiles/Debug/.gitignore delete mode 100644 cpp/Ice/qt/GeneratedFiles/Release/.gitignore delete mode 100644 cpp/Ice/qt/Hello.ice delete mode 100644 cpp/Ice/qt/README.md delete mode 100644 cpp/Ice/qt/config.client delete mode 100644 cpp/Ice/qt/msbuild/client.vcxproj delete mode 100644 cpp/Ice/qt/msbuild/client.vcxproj.filters delete mode 100644 cpp/Ice/qt/msbuild/client.vcxproj.user delete mode 100644 cpp/Ice/qt/msbuild/packages.config delete mode 100644 cpp/Ice/qt/qt.pro diff --git a/cpp/C++ Qt demos.sln b/cpp/C++ Qt demos.sln deleted file mode 100644 index 92d7d5553a..0000000000 --- a/cpp/C++ Qt demos.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "Ice\qt\msbuild\client.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.ActiveCfg = Debug|x64 - {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.Build.0 = Debug|x64 - {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|x64 - {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - Qt5Version = QT 5 - EndGlobalSection -EndGlobal diff --git a/cpp/Ice/qt/.gitignore b/cpp/Ice/qt/.gitignore deleted file mode 100644 index 43d3d6e2e4..0000000000 --- a/cpp/Ice/qt/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.qmake.stash -Hello.cpp -Hello.h -Makefile -moc_* diff --git a/cpp/Ice/qt/Client.cpp b/cpp/Ice/qt/Client.cpp deleted file mode 100644 index 6582f58e00..0000000000 --- a/cpp/Ice/qt/Client.cpp +++ /dev/null @@ -1,370 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#include - -namespace -{ - - const int CUSTOM_EVENT_TYPE = QEvent::User + 1000; - - enum DeliveryMode - { - Twoway, - TwowaySecure, - Oneway, - OnewayBatch, - OnewaySecure, - OnewaySecureBatch, - Datagram, - DatagramBatch - }; - - class DispatchEvent : public QEvent - { - public: - DispatchEvent(std::function call) : QEvent(QEvent::Type(CUSTOM_EVENT_TYPE)), _call(call) {} - - void dispatch() { _call(); } - - private: - std::function _call; - }; - -} - -MainWindow::MainWindow() - : _hostname(new QLineEdit("127.0.0.1")), - _mode(new QComboBox()), - _timeout(new QSlider(Qt::Horizontal)), - _delay(new QSlider(Qt::Horizontal)), - _hello(new QPushButton("Hello World!")), - _shutdown(new QPushButton("Shutdown")), - _flush(new QPushButton("Flush")) -{ - auto layout = new QVBoxLayout(); - auto formLayout = new QFormLayout; - - formLayout->addRow("Hostname:", _hostname); - - _mode->addItem("Twoway"); - _mode->addItem("Twoway Secure"); - _mode->addItem("Oneway"); - _mode->addItem("Oneway Batch"); - _mode->addItem("Oneway Secure"); - _mode->addItem("Oneway Secure Batch"); - _mode->addItem("Datagram"); - _mode->addItem("Datagram Batch"); - - formLayout->addRow("Mode:", _mode); - - _timeout->setRange(0, 5000); - formLayout->addRow("Timeout:", _timeout); - - _delay->setRange(0, 5000); - formLayout->addRow("Delay:", _delay); - - layout->addLayout(formLayout); - - _flush->setEnabled(false); - { - auto h = new QHBoxLayout(); - h->addWidget(_hello); - h->addWidget(_shutdown); - h->addWidget(_flush); - layout->addLayout(h); - } - - connect(_hello, &QPushButton::clicked, this, &MainWindow::sayHello); - connect(_shutdown, &QPushButton::clicked, this, &MainWindow::shutdown); - connect(_flush, &QPushButton::clicked, this, &MainWindow::flush); - - connect(_hostname, &QLineEdit::textChanged, this, &MainWindow::updateProxy); - connect(_timeout, &QSlider::valueChanged, this, &MainWindow::updateProxy); - connect( - _mode, - static_cast(&QComboBox::currentIndexChanged), - this, - &MainWindow::updateProxy); - - auto centralWidget = new QWidget(this); - centralWidget->setLayout(layout); - setCentralWidget(centralWidget); - - Ice::InitializationData initData; - initData.properties = Ice::createProperties(); - initData.properties->load("config.client"); - initData.dispatcher = [this](std::function dispatchCall, const std::shared_ptr&) - { QApplication::postEvent(this, new DispatchEvent(dispatchCall)); }; - _communicator = Ice::initialize(initData); - updateProxy(); -} - -bool -MainWindow::event(QEvent* event) -{ - if (event->type() == CUSTOM_EVENT_TYPE) - { - auto dispatchEvent = static_cast(event); - try - { - dispatchEvent->dispatch(); - } - catch (const Ice::Exception& ex) - { - statusBar()->showMessage(ex.ice_id().c_str()); - } - catch (const std::exception& ex) - { - QMessageBox error(QMessageBox::Critical, "Error", ex.what()); - error.exec(); - QApplication::exit(EXIT_FAILURE); - } - return true; - } - return QMainWindow::event(event); -} - -void -MainWindow::updateProxy() -{ - auto host = _hostname->text().trimmed(); - if (host.isEmpty()) - { - statusBar()->showMessage("No hostname"); - return; - } - - auto s = QString("hello:tcp -h %1 -p 10000:ssl -h %1 -p 10001:udp -h %1 -p 10000").arg(host); - auto prx = _communicator->stringToProxy(s.toStdString()); - switch (_mode->currentIndex()) - { - case Twoway: - { - prx = prx->ice_twoway(); - break; - } - case TwowaySecure: - { - prx = prx->ice_twoway()->ice_secure(true); - break; - } - case Oneway: - { - prx = prx->ice_oneway(); - break; - } - case OnewayBatch: - { - prx = prx->ice_batchOneway(); - break; - } - case OnewaySecure: - { - prx = prx->ice_oneway()->ice_secure(true); - break; - } - case OnewaySecureBatch: - { - prx = prx->ice_batchOneway()->ice_secure(true); - break; - } - case Datagram: - { - prx = prx->ice_datagram(); - break; - } - case DatagramBatch: - { - prx = prx->ice_batchDatagram(); - break; - } - } - int timeout = _timeout->value(); - if (timeout != 0) - { - prx = prx->ice_invocationTimeout(timeout); - } - _helloPrx = Ice::uncheckedCast(prx); - - // - // The batch requests associated to the proxy are lost when we - // update the proxy. - // - _flush->setEnabled(false); - - statusBar()->showMessage("Ready"); -} - -void -MainWindow::sayHello() -{ - if (_helloPrx) - { - int delay = _delay->value(); - try - { - DeliveryMode mode = static_cast(_mode->currentIndex()); - if (mode == OnewayBatch || mode == OnewaySecureBatch || mode == DatagramBatch) - { - _flush->setEnabled(true); - _helloPrx->sayHello(delay); - statusBar()->showMessage("Queued sayHello request"); - } - else - { - statusBar()->showMessage("Sending request"); - _helloPrx->sayHelloAsync( - delay, - [this]() { statusBar()->showMessage("Ready"); }, - [this](std::exception_ptr errptr) - { - try - { - std::rethrow_exception(errptr); - } - catch (const Ice::Exception& ex) - { - statusBar()->showMessage(ex.ice_id().c_str()); - } - catch (const std::exception& ex) - { - QMessageBox error(QMessageBox::Critical, "Error", ex.what()); - error.exec(); - QApplication::exit(EXIT_FAILURE); - } - }, - [this, mode](bool) - { - if (mode == Oneway || mode == OnewaySecure || mode == Datagram) - { - statusBar()->showMessage("Ready"); - } - else - { - statusBar()->showMessage("Waiting for response"); - } - }); - } - } - catch (const Ice::Exception& ex) - { - statusBar()->showMessage(ex.ice_id().c_str()); - } - catch (const std::exception& ex) - { - QMessageBox error(QMessageBox::Critical, "Error", ex.what()); - error.exec(); - QApplication::exit(EXIT_FAILURE); - } - } -} - -void -MainWindow::shutdown() -{ - if (_helloPrx) - { - try - { - DeliveryMode mode = static_cast(_mode->currentIndex()); - if (mode == OnewayBatch || mode == OnewaySecureBatch || mode == DatagramBatch) - { - _flush->setEnabled(true); - _helloPrx->shutdown(); - statusBar()->showMessage("Queued sayHello request"); - } - else - { - statusBar()->showMessage("Sending request"); - _helloPrx->shutdownAsync( - [this]() { statusBar()->showMessage("Ready"); }, - [this](std::exception_ptr errptr) - { - try - { - std::rethrow_exception(errptr); - } - catch (const Ice::Exception& ex) - { - statusBar()->showMessage(ex.ice_id().c_str()); - } - catch (const std::exception& ex) - { - QMessageBox error(QMessageBox::Critical, "Error", ex.what()); - error.exec(); - QApplication::exit(EXIT_FAILURE); - } - }, - [this, mode](bool) - { - if (mode == Oneway || mode == OnewaySecure || mode == Datagram) - { - statusBar()->showMessage("Ready"); - } - else - { - statusBar()->showMessage("Waiting for response"); - } - }); - } - } - catch (const Ice::Exception& ex) - { - statusBar()->showMessage(ex.ice_id().c_str()); - } - catch (const std::exception& ex) - { - QMessageBox error(QMessageBox::Critical, "Error", ex.what()); - error.exec(); - QApplication::exit(EXIT_FAILURE); - } - } -} - -void -MainWindow::flush() -{ - if (_helloPrx) - { - _helloPrx->ice_flushBatchRequestsAsync( - [this](std::exception_ptr errptr) - { - try - { - std::rethrow_exception(errptr); - } - catch (const Ice::Exception& ex) - { - statusBar()->showMessage(ex.ice_id().c_str()); - } - catch (const std::exception& ex) - { - QMessageBox error(QMessageBox::Critical, "Error", ex.what()); - error.exec(); - QApplication::exit(EXIT_FAILURE); - } - }); - _flush->setEnabled(false); - statusBar()->showMessage("Flushed batch requests"); - } -} - -int -main(int argc, char* argv[]) -{ - QApplication a(argc, argv); - try - { - MainWindow w; - w.show(); - return a.exec(); - } - catch (const std::exception& ex) - { - QMessageBox error(QMessageBox::Critical, "Initialization exception", ex.what()); - error.exec(); - return EXIT_FAILURE; - } -} diff --git a/cpp/Ice/qt/Client.h b/cpp/Ice/qt/Client.h deleted file mode 100644 index 4beb5a234f..0000000000 --- a/cpp/Ice/qt/Client.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#ifndef MAIN_WINDOW_H -#define MAIN_WINDOW_H - -#include -#include -#include -#include -#include - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - MainWindow(); - virtual bool event(QEvent*); - -public slots: - - void sayHello(); - void shutdown(); - void flush(); - void updateProxy(); - -private: - QLineEdit* _hostname; - QComboBox* _mode; - QSlider* _timeout; - QSlider* _delay; - QPushButton* _hello; - QPushButton* _shutdown; - QPushButton* _flush; - Ice::CommunicatorHolder _communicator; - std::shared_ptr _helloPrx; -}; - -#endif diff --git a/cpp/Ice/qt/GeneratedFiles/Debug/.gitignore b/cpp/Ice/qt/GeneratedFiles/Debug/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cpp/Ice/qt/GeneratedFiles/Release/.gitignore b/cpp/Ice/qt/GeneratedFiles/Release/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cpp/Ice/qt/Hello.ice b/cpp/Ice/qt/Hello.ice deleted file mode 100644 index 6ffc809a47..0000000000 --- a/cpp/Ice/qt/Hello.ice +++ /dev/null @@ -1,14 +0,0 @@ -// -// Copyright (c) ZeroC, Inc. All rights reserved. -// - -#pragma once - -module Demo -{ - interface Hello - { - idempotent void sayHello(int delay); - void shutdown(); - } -} diff --git a/cpp/Ice/qt/README.md b/cpp/Ice/qt/README.md deleted file mode 100644 index 7b4594c7f8..0000000000 --- a/cpp/Ice/qt/README.md +++ /dev/null @@ -1,55 +0,0 @@ -This demo illustrates how to write a QT GUI application which invokes -ordinary (twoway) operations, as well as how to make [oneway][1], -[datagram][2], [secure][3], and [batched][4] invocations. - -## Building the demo on Linux and macOS - -### Prerequisites - -The demo requires [QT 5 SDK][7]. - -### Building the demo - -``` -qmake -make -``` - -## Building the demo on Windows - -### Prerequisites - -The project requires the [Qt 5 SDK][7], [Qt Visual Studio Tools][5] and [Ice Builder for Visual -Studio][6] extensions. - -**When installing Qt 5 SDK ensure you select the MSVC 2015 64-bit component** - -### Building the demo - -Open `C++11 Qt demos.sln` Visual Studio solution and uset `Qt VS Tools` menu to setup -your Qt 5 Visual Studio 2015 Version, then use the `Change Solution's Qt Version` -option in the solution context menu to set the Qt version that will be used, once the Qt version -has been set you can build the solution. - -## Running the demo - -To run the demo, first start the hello server: - -``` -cd ../hello -server -``` - -In a separate window, start the qt client: - -``` -client -``` - -[1]: https://doc.zeroc.com/ice/3.7/client-side-features/oneway-invocations -[2]: https://doc.zeroc.com/ice/3.7/client-side-features/datagram-invocations -[4]: https://doc.zeroc.com/ice/3.7/client-side-features/batched-invocations -[3]: https://doc.zeroc.com/ice/3.7/ice-plugins/icessl -[5]: https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2015 -[6]: https://github.com/zeroc-ice/ice-builder-visualstudio -[7]: https://www.qt.io/ diff --git a/cpp/Ice/qt/config.client b/cpp/Ice/qt/config.client deleted file mode 100644 index 3a82c1f35e..0000000000 --- a/cpp/Ice/qt/config.client +++ /dev/null @@ -1,28 +0,0 @@ -# -# Network Tracing -# -# 0 = no network tracing -# 1 = trace connection establishment and closure -# 2 = like 1, but more detailed -# 3 = like 2, but also trace data transfer -# -#Ice.Trace.Network=1 - -# -# Security Tracing -# -# 0 = no security tracing -# 1 = trace messages -# -#IceSSL.Trace.Security=1 - -# -# SSL Configuration -# -Ice.Plugin.IceSSL=IceSSL:createIceSSL -IceSSL.DefaultDir=../../../certs -IceSSL.CAs=cacert.pem -IceSSL.CertFile=client.p12 -IceSSL.Password=password -IceSSL.Keychain=../../../certs/client.keychain -IceSSL.KeychainPassword=password diff --git a/cpp/Ice/qt/msbuild/client.vcxproj b/cpp/Ice/qt/msbuild/client.vcxproj deleted file mode 100644 index 376ece2b9c..0000000000 --- a/cpp/Ice/qt/msbuild/client.vcxproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - Debug - x64 - - - Release - x64 - - - - {B12702AD-ABFB-343A-A199-8E24837244A3} - Qt4VSv1.0 - - - - Application - v140 - yes - - - Application - v140 - no - - - - - - - - - ..\ - - - ..\ - - - cpp98 - - - - ICE_CPP11_MAPPING;UNICODE;_UNICODE;WIN32;WIN64;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) - $(Platform)\$(Configuration);..;$(QTDIR)\include;..\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) - Disabled - ProgramDatabase - MultiThreadedDebugDLL - true - - - Windows - $(OutDir)\$(ProjectName).exe - $(QTDIR)\lib;%(AdditionalLibraryDirectories) - true - qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;%(AdditionalDependencies) - - - - - ICE_CPP11_MAPPING;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) - $(Platform)\$(Configuration);..;$(QTDIR)\include;..\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) - - MultiThreadedDLL - true - - - Windows - $(OutDir)\$(ProjectName).exe - $(QTDIR)\lib;%(AdditionalLibraryDirectories) - false - qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;%(AdditionalDependencies) - - - - - $(Platform)\$(Configuration) - - - - - true - - - - true - - - true - ..\Hello.ice - - - true - ..\Hello.ice - - - - - $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) - Moc%27ing Client.h... - ..\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "..\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DICE_CPP11_MAPPING -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -D%(PreprocessorDefinitions) "-I$(Platform)\$(Configuration)" "-I.\.." "-I$(QTDIR)\include" "-I.\..\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" - $(QTDIR)\bin\moc.exe;%(FullPath);$(QTDIR)\bin\moc.exe;%(FullPath) - Moc%27ing Client.h... - ..\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o "..\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DICE_CPP11_MAPPING -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -D%(PreprocessorDefinitions) "-I$(Platform)\$(Configuration)" "-I.\.." "-I$(QTDIR)\include" "-I.\..\GeneratedFiles\$(ConfigurationName)" "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" - - - - - Code - - - - - true - ..\Hello.ice - - - true - ..\Hello.ice - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - diff --git a/cpp/Ice/qt/msbuild/client.vcxproj.filters b/cpp/Ice/qt/msbuild/client.vcxproj.filters deleted file mode 100644 index 9a44a6023c..0000000000 --- a/cpp/Ice/qt/msbuild/client.vcxproj.filters +++ /dev/null @@ -1,98 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {99349809-55BA-4b9d-BF79-8FDBB0286EB3} - ui - - - {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} - qrc;* - false - - - {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} - moc;h;cpp - False - - - {3f95ed08-b710-4248-b782-8fd0a35612ff} - cpp;moc - False - - - {4fe6df82-3d17-48a8-a26b-924cbdd0c7ff} - cpp;moc - False - - - {4618e1cd-80d7-44f3-83c5-654c1557f993} - ice - - - {0952e0d6-ee14-40bc-bf88-1e083f25640e} - - - {536e414f-963c-47f1-bf0f-3ef44528cf89} - - - {f2460515-34b2-4bed-ace0-565896964e37} - - - {a2355fc1-c5b3-47be-bfbc-537ddaf7f1b1} - - - {d6af53ff-12c9-48af-9408-3aca39cf5946} - - - {a6c9f506-2d6d-4fbf-97e5-732e6231e332} - - - - - Source Files\x64\Debug - - - Source Files\x64\Release - - - Generated Files\Release - - - Generated Files\Debug - - - Source Files - - - - - Header Files - - - - - Header Files\x64\Debug - - - Header Files\x64\Release - - - - - - - - - Slice Files - - - \ No newline at end of file diff --git a/cpp/Ice/qt/msbuild/client.vcxproj.user b/cpp/Ice/qt/msbuild/client.vcxproj.user deleted file mode 100644 index 2f8ef33ee0..0000000000 --- a/cpp/Ice/qt/msbuild/client.vcxproj.user +++ /dev/null @@ -1,16 +0,0 @@ - - - - - D:\Qt\5.12.3\msvc2015_64 - WindowsLocalDebugger - $(ProjectDir).. - PATH=$(QTDIR)\bin%3b$(IceHome)\build\native\bin\$(Platform)\$(Configuration) - - - D:\Qt\5.12.3\msvc2015_64 - $(ProjectDir).. - WindowsLocalDebugger - PATH=$(QTDIR)\bin%3b$(IceHome)\build\native\bin\$(Platform)\$(Configuration) - - diff --git a/cpp/Ice/qt/msbuild/packages.config b/cpp/Ice/qt/msbuild/packages.config deleted file mode 100644 index 0d0c7120f8..0000000000 --- a/cpp/Ice/qt/msbuild/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cpp/Ice/qt/qt.pro b/cpp/Ice/qt/qt.pro deleted file mode 100644 index db178e7e84..0000000000 --- a/cpp/Ice/qt/qt.pro +++ /dev/null @@ -1,94 +0,0 @@ -# -# Copyright (c) ZeroC, Inc. All rights reserved. -# - -TEMPLATE = app - -TARGET = client -DESTDIR = . - -CONFIG += qt warn_on debug -CONFIG -= app_bundle - -QT = core gui widgets - -SLICES = Hello.ice - -HEADERS = Client.h - -SOURCES = Client.cpp - -DEFINES += ICE_CPP11_MAPPING - -INCLUDEPATH += . - -_ = $$(ICE_HOME) -isEmpty( _ ) { - macx { - ICE_HOME = /usr/local - } - - unix:!macx { - ICE_HOME =? /usr - } -} else { - ICE_HOME = $$(ICE_HOME) -} - -equals (ICE_HOME, "/usr") { -} else:equals(ICE_HOME, "/usr/local") { - INCLUDEPATH += $$ICE_HOME/include -} else:exists($$ICE_HOME/include ) { - INCLUDEPATH += $$ICE_HOME/include -} else:exists($$ICE_HOME/cpp/include ) { - INCLUDEPATH += $$ICE_HOME/cpp/include $$ICE_HOME/cpp/include/generated -} - -exists( $$ICE_HOME/bin/slice2cpp ) { - SLICE2CPP = $$ICE_HOME/bin/slice2cpp -} else:exists( $$ICE_HOME/cpp/bin/slice2cpp ) { - SLICE2CPP = $$ICE_HOME/cpp/bin/slice2cpp -} else { - error(Cannot find a valid slice2cpp compiler in $$ICE_HOME) -} - -equals (ICE_HOME, "/usr") { -} else:equals( ICE_HOME, "/usr/local") { - LIBS += -L$$ICE_HOME/lib -} else:exists( $(ICE_HOME)/lib64/libIce++11.* ) { - LIBS += -L$$ICE_HOME/lib64 -} else:exists( $$ICE_HOME/lib/libIce++11.* ) { - LIBS += -L$$ICE_HOME/lib -} else:exists( $$ICE_HOME/lib/x86_64-linux-gnu/libIce++11.* ) { - LIBS += -L$$ICE_HOME/lib/x86_64-linux-gnu -} else:exists( $$ICE_HOME/cpp/lib64/libIce++11.* ) { - LIBS += -L$$ICE_HOME/cpp/lib64 -} else:exists( $$ICE_HOME/cpp/lib/libIce++11.* ) { - LIBS += -L$$ICE_HOME/cpp/lib -} else:exists( $$ICE_HOME/cpp/lib/x86_64-linux-gnu ) { - LIBS += -L$$ICE_HOME/cpp/lib/x86_64-linux-gnu -} else { - error(Cannot find a valid ICE library directory) -} - -LIBS += -lIce++11 - -# -# Qmake extra compilers expect a single output file per input file. -# The slice2h fake compiler worksaround this limitation it just add -# the generated header to HEADERS variable and adds a dependency -# to the slice2cpp compiler that generates both the header and source -# files. -# -slice2h.output = ${QMAKE_FILE_BASE}.h -slice2h.variable_out = HEADERS -slice2h.commands = touch ${QMAKE_FILE_BASE}.h -slice2h.depends = ${QMAKE_FILE_BASE}.cpp -slice2h.input = SLICES - -slice2cpp.output = ${QMAKE_FILE_BASE}.cpp -slice2cpp.variable_out = SOURCES HEADERS -slice2cpp.commands = $${SLICE2CPP} ${QMAKE_FILE_NAME} -slice2cpp.input = SLICES - -QMAKE_EXTRA_COMPILERS += slice2h slice2cpp diff --git a/cpp/README.md b/cpp/README.md index 6da40404ce..b2e2073d60 100644 --- a/cpp/README.md +++ b/cpp/README.md @@ -1,4 +1,4 @@ -# C++11 Demos +# C++ Demos - [Overview](#overview) - [Building and Running the Demos on Linux and macOS](#building-and-running-the-demos-on-linux-and-macos) @@ -6,8 +6,7 @@ ## Overview -This directory contains C++ sample programs for various Ice components; they all -use the Ice C++11 mapping. These examples are provided to get you started on +This directory contains C++ sample programs for various Ice components. These examples are provided to get you started on using a particular Ice feature or coding technique. Most of the subdirectories here correspond directly to Ice components, such as @@ -24,7 +23,7 @@ for the ZeroC [Chat Demo][2]. ### Prerequisites -The makefiles require GNU make. +The Makefiles require GNU make. On macOS, the command-line demos require the Xcode Command Line Tools (use `xcode-select --install` to install them). @@ -90,7 +89,7 @@ or change the SDK version in the project property pages or by right-clicking the #### Building the demos using NuGet packages: -Open the solution file `C++11 demos.sln` to build the sample programs. +Open the solution file `C++ demos.sln` to build the sample programs. The demos are configured to use Ice C++ binary distribution, packaged with NuGet. The build downloads automatically the Ice NuGet package. From b7091fad725f0d20bc6760ac68e7e5569975f7d8 Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 11:36:39 -0400 Subject: [PATCH 14/18] Disable Windows CI --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87420428c3..efb385cdaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,11 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-14, windows-2022] + os: [ + ubuntu-22.04, + macos-14, + # windows-2022 + ] runs-on: ${{ matrix.os }} steps: From 36caa5b52956aee9b185dc03dba9c16ca4195530 Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 12:14:51 -0400 Subject: [PATCH 15/18] Review fixes --- cpp/Chat/client/Client.cpp | 6 +++--- cpp/Chat/server/ChatRoom.cpp | 4 ++-- cpp/Glacier2/callback/Client.cpp | 2 +- cpp/Glacier2/simpleChat/ChatSessionI.cpp | 2 +- cpp/Glacier2/simpleChat/Client.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpp/Chat/client/Client.cpp b/cpp/Chat/client/Client.cpp index 02ac30f99c..d574c051a0 100644 --- a/cpp/Chat/client/Client.cpp +++ b/cpp/Chat/client/Client.cpp @@ -115,7 +115,7 @@ run(shared_ptr communicator) optional router{communicator->getDefaultRouter()}; if (!router) { - throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); + throw runtime_error("Ice.Default.Router property not set."); } // Create a session with the Glacier2 router @@ -128,10 +128,10 @@ run(shared_ptr communicator) // provided by the router Ice::Identity id{Ice::generateUUID(), router->getCategoryForClient()}; - auto callbackPrx = adapter->add(make_shared(), id); + Chat::ChatRoomCallbackPrx callbackPrx = adapter->add(make_shared(), id); // Set the callback proxy on the session - session->setCallback(Chat::ChatRoomCallbackPrx{callbackPrx}); + session->setCallback(callbackPrx); menu(); diff --git a/cpp/Chat/server/ChatRoom.cpp b/cpp/Chat/server/ChatRoom.cpp index 2980471ff8..96ed8ccf02 100644 --- a/cpp/Chat/server/ChatRoom.cpp +++ b/cpp/Chat/server/ChatRoom.cpp @@ -62,7 +62,7 @@ void ChatRoom::leave(const string& name) { const lock_guard sync(_mutex); - const long long timestamp = + const auto timestamp = chrono::duration_cast(chrono::system_clock::now().time_since_epoch()).count(); _members.erase(name); @@ -84,7 +84,7 @@ int64_t ChatRoom::send(const string& name, const string& message) { const lock_guard sync(_mutex); - const long long timestamp = + const auto timestamp = chrono::duration_cast(chrono::system_clock::now().time_since_epoch()).count(); auto e = make_shared(timestamp, name, message); diff --git a/cpp/Glacier2/callback/Client.cpp b/cpp/Glacier2/callback/Client.cpp index 35cf22b511..e24db395b3 100644 --- a/cpp/Glacier2/callback/Client.cpp +++ b/cpp/Glacier2/callback/Client.cpp @@ -60,7 +60,7 @@ run(const shared_ptr& communicator) optional defaultRouter = communicator->getDefaultRouter(); if (!defaultRouter) { - throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); + throw runtime_error("Ice.Default.Router property is not set."); } const Glacier2::RouterPrx router = Glacier2::RouterPrx(*defaultRouter); diff --git a/cpp/Glacier2/simpleChat/ChatSessionI.cpp b/cpp/Glacier2/simpleChat/ChatSessionI.cpp index 7b63879f90..0b6f9f94e3 100644 --- a/cpp/Glacier2/simpleChat/ChatSessionI.cpp +++ b/cpp/Glacier2/simpleChat/ChatSessionI.cpp @@ -154,7 +154,7 @@ ChatSessionI::setCallback(optional callback, const Ice::Current _callback = callback; auto chatRoom = ChatRoom::instance(); chatRoom->message(_userId + " has entered the chat room."); - chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), *callback, current); + chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), std::move(*callback), current); } } diff --git a/cpp/Glacier2/simpleChat/Client.cpp b/cpp/Glacier2/simpleChat/Client.cpp index f916fc0642..7ff363b255 100644 --- a/cpp/Glacier2/simpleChat/Client.cpp +++ b/cpp/Glacier2/simpleChat/Client.cpp @@ -68,7 +68,7 @@ run(const shared_ptr& communicator) optional defaultRouter = communicator->getDefaultRouter(); if (!defaultRouter) { - throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); + throw runtime_error("Ice.Default.Router property is not set."); } const Glacier2::RouterPrx router = Glacier2::RouterPrx(*defaultRouter); optional session; From a618b1d30d9f2d4309caf6957192bc05bd10b782 Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 13:02:50 -0400 Subject: [PATCH 16/18] Fix --- cpp/Chat/client/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/Chat/client/Client.cpp b/cpp/Chat/client/Client.cpp index d574c051a0..1647c3e9c4 100644 --- a/cpp/Chat/client/Client.cpp +++ b/cpp/Chat/client/Client.cpp @@ -128,7 +128,7 @@ run(shared_ptr communicator) // provided by the router Ice::Identity id{Ice::generateUUID(), router->getCategoryForClient()}; - Chat::ChatRoomCallbackPrx callbackPrx = adapter->add(make_shared(), id); + auto callbackPrx = Chat::ChatRoomCallbackPrx{adapter->add(make_shared(), id)}; // Set the callback proxy on the session session->setCallback(callbackPrx); From 90efcb2fdecbc23b5664deb42ba2ecf4cb78a9aa Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 13:05:35 -0400 Subject: [PATCH 17/18] Review fixes --- cpp/IceGrid/icebox/HelloI.cpp | 5 +++++ cpp/IceStorm/clock/Publisher.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/cpp/IceGrid/icebox/HelloI.cpp b/cpp/IceGrid/icebox/HelloI.cpp index 915bf401b2..77ec420a12 100644 --- a/cpp/IceGrid/icebox/HelloI.cpp +++ b/cpp/IceGrid/icebox/HelloI.cpp @@ -2,6 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#ifdef _MSC_VER +// For getenv +# define _CRT_SECURE_NO_WARNINGS +#endif + #include "HelloI.h" #include #include diff --git a/cpp/IceStorm/clock/Publisher.cpp b/cpp/IceStorm/clock/Publisher.cpp index bde6fa9f58..7b7846eb1b 100644 --- a/cpp/IceStorm/clock/Publisher.cpp +++ b/cpp/IceStorm/clock/Publisher.cpp @@ -2,6 +2,11 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // +#ifdef _MSC_VER +// For getenv +# define _CRT_SECURE_NO_WARNINGS +#endif + #include "Clock.h" #include #include From e7469c19d9323d5059b57ae15c11112e21b210af Mon Sep 17 00:00:00 2001 From: Joe George Date: Wed, 29 May 2024 14:43:49 -0400 Subject: [PATCH 18/18] review fix --- cpp/Chat/client/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/Chat/client/Client.cpp b/cpp/Chat/client/Client.cpp index 1647c3e9c4..926b0d4d67 100644 --- a/cpp/Chat/client/Client.cpp +++ b/cpp/Chat/client/Client.cpp @@ -128,7 +128,7 @@ run(shared_ptr communicator) // provided by the router Ice::Identity id{Ice::generateUUID(), router->getCategoryForClient()}; - auto callbackPrx = Chat::ChatRoomCallbackPrx{adapter->add(make_shared(), id)}; + Chat::ChatRoomCallbackPrx callbackPrx{adapter->add(make_shared(), id)}; // Set the callback proxy on the session session->setCallback(callbackPrx);