blob: 392cf3d91f945bf9027b4df58d3d7324768218cd (
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
|
// -*- C++ -*-
// $Id$
#include "ace/ACE.h"
#include "Hash_Replica_i.h"
#include "Hash_ReplicaControl.h"
Hash_Replica_Impl::Hash_Replica_Impl (Hash_ReplicaControl *control)
: control_ (control),
reject_requests_ (0)
{
// Nothing else
}
CORBA::ULong
Hash_Replica_Impl::do_hash (const char *str,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (this->reject_requests_)
{
this->control_->request_rejected (ACE_TRY_ENV);
return 0;
}
this->control_->request_received ();
// Return the hash.
return ACE::hash_pjw (str);
}
void
Hash_Replica_Impl::reject_requests (int reject)
{
this->reject_requests_ = reject;
}
|