summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Trader/Interpreter_Utils.cpp
blob: 6dcd797dc16d96ebeac9ce786ce5d1bf7937c773 (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
// $Id$

#include "orbsvcs/Trader/Interpreter_Utils.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

// TAO_Sequence_Extracter_Base

CORBA::TCKind
TAO_Sequence_Extracter_Base::
sequence_type (CORBA::TypeCode* type_code)
{
  // @@ Seth, why do you use a comma to separate the two statements?
  CORBA::TCKind return_value = CORBA::tk_void,
  type_kind = type_code->kind ();

  if (type_kind == CORBA::tk_alias
      || type_kind == CORBA::tk_sequence)
    {
      CORBA::TypeCode_var base = CORBA::TypeCode::_duplicate (type_code);

      for (;;)
        {
          CORBA::TCKind base_kind = base->kind ();

          if (base_kind == CORBA::tk_alias)
            {
              base = base->content_type ();
            }
          else
            break;
        }

      CORBA::TCKind base_kind = base->kind ();

      if (base_kind == CORBA::tk_sequence)
        {
          base = base->content_type ();

          base_kind = base->kind ();
          return_value = base_kind;
        }
    }

  return return_value;
}

TAO_END_VERSIONED_NAMESPACE_DECL