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 LIB_PARAMETER |
25 |
|
|
#define LIB_PARAMETER |
26 |
|
|
|
27 |
|
|
#include "../ProcessParameter.h" |
28 |
|
|
#include "pdserv.h" |
29 |
|
|
|
30 |
|
|
class Main; |
31 |
|
|
class Signal; |
32 |
|
|
class Persistent; |
33 |
|
|
|
34 |
|
1884 |
class Parameter: public PdServ::ProcessParameter { |
35 |
|
|
public: |
36 |
|
|
Parameter ( Main* main, |
37 |
|
|
void *addr, |
38 |
|
|
const char *path, |
39 |
|
|
unsigned int mode, |
40 |
|
|
const PdServ::DataType& dtype, |
41 |
|
|
size_t ndims = 1, |
42 |
|
|
const size_t *dim = 0); |
43 |
|
|
|
44 |
|
|
// Address in RT task (not accessible from NRT) |
45 |
|
|
char* const addr; |
46 |
|
|
|
47 |
|
|
char* shmAddr; // Address in shared memory |
48 |
|
|
mutable struct timespec mtime; |
49 |
|
|
|
50 |
|
|
write_parameter_t write_cb; |
51 |
|
|
void* priv_data; |
52 |
|
|
|
53 |
|
|
int setValue(size_t offset, size_t len, struct timespec* mtime) const; |
54 |
|
|
|
55 |
|
|
private: |
56 |
|
|
Main* const main; |
57 |
|
|
|
58 |
|
|
// A default function used when paramcheck or paramupdate are not |
59 |
|
|
// specified by the user |
60 |
|
|
static int copy(const struct pdvariable *parameter, |
61 |
|
|
void *dst, const void *src, size_t len, |
62 |
|
|
struct timespec* time, void *priv_data); |
63 |
|
|
}; |
64 |
|
|
|
65 |
|
|
#endif //LIB_PARAMETER |
66 |
|
|
|