summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_valuebox.cpp
blob: 855c695c4e237069633e0ed396270b56efc6f4d0 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO IDL
//
// = FILENAME
//    be_valuebox.cpp
//
// = DESCRIPTION
//    Extension of class AST_Valuebox that provides additional means for C++
//    mapping.
//
// = AUTHOR
//    Gary Maxey
//
// ============================================================================

#include "be_valuebox.h"
#include "be_type.h"
#include "be_visitor.h"
#include "global_extern.h"

ACE_RCSID (be,
           be_valuebox,
           "be_valuebox.cpp Exp")

// Default constructor.
be_valuebox::be_valuebox (void)
  : COMMON_Base (),
    AST_Decl (),
    AST_Type (),
    AST_ConcreteType (),
    AST_ValueBox (),
    be_decl (),
    be_type ()
{
  // Always the case (according to C++ mapping specification).
  this->size_type (AST_Type::VARIABLE);

  // Set the flag  that says we have a valuetype in this IDL file.
  // This allows the correct #include to be generated (see be_codegen.cpp).
  idl_global->valuebase_seen_ = true;

  // Set the flag that says we have a valuetype in this IDL file.
  // This allows the correct #include to be generated (see be_codegen.cpp).
  idl_global->valuetype_seen_ = true;
}

be_valuebox::be_valuebox (AST_Type *boxed_type,
                          UTL_ScopedName *n)
  : COMMON_Base (),
    AST_Decl (AST_Decl::NT_valuebox,
              n),
    AST_Type (AST_Decl::NT_valuebox,
              n),
    AST_ConcreteType (AST_Decl::NT_valuebox,
                      n),
    AST_ValueBox (n,
                  boxed_type),
    be_decl (AST_Decl::NT_valuebox,
             n),
    be_type (AST_Decl::NT_valuebox,
             n)
{
  // Always the case (according to C++ mapping specification).
  this->size_type (AST_Type::VARIABLE);

  // Set the flag  that says we have a valuetype in this IDL file.
  // This allows the correct #include to be generated (see be_codegen.cpp).
  idl_global->valuebase_seen_ = true;

  // Set the flag that says we have a valuetype in this IDL file.
  // This allows the correct #include to be generated (see be_codegen.cpp).
  idl_global->valuetype_seen_ = true;
}

// Accept a visitor.
int
be_valuebox::accept (be_visitor *visitor)
{
  return visitor->visit_valuebox (this);
}


void
be_valuebox::destroy (void)
{
  // Call the destroy methods of our base classes.
  this->AST_Type::destroy ();
}



IMPL_NARROW_FROM_DECL (be_valuebox)