-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathcpp_compound.cpp
More file actions
48 lines (39 loc) · 870 Bytes
/
Copy pathcpp_compound.cpp
File metadata and controls
48 lines (39 loc) · 870 Bytes
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
// Copyright (C) 2022 Satya Das and CppParser contributors
// SPDX-License-Identifier: MIT
#include "cppast/cpp_compound.h"
#include "cppast/cpp_compound_info_accessor.h"
#include "cppast/cpp_function.h"
namespace cppast {
CppCompound::CppCompound(std::string name, CppCompoundType type)
: CppEntity(EntityType())
, name_(std::move(name))
, compoundType_(type)
{
}
CppCompound::CppCompound(CppCompoundType type)
: CppCompound(std::string(), type)
{
}
bool CppCompound::visitAll(const Visitor<const CppEntity&>& callback) const
{
for (auto& entity : entities_)
{
if (!callback(*entity))
{
return false;
}
}
return true;
}
bool CppCompound::visitAll(const Visitor<CppEntity&>& callback)
{
for (auto& entity : entities_)
{
if (!callback(*entity))
{
return false;
}
}
return true;
}
} // namespace cppast