summaryrefslogtreecommitdiff
path: root/TAO/tests/Big_Request_Muxing/Payload_Receiver.cpp
blob: 917276b28f4baa4c8f7832a08a7bb7ccc070d72c (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
//
// $Id$
//
#include "Payload_Receiver.h"

ACE_RCSID(Big_Request_Muxing, Payload_Receiver, "$Id$")

Payload_Receiver::Payload_Receiver ()
  : message_count_ (0),
    sync_none_message_count_ (0)
{
}

void
Payload_Receiver::more_data (const Test::Payload& payload)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  if (payload.length() > 0)
  {
    ++this->message_count_;
  }
}

void
Payload_Receiver::sync_none_more_data (const Test::Payload& payload)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  if (payload.length() > 0)
  {
    ++this->sync_none_message_count_;
  }
}

int
Payload_Receiver::count(bool sync_none) const
{
  if (sync_none)
    return sync_none_message_count_.value ();
  else
    return message_count_.value ();
}