// ********************************************************************** // // Copyright (c) 2003-2017 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 #include using namespace Test; using namespace IceUtil; using namespace Ice; using namespace std; InitialI::InitialI() { } void InitialI::shutdown(const Current& current) { current.adapter->getCommunicator()->shutdown(); } ObjectPtr InitialI::pingPong(const ObjectPtr& obj, const Current&) { return obj; } void InitialI::opOptionalException(const Optional& a, const Optional& b, const Optional& o, const Ice::Current&) { OptionalException ex; ex.a = a; ex.b = b; ex.o = o; throw ex; } void InitialI::opDerivedException(const Optional& a, const Optional& b, const Optional& o, const Ice::Current&) { DerivedException ex; ex.a = a; ex.b = b; ex.o = o; ex.ss = b; ex.o2 = o; throw ex; } void InitialI::opRequiredException(const Optional& a, const Optional& b, const Optional& o, const Ice::Current&) { RequiredException ex; ex.a = a; ex.b = b; ex.o = o; if(b) { ex.ss = b.get(); } if(o) { ex.o2 = o.get(); } throw ex; } Optional InitialI::opByte(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opBool(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opShort(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opInt(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opLong(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opFloat(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opDouble(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opString(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opCustomString(const Optional& p1, Optional& p3, const Current&) { if(p1) { p3 = p1->to_string(); } return p3; } Optional InitialI::opMyEnum(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opSmallStruct(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opFixedStruct(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opVarStruct(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opOneOptional(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opOneOptionalProxy(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p1; } Optional InitialI::opByteSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Ice::ByteSeq(p1->first, p1->second); } return p3; } Optional InitialI::opBoolSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Ice::BoolSeq(p1->first, p1->second); } return p3; } Optional InitialI::opShortSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Ice::ShortSeq(p1->first, p1->second); } return p3; } Optional InitialI::opIntSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Test::IntSeq(p1->first, p1->second); } return p3; } Optional InitialI::opLongSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Test::LongSeq(p1->first, p1->second); } return p3; } Optional InitialI::opFloatSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Test::FloatSeq(p1->first, p1->second); } return p3; } Optional InitialI::opDoubleSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Test::DoubleSeq(p1->first, p1->second); } return p3; } Optional InitialI::opStringSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = Ice::StringSeq(p1->first, p1->second); } return p3; } Optional InitialI::opSmallStructSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = SmallStructSeq(p1->first, p1->second); } return p3; } Optional InitialI::opSmallStructList(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = SmallStructList(p1->first, p1->second); } return p3; } Optional InitialI::opFixedStructSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = FixedStructSeq(p1->first, p1->second); } return p3; } Optional InitialI::opFixedStructList(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = FixedStructList(p1->first, p1->second); } return p3; } Optional InitialI::opVarStructSeq(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = VarStructSeq(p1->first, p1->second); } return p3; } Optional InitialI::opSerializable(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p3; } Optional InitialI::opIntIntDict(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p3; } Optional InitialI::opStringIntDict(const Optional& p1, Optional& p3, const Current&) { p3 = p1; return p3; } Optional InitialI::opCustomIntStringDict(const Optional >& p1, Optional& p3, const Current&) { if(p1) { p3 = IntStringDict(); for(std::map::const_iterator p = p1->begin(); p != p1->end(); ++p) { (*p3)[p->first] = p->second.to_string(); } } return p3; } void InitialI::opClassAndUnknownOptional(const APtr&, const Ice::Current&) { } void InitialI::sendOptionalClass(bool, const Optional&, const Ice::Current&) { } void InitialI::returnOptionalClass(bool, Optional& o, const Ice::Current&) { o = new OneOptional(53); } GPtr InitialI::opG(const GPtr& g, const Ice::Current&) { return g; } void InitialI::opVoid(const Ice::Current&) { } bool InitialI::supportsRequiredParams(const Ice::Current&) { return false; } bool InitialI::supportsJavaSerializable(const Ice::Current&) { return true; } bool InitialI::supportsCsharpSerializable(const Ice::Current&) { return true; } bool InitialI::supportsCppStringView(const Ice::Current&) { return true; }