summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/ast/ast_template_module_ref.cpp
blob: b12bc7100e686d4894f7a447b9afa984287bbc20 (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
#include "ast_template_module_ref.h"
#include "ast_template_module.h"
#include "ast_visitor.h"

#include "utl_strlist.h"

AST_Decl::NodeType const
AST_Template_Module_Ref::NT = AST_Decl::NT_module;

AST_Template_Module_Ref::AST_Template_Module_Ref (
      UTL_ScopedName *n,
      AST_Template_Module *ref,
      UTL_StrList *param_refs)
  : COMMON_Base (false,
                 false),
    AST_Decl (AST_Decl::NT_module,
              n),
    AST_Field (AST_Decl::NT_module,
               ref,
               n),
    param_refs_ (param_refs),
    processed_ (false)
{
}

AST_Template_Module_Ref::~AST_Template_Module_Ref ()
{
}

AST_Template_Module *
AST_Template_Module_Ref::ref () const
{
  return dynamic_cast<AST_Template_Module*> (this->field_type ());
}

UTL_StrList *
AST_Template_Module_Ref::param_refs () const
{
  return this->param_refs_;
}

void
AST_Template_Module_Ref::dump (ACE_OSTREAM_TYPE &)
{
  // TODO
}

void
AST_Template_Module_Ref::destroy ()
{
  this->param_refs_->destroy ();
  delete this->param_refs_;
  this->param_refs_ = nullptr;

  this->AST_Field::destroy ();
}

int
AST_Template_Module_Ref::ast_accept (ast_visitor *visitor)
{
  return visitor->visit_template_module_ref (this);
}

// If IDL module has been created in a scope corresponding
// to this node. That's the one we want to match, NOT this
// AST_Template_Module_Ref, and it occurs in the scope right
// after this node, so we'll match what we're looking for on
// the next iteration of the search. So for this immediate
// adjustment we return no match.
AST_Decl *
AST_Template_Module_Ref::adjust_found (
  bool ignore_fwd,
  bool /*full_def_only*/)
{
  return ignore_fwd ? nullptr : this;
}

bool
AST_Template_Module_Ref::processed () const
{
  return this->processed_;
}

void
AST_Template_Module_Ref::processed (bool val)
{
  this->processed_ = val;
}