summaryrefslogtreecommitdiff
path: root/cppe/demo/IceE/throughput/ThroughputI.cpp
blob: 8fb685995ee3e99cfa14fc212c29eddab752522f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice-E is licensed to you under the terms described in the
// ICEE_LICENSE file included in this distribution.
//
// **********************************************************************

#include <ThroughputI.h>
#include <IceE/IceE.h>

using namespace std;
using namespace Demo;

ThroughputI::ThroughputI(int reduce) :
    _byteSeq(ByteSeqSize / reduce, 0),
    _stringSeq(StringSeqSize / reduce, "hello"),
    _structSeq(StringDoubleSeqSize / reduce),
    _fixedSeq(FixedSeqSize / reduce)
{
    int i;
    for(i = 0; i < StringDoubleSeqSize / reduce; ++i)
    {
	_structSeq[i].s = "hello";
	_structSeq[i].d = 3.14;
    }
    for(i = 0; i < FixedSeqSize / reduce; ++i)
    {
	_fixedSeq[i].i = 0;
	_fixedSeq[i].j = 0;
	_fixedSeq[i].d = 0;
    }
}

void
ThroughputI::sendByteSeq(const pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&)
{
}

ByteSeq
ThroughputI::recvByteSeq(const Ice::Current&)
{
    return _byteSeq;
}

ByteSeq
ThroughputI::echoByteSeq(const ByteSeq& seq, const Ice::Current&)
{
    return seq;
}

void
ThroughputI::sendStringSeq(const StringSeq&, const Ice::Current&)
{
}

StringSeq
ThroughputI::recvStringSeq(const Ice::Current&)
{
    return _stringSeq;
}

StringSeq
ThroughputI::echoStringSeq(const StringSeq& seq, const Ice::Current&)
{
    return seq;
}

void
ThroughputI::sendStructSeq(const StringDoubleSeq&, const Ice::Current&)
{
}

StringDoubleSeq
ThroughputI::recvStructSeq(const Ice::Current&)
{
    return _structSeq;
}

StringDoubleSeq
ThroughputI::echoStructSeq(const StringDoubleSeq& seq, const Ice::Current&)
{
    return seq;
}

void
ThroughputI::sendFixedSeq(const FixedSeq&, const Ice::Current&)
{
}

FixedSeq
ThroughputI::recvFixedSeq(const Ice::Current&)
{
    return _fixedSeq;
}

FixedSeq
ThroughputI::echoFixedSeq(const FixedSeq& seq, const Ice::Current&)
{
    return seq;
}

void
ThroughputI::shutdown(const Ice::Current& c)
{
    c.adapter->getCommunicator()->shutdown();
}