summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/ImR/Advanced/Messenger_i.cpp
blob: 235c97a6b6a4ccf87c8990c525d3f4ae00d5d616 (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
// -*- C++ -*-
//
// $Id$

#include "Messenger_i.h"

#include <ace/streams.h>

Messenger_i::Messenger_i (CORBA::ORB_ptr orb, long instance)
: instance_(instance)
, orb_(CORBA::ORB::_duplicate(orb))
, isHit_(false)
{
}

Messenger_i::~Messenger_i (void)
{
}

bool Messenger_i::acknowledgeHit()
{
  bool isHit = isHit_;
  isHit_ = false;
  return isHit;
}

CORBA::Long Messenger_i::send_message (CORBA::Long thread,
                                       CORBA::Long iter,
                                       CORBA::Long obj,
                                       CORBA::Long req) ACE_THROW_SPEC ((CORBA::SystemException))
{
  cout << "* Invoked: (" << instance_ << "." << thread << "." << iter
    << "." << obj << "." << req << ")" << endl;
  isHit_ = true;
  return instance_;
}

void Messenger_i::shutdownOrb () ACE_THROW_SPEC ((CORBA::SystemException))
{
  orb_->shutdown(0);
}