summaryrefslogtreecommitdiff
path: root/tao/PI/RequestInterceptor_Adapter_Impl.cpp
blob: 625924a6506f4609f28a10a7c64d5204eb9b7f5a (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file    RequestInterceptor_Adapter_Impl.cpp
 *
 *  $Id$
 *
 *   This file an adapter class to simplify the support of
 *   interceptors.
 */
//=============================================================================

#include "tao/PI/RequestInterceptor_Adapter_Impl.h"

#if TAO_HAS_INTERCEPTORS == 1

#include "tao/ORB_Core.h"
#include "tao/PI/RequestInterceptor_Adapter_Impl.h"
#include "tao/PI/PICurrent.h"
#include "tao/PI/PICurrent_Impl.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_RequestInterceptor_Adapter_Impl::~TAO_RequestInterceptor_Adapter_Impl (void)
{
}

void
TAO_RequestInterceptor_Adapter_Impl::popTSC (
  TAO_ORB_Core *orb_core)
{
  // Retrieve the thread scope current (no TSS access incurred yet).
  TAO::PICurrent
    *pi_current= dynamic_cast <TAO::PICurrent *> (
      orb_core->pi_current ());

  // If the slot count is zero, there is nothing to copy.  Prevent any
  // copying (and hence TSS accesses) from occurring.
  if (pi_current && pi_current->slot_count ())
    {
      pi_current->tsc ()->pop ();
    }
}

void
TAO_RequestInterceptor_Adapter_Impl::pushTSC (
  TAO_ORB_Core *orb_core)
{
  // Retrieve the thread scope current (no TSS access incurred yet).
  TAO::PICurrent
    *pi_current= dynamic_cast <TAO::PICurrent *> (
      orb_core->pi_current ());

  // If the slot count is zero, there is nothing to copy.  Prevent any
  // copying (and hence TSS accesses) from occurring.
  if (pi_current && pi_current->slot_count ())
    {
      pi_current->tsc ()->push ();
    }
}

TAO_END_VERSIONED_NAMESPACE_DECL

#endif  /* TAO_HAS_INTERCEPTORS == 1 */