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