summaryrefslogtreecommitdiff
path: root/TAO/tao/DynUnion_i_T.cpp
blob: 1acc92fd2bb118dcb2d36dbc64f1cded507db6e1 (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
/* -*- C++ -*- */
// $Id$
// ========================================================================
//
// = LIBRARY
//    TAO
//
// = FILENAME
//    DynUnion_i_T.cpp
//
// = AUTHOR
//    Jeff Parsons <jp4@cs.wustl.edu>
//
// ========================================================================

#if !defined TAO_DYNUNION_I_T_C
#define TAO_DYNUNION_I_T_C

#include "tao/DynUnion_i_T.h"

// Method of template class that serves as a functor for all that
// compares Anys constructed from all legal discriminator
// types - some are specifically defined in DynUnion_i.cpp.

template <class Type>
CORBA::Boolean
DU_Extractor<Type>::check_match (const CORBA_Any& inside_any,
                                 const CORBA_Any& outside_any)
{
  inside_any >>= this->member_index_;
  outside_any >>= this->arg_index_;

#if defined (ACE_LACKS_LONGLONG_T)
  // Oh, this is ugly.  But, it's the only way I can think of
  // to satisfy instantiations of CORBA::LongLong as well as
  // all other (native) types.
  return ! ACE_OS::memcmp (&this->member_index_,
                           &this->arg_index_,
                           sizeof (Type));
#else  /* ! ACE_LACKS_LONGLONG_T */
  return this->member_index_ == this->arg_index_;
#endif /* ! ACE_LACKS_LONGLONG_T */
}

#endif /* TAO_DYNUNION_I_T_C */