Coverage Report

Created: 2025-10-12 06:40

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/opendnp3/cpp/lib/src/master/ClearRestartTask.h
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
#ifndef OPENDNP3_CLEARRESTARTTASK_H
21
#define OPENDNP3_CLEARRESTARTTASK_H
22
23
#include "master/IMasterTask.h"
24
#include "master/TaskPriority.h"
25
26
namespace opendnp3
27
{
28
29
/**
30
 * Clear the IIN restart bit
31
 */
32
class ClearRestartTask final : public IMasterTask
33
{
34
35
public:
36
    ClearRestartTask(const std::shared_ptr<TaskContext>& context,
37
                     IMasterApplication& application,
38
                     const Logger& logger);
39
40
    virtual char const* Name() const override
41
0
    {
42
0
        return "Clear Restart IIN";
43
0
    }
44
45
    virtual bool IsRecurring() const override
46
9.47k
    {
47
9.47k
        return true;
48
9.47k
    }
49
50
    virtual int Priority() const override
51
6.43k
    {
52
6.43k
        return priority::CLEAR_RESTART;
53
6.43k
    }
54
55
    virtual bool BlocksLowerPriority() const override
56
0
    {
57
0
        return true;
58
0
    }
59
60
    virtual bool BuildRequest(APDURequest& request, uint8_t seq) override;
61
62
private:
63
    virtual MasterTaskType GetTaskType() const override
64
7
    {
65
7
        return MasterTaskType::CLEAR_RESTART;
66
7
    }
67
68
    virtual bool IsEnabled() const override
69
25.6k
    {
70
25.6k
        return true;
71
25.6k
    }
72
73
    virtual ResponseResult ProcessResponse(const APDUResponseHeader& response, const ser4cpp::rseq_t& objects) override;
74
};
75
76
} // namespace opendnp3
77
78
#endif