Coverage Report

Created: 2026-01-17 06:53

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/opendnp3/cpp/lib/src/outstation/DatabaseConfig.cpp
Line
Count
Source
1
/*
2
 * Copyright 2013-2022 Step Function I/O, LLC
3
 *
4
 * Licensed to Green Energy Corp (www.greenenergycorp.com) and Step Function I/O
5
 * LLC (https://stepfunc.io) under one or more contributor license agreements.
6
 * See the NOTICE file distributed with this work for additional information
7
 * regarding copyright ownership. Green Energy Corp and Step Function I/O LLC license
8
 * this file to you under the Apache License, Version 2.0 (the "License"); you
9
 * may not use this file except in compliance with the License. You may obtain
10
 * a copy of the License at:
11
 *
12
 * http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20
21
#include "opendnp3/outstation/DatabaseConfig.h"
22
23
namespace opendnp3
24
{
25
26
template<class T> void initialize(std::map<uint16_t, T>& map, uint16_t count)
27
86.4k
{
28
950k
    for (uint16_t i = 0; i < count; ++i)
29
864k
    {
30
864k
        map[i] = {};
31
864k
    }
32
86.4k
}
void opendnp3::initialize<opendnp3::BinaryConfig>(std::__1::map<unsigned short, opendnp3::BinaryConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::BinaryConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::DoubleBitBinaryConfig>(std::__1::map<unsigned short, opendnp3::DoubleBitBinaryConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::DoubleBitBinaryConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::AnalogConfig>(std::__1::map<unsigned short, opendnp3::AnalogConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::AnalogConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::CounterConfig>(std::__1::map<unsigned short, opendnp3::CounterConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::CounterConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::FrozenCounterConfig>(std::__1::map<unsigned short, opendnp3::FrozenCounterConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::FrozenCounterConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::BOStatusConfig>(std::__1::map<unsigned short, opendnp3::BOStatusConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::BOStatusConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::AOStatusConfig>(std::__1::map<unsigned short, opendnp3::AOStatusConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::AOStatusConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::TimeAndIntervalConfig>(std::__1::map<unsigned short, opendnp3::TimeAndIntervalConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::TimeAndIntervalConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
void opendnp3::initialize<opendnp3::OctetStringConfig>(std::__1::map<unsigned short, opendnp3::OctetStringConfig, std::__1::less<unsigned short>, std::__1::allocator<std::__1::pair<unsigned short const, opendnp3::OctetStringConfig> > >&, unsigned short)
Line
Count
Source
27
9.60k
{
28
105k
    for (uint16_t i = 0; i < count; ++i)
29
96.0k
    {
30
96.0k
        map[i] = {};
31
96.0k
    }
32
9.60k
}
33
34
DatabaseConfig::DatabaseConfig(uint16_t all_types)
35
9.60k
{
36
9.60k
    initialize(this->binary_input, all_types);
37
9.60k
    initialize(this->double_binary, all_types);
38
9.60k
    initialize(this->analog_input, all_types);
39
9.60k
    initialize(this->counter, all_types);
40
9.60k
    initialize(this->frozen_counter, all_types);
41
9.60k
    initialize(this->binary_output_status, all_types);
42
9.60k
    initialize(this->analog_output_status, all_types);
43
9.60k
    initialize(this->time_and_interval, all_types);
44
9.60k
    initialize(this->octet_string, all_types);
45
9.60k
};
46
47
} // namespace opendnp3