summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/value/ValueI.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-08-15 17:21:39 +0000
committerMarc Laukien <marc@zeroc.com>2001-08-15 17:21:39 +0000
commit7aff96f568e834c4c13f26a46843d5ecbb1d325d (patch)
treee801f83704b85d59f80f1516576c3f91290f6d31 /cpp/demo/Ice/value/ValueI.cpp
parentfix (diff)
downloadice-7aff96f568e834c4c13f26a46843d5ecbb1d325d.tar.bz2
ice-7aff96f568e834c4c13f26a46843d5ecbb1d325d.tar.xz
ice-7aff96f568e834c4c13f26a46843d5ecbb1d325d.zip
IcePack ; restructuring
Diffstat (limited to 'cpp/demo/Ice/value/ValueI.cpp')
-rw-r--r--cpp/demo/Ice/value/ValueI.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/cpp/demo/Ice/value/ValueI.cpp b/cpp/demo/Ice/value/ValueI.cpp
new file mode 100644
index 00000000000..03440a4fd7e
--- /dev/null
+++ b/cpp/demo/Ice/value/ValueI.cpp
@@ -0,0 +1,74 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// MutableRealms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <ValueI.h>
+
+using namespace std;
+
+InitialI::InitialI(const Ice::ObjectAdapterPtr& adapter) :
+ _adapter(adapter)
+{
+ _simple = new Simple;
+ _simple->_message = "a message 4 u";
+
+ _printer = new PrinterI;
+ _printer->_message = "Ice rulez!";
+ adapter->addTemporary(_printer);
+ _printerProxy = PrinterPrx::uncheckedCast(adapter->objectToProxy(_printer));
+
+ _derivedPrinter = new DerivedPrinterI;
+ _derivedPrinter->_message = _printer->_message;
+ _derivedPrinter->_derivedMessage = "Coming soon: the ultimate online game from MutableRealms!";
+ adapter->addTemporary(_printer);
+}
+
+SimplePtr
+InitialI::simple()
+{
+ return _simple;
+}
+
+void
+InitialI::printer(PrinterPtr& impl, PrinterPrx& proxy)
+{
+ impl = _printer;
+ proxy = _printerProxy;
+}
+
+PrinterPtr
+InitialI::derivedPrinter()
+{
+ return _derivedPrinter;
+}
+
+void
+InitialI::throwDerivedPrinter()
+{
+ _derivedPrinter->_throw();
+}
+
+void
+PrinterI::printBackwards()
+{
+ string s;
+ s.resize(_message.length());
+ reverse_copy(_message.begin(), _message.end(), s.begin());
+ cout << s << endl;
+}
+
+void
+DerivedPrinterI::printUppercase()
+{
+ string s;
+ s.resize(_derivedMessage.length());
+ transform(_derivedMessage.begin(), _derivedMessage.end(), s.begin(), toupper);
+ cout << s << endl;
+}