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