Commit a1107af9 authored by Yoshitaka Aharen's avatar Yoshitaka Aharen
Browse files

[2157] renamed CounterTypeTree to CounterSpec

parent a0f35ebd
......@@ -263,7 +263,7 @@ def generate_cxx(itemsfile, ccfile, utfile, def_mtime):
'", NULL, ' + item['index'] + ' },\n'
)
else:
item_names_current_ = ['const struct CounterTypeTree ' +
item_names_current_ = ['const struct CounterSpec ' +
item['index'] + '[] = {\n']
msg_counter_types, item_names_current_, item_names = \
convert_list(item['child'], msg_counter_types,
......@@ -277,7 +277,7 @@ def generate_cxx(itemsfile, ccfile, utfile, def_mtime):
msg_counter_types, item_names_current, item_names = \
convert_list(item_list, msg_counter_types, [], item_names)
item_names.append('const struct CounterTypeTree msg_counter_tree[] = {\n')
item_names.append('const struct CounterSpec msg_counter_tree[] = {\n')
item_names.extend(item_names_current)
item_names.append(' { NULL, NULL, NOT_ITEM }\n' +
'};\n')
......
......@@ -44,17 +44,17 @@ namespace {
void
fillNodes(const Counter& counter,
const struct isc::auth::statistics::CounterTypeTree type_tree[],
const struct isc::auth::statistics::CounterSpec type_tree[],
isc::auth::statistics::Counters::ItemTreePtr& trees)
{
using namespace isc::data;
for (int i = 0; type_tree[i].name != NULL; ++i) {
if (type_tree[i].sub_tree != NULL) {
isc::auth::statistics::Counters::ItemTreePtr sub_tree =
if (type_tree[i].sub_counters != NULL) {
isc::auth::statistics::Counters::ItemTreePtr sub_counters =
Element::createMap();
trees->set(type_tree[i].name, sub_tree);
fillNodes(counter, type_tree[i].sub_tree, sub_tree);
trees->set(type_tree[i].name, sub_counters);
fillNodes(counter, type_tree[i].sub_counters, sub_counters);
} else {
trees->set(type_tree[i].name,
Element::create(static_cast<long int>(
......
......@@ -22,9 +22,9 @@ namespace isc {
namespace auth {
namespace statistics {
struct CounterTypeTree {
struct CounterSpec {
const char* const name;
const struct CounterTypeTree* const sub_tree;
const struct CounterSpec* const sub_counters;
const int counter_id;
};
......
......@@ -135,13 +135,13 @@ TEST_F(CountersTest, incrementNormalQuery) {
}
int
countTreeElements(const struct CounterTypeTree* tree) {
countTreeElements(const struct CounterSpec* tree) {
int count = 0;
for (int i = 0; tree[i].name != NULL; ++i) {
if (tree[i].sub_tree == NULL) {
if (tree[i].sub_counters == NULL) {
++count;
} else {
count += countTreeElements(tree[i].sub_tree);
count += countTreeElements(tree[i].sub_counters);
}
}
return (count);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment