summaryrefslogtreecommitdiff
path: root/TAO/IIOP/tests/Thruput_test/ttcp_i.cpp
blob: daba9fe6139dbbbd73e634a1720bd4ce465315b7 (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
#include "ttcp_i.h"
#include <iostream.h>

/* the ttcp_i class implementation */
ttcp_sequence_i::ttcp_sequence_i(const char *obj_name)
  :_skel_ttcp_sequence(obj_name)
{
  this->nbytes_ = 0;
  numCalls = 0;
}


void
ttcp_sequence_i::start_timer (CORBA_Environment &IT_env)
{
    this->nbytes_ = 0;
    ::prep_timer ();
}

void 
ttcp_sequence_i::stop_timer (CORBA_Environment &IT_env)
{
  (void) ::read_timer (stats, sizeof (stats));
	::nbytes = this->nbytes_;
	::PrintStats();
	// reset
	this->nbytes_ = 0;
	numCalls = 0;
#if defined (USE_QUANTIFY)
    quantify_stop_recording_data();
    ACE_Reactor::end_event_loop();
    cerr << "*********** just before exiting " << endl;
#endif
}

void
ttcp_sequence_i::sendShortSeq(const ttcp_sequence::ShortSeq& ttcp_seq, CORBA_Environment &IT_env)
{
    numCalls++;
    this->nbytes_ += ttcp_seq.length()*sizeof(CORBA_Short);
}

void
ttcp_sequence_i::sendLongSeq(const ttcp_sequence::LongSeq& ttcp_seq, CORBA_Environment &IT_env)
{
    numCalls++;
    this->nbytes_ += ttcp_seq.length()*sizeof(CORBA_Long) ;
}

void
ttcp_sequence_i::sendOctetSeq(const ttcp_sequence::OctetSeq& ttcp_seq, CORBA_Environment &IT_env)
{
    numCalls++;
    this->nbytes_ += ttcp_seq.length()*sizeof(CORBA_Octet) ;
}

void
ttcp_sequence_i::sendDoubleSeq(const ttcp_sequence::DoubleSeq& ttcp_seq, CORBA_Environment &IT_env)
{
    numCalls++;
    this->nbytes_ += ttcp_seq.length()*sizeof(CORBA_Double) ;
}

void
ttcp_sequence_i::sendCharSeq(const ttcp_sequence::CharSeq& ttcp_seq, CORBA_Environment &IT_env)
{
    numCalls++;
    this->nbytes_ += ttcp_seq.length()*sizeof(CORBA_Char) ;
}

void
ttcp_sequence_i::sendStructSeq(const ttcp_sequence::StructSeq& ttcp_seq, CORBA_Environment &IT_env)
{
    numCalls++;
    this->nbytes_ += ttcp_seq.length()*sizeof(PerfStruct) ;
#ifdef DEBUG
    //    cout << "Bytes received so far = " << this->nbytes_ << endl;
#endif
}