GCC Code Coverage Report


Directory: ./
File: pdserv-1.1.0/src/msrproto/StatSignal.h
Date: 2024-12-15 04:08:34
Exec Total Coverage
Lines: 0 1 0.0%
Branches: 0 0 -%

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