GCC Code Coverage Report


Directory: ./
File: pdserv/src/ProcessParameter.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 PROCESSPARAMETER_H
23 #define PROCESSPARAMETER_H
24
25 #include <ctime>
26 #include "PThread.h"
27 #include "Parameter.h"
28
29 namespace PdServ {
30
31 class Main;
32
33 942 class ProcessParameter: public Parameter {
34 public:
35 ProcessParameter(
36 Main* main,
37 const char * const* addr,
38 const struct timespec* mtime,
39 const std::string& path,
40 unsigned int mode,
41 const PdServ::DataType& dtype,
42 size_t ndims = 1,
43 const size_t *dim = 0);
44
45 void print(std::ostream& os, size_t offset, size_t count) const;
46
47 private:
48 Main* const main;
49
50 const char* const* const valueBuf;
51 const struct timespec* const mtime;
52
53 mutable pthread::RWLock mutex;
54
55 // Reimplemented from PdServ::Parameter
56 int setValue(const PdServ::Session* session,
57 const char *buf, size_t offset, size_t count) const;
58
59 // Reimplemented from PdServ::Variable
60 int getValue(const PdServ::Session* session,
61 void *buf, struct timespec* t = 0) const;
62 };
63
64 }
65 #endif //PROCESSPARAMETER_H
66