summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/nrvo/NrvoI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Ice/nrvo/NrvoI.cpp')
-rw-r--r--cpp/demo/Ice/nrvo/NrvoI.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/cpp/demo/Ice/nrvo/NrvoI.cpp b/cpp/demo/Ice/nrvo/NrvoI.cpp
new file mode 100644
index 00000000000..dc07ff8d10f
--- /dev/null
+++ b/cpp/demo/Ice/nrvo/NrvoI.cpp
@@ -0,0 +1,54 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <iostream>
+#include <NrvoI.h>
+
+using namespace std;
+
+NrvoI::NrvoI() :
+ _stringSeq(Demo::StringSeqSize, "hello")
+{
+}
+
+Demo::StringSeq
+NrvoI::op1(const Ice::Current&)
+{
+ cout << "running op1" << endl;
+ MyStringSeq seq = MyStringSeq(Demo::StringSeqSize, "hello");
+ return seq;
+}
+
+Demo::StringSeq
+NrvoI::op2(const Ice::Current&)
+{
+ cout << "running op2" << endl;
+ return _stringSeq;
+}
+
+Demo::StringSeq
+NrvoI::op3(int size, const Ice::Current&)
+{
+ cout << "running op3" << endl;
+ MyStringSeq seq;
+ if(size < 10)
+ {
+ return MyStringSeq(size, "hello");
+ }
+ seq = MyStringSeq(10, "hello");
+ return seq;
+}
+
+
+void
+NrvoI::shutdown(const Ice::Current& c)
+{
+ c.adapter->getCommunicator()->shutdown();
+}