GCC Code Coverage Report


Directory: ./
File: pdserv/src/msrproto/StatSignal.h
Date: 2025-08-17 04:10:43
Exec Total Coverage
Lines: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*****************************************************************************
2 *
3 * Copyright 2010 Richard Hacker (lerichi at gmx dot net)
4 *
5 * This file is part of the pdserv library.
6 *
7 * The pdserv library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation, either version 3 of the License, or (at
10 * your option) any later version.
11 *
12 * The pdserv library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with the pdserv library. If not, see <http://www.gnu.org/licenses/>.
19 *
20 ****************************************************************************/
21
22 #ifndef MSRSTATSIGNAL_H
23 #define MSRSTATSIGNAL_H
24
25 #include "../Signal.h"
26 #include "Channel.h"
27 #include <stdint.h>
28
29 namespace PdServ {
30 class Session;
31 class Task;
32 }
33
34 namespace MsrProto {
35
36 1848 class StatSignal: public PdServ::Signal, public Channel {
37 public:
38 enum Type {ExecTime, Period, Overrun};
39
40 StatSignal(const PdServ::Task *task, Type type, size_t index);
41
42 private:
43 const Type type;
44
45 double getValue( const PdServ::Session *session,
46 struct timespec *t) const;
47
48 // Reimplemented from PdServ::Signal
49 void subscribe(PdServ::SessionTask *) const;
50 void unsubscribe(PdServ::SessionTask *) const;
51 double poll(const PdServ::Session *s,
52 void *buf, struct timespec *t) const;
53 const char *getValue(const PdServ::SessionTask*) const;
54 int getValue(const PdServ::Session*, void*, struct timespec*) const;
55 };
56
57 }
58
59 #endif //MSRSTATSIGNAL_H
60