GCC Code Coverage Report


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