GCC Code Coverage Report


Directory: ./
File: pdserv/src/msrproto/Parameter.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 MSRPARAMETER_H
25 #define MSRPARAMETER_H
26
27 #include "Variable.h"
28
29 namespace PdServ {
30 class Parameter;
31 class DataType;
32 }
33
34 namespace MsrProto {
35
36 class Session;
37 class XmlElement;
38
39 4928 class Parameter: public Variable {
40 public:
41 Parameter(const PdServ::Parameter *p, size_t index,
42 const PdServ::DataType& dtype,
43 const PdServ::DataType::DimType& dim,
44 size_t offset, Parameter* parent);
45
46 void setXmlAttributes(XmlElement&, const char *buf,
47 struct timespec const& ts,
48 bool shortReply, bool hex, bool derived,
49 std::streamsize precision) const;
50
51 bool inform(Session* session, size_t begin, size_t end,
52 const char* data, const struct timespec* time) const;
53 void addChild(const Parameter* child);
54
55 int setHexValue(const Session *,
56 const char *str, size_t startindex) const;
57 int setDoubleValue(const Session *,
58 const char *, size_t startindex) const;
59
60 const PdServ::Parameter * const mainParam;
61 bool persistent;
62
63 private:
64 const bool dependent;
65
66 int setElements(std::istream& is,
67 const PdServ::DataType& dtype,
68 const PdServ::DataType::DimType& dim,
69 char *&buf, size_t& count) const;
70
71 typedef std::list<const Parameter*> List;
72 List children;
73 };
74
75 }
76
77 #endif //MSRPARAMETER_H
78