📄 throughputi.cpp
字号:
// **********************************************************************//// Copyright (c) 2003-2007 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 <ThroughputI.h>#include <Ice/Ice.h>ThroughputI::ThroughputI() : _byteSeq(Demo::ByteSeqSize), _stringSeq(Demo::StringSeqSize, "hello"), _structSeq(Demo::StringDoubleSeqSize), _fixedSeq(Demo::FixedSeqSize), _warmup(true){ int i; for(i = 0; i < Demo::StringDoubleSeqSize; ++i) { _structSeq[i].s = "hello"; _structSeq[i].d = 3.14; } for(i = 0; i < Demo::FixedSeqSize; ++i) { _fixedSeq[i].i = 0; _fixedSeq[i].j = 0; _fixedSeq[i].d = 0; }}voidThroughputI::endWarmup(const Ice::Current&){ _warmup = false;}voidThroughputI::sendByteSeq(const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&){}Demo::ByteSeqThroughputI::recvByteSeq(const Ice::Current&){ if(_warmup) { return Demo::ByteSeq(); } else { return _byteSeq; }}Demo::ByteSeqThroughputI::echoByteSeq(const Demo::ByteSeq& seq, const Ice::Current&){ return seq;}voidThroughputI::sendStringSeq(const Demo::StringSeq&, const Ice::Current&){}Demo::StringSeqThroughputI::recvStringSeq(const Ice::Current&){ if(_warmup) { return Demo::StringSeq(); } else { return _stringSeq; }}Demo::StringSeqThroughputI::echoStringSeq(const Demo::StringSeq& seq, const Ice::Current&){ return seq;}voidThroughputI::sendStructSeq(const Demo::StringDoubleSeq&, const Ice::Current&){}Demo::StringDoubleSeqThroughputI::recvStructSeq(const Ice::Current&){ if(_warmup) { return Demo::StringDoubleSeq(); } else { return _structSeq; }}Demo::StringDoubleSeqThroughputI::echoStructSeq(const Demo::StringDoubleSeq& seq, const Ice::Current&){ return seq;}voidThroughputI::sendFixedSeq(const Demo::FixedSeq&, const Ice::Current&){}Demo::FixedSeqThroughputI::recvFixedSeq(const Ice::Current&){ if(_warmup) { return Demo::FixedSeq(); } else { return _fixedSeq; }}Demo::FixedSeqThroughputI::echoFixedSeq(const Demo::FixedSeq& seq, const Ice::Current&){ return seq;}voidThroughputI::shutdown(const Ice::Current& c){ c.adapter->getCommunicator()->shutdown();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -