summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/pickle/Reader.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-10-09 03:26:54 +0000
committerMarc Laukien <marc@zeroc.com>2001-10-09 03:26:54 +0000
commit5f01a4a9444e8fa9269a86ef403b2ca183fa9de5 (patch)
tree5f1de030386a81aa6a5d6d9e7b1d24322962f195 /cpp/demo/Ice/pickle/Reader.cpp
parentfixes (diff)
downloadice-5f01a4a9444e8fa9269a86ef403b2ca183fa9de5.tar.bz2
ice-5f01a4a9444e8fa9269a86ef403b2ca183fa9de5.tar.xz
ice-5f01a4a9444e8fa9269a86ef403b2ca183fa9de5.zip
removed pickler, native
Diffstat (limited to 'cpp/demo/Ice/pickle/Reader.cpp')
-rw-r--r--cpp/demo/Ice/pickle/Reader.cpp74
1 files changed, 0 insertions, 74 deletions
diff --git a/cpp/demo/Ice/pickle/Reader.cpp b/cpp/demo/Ice/pickle/Reader.cpp
deleted file mode 100644
index 26e5e562bc9..00000000000
--- a/cpp/demo/Ice/pickle/Reader.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2001
-// MutableRealms, Inc.
-// Huntsville, AL, USA
-//
-// All Rights Reserved
-//
-// **********************************************************************
-
-#include <Ice/Ice.h>
-#include <Pickle.h>
-#include <ServantFactory.h>
-#include <fstream>
-
-using namespace std;
-
-int
-run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
-{
- Ice::ServantFactoryPtr factory = new ServantFactory;
- communicator->addServantFactory(factory, "::Persistent");
-
- ifstream in("persistent");
- if (!in)
- {
- cerr << argv[0] << ": can't open file \"persistent\" for reading: "
- << strerror(errno) << endl;
- return EXIT_FAILURE;
- }
-
- Ice::PicklerPtr pickler = communicator->getPickler();
- Ice::ObjectPtr base = pickler->unpickle("::Persistent", in);
- PersistentPtr persistent = dynamic_cast<Persistent*>(base.get());
- assert(persistent);
-
- cout << "aString = \"" << persistent->aString << "\"" << endl;
- cout << "aDouble = " << persistent->aDouble << endl;
-
- return EXIT_SUCCESS;
-}
-
-int
-main(int argc, char* argv[])
-{
- int status;
- Ice::CommunicatorPtr communicator;
-
- try
- {
- communicator = Ice::initialize(argc, argv);
- status = run(argc, argv, communicator);
- }
- catch(const Ice::LocalException& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
-
- if (communicator)
- {
- try
- {
- communicator->destroy();
- }
- catch(const Ice::LocalException& ex)
- {
- cerr << ex << endl;
- status = EXIT_FAILURE;
- }
- }
-
- return status;
-}