rllib  1
Go to the documentation of this file.
1 /***************************************************************************
2  rldataprovider.h - description
3  -------------------
4  begin : Fri Dec 20 2002
5  copyright : (C) 2002 by R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 #ifndef _RL_DATA_PROVIDER_H_
17 #define _RL_DATA_PROVIDER_H_
19 #include "rldefine.h"
20 #include "rlsocket.h"
21 #include "rlthread.h"
22 #include "rlinterpreter.h"
30 {
31  public:
32  rlDataProvider(int numInteger, int numFloat=0, int numString=0);
33  virtual ~rlDataProvider();
34  int getInt (int id);
35  float getFloat (int id);
36  int getIntArray (int id, int *i, int nmax);
37  int getFloatArray (int id, float *f, int nmax);
38  const char *getString(int id);
39  int setInt (int id, int i);
40  int setFloat (int id, float f);
41  int setIntArray (int id, int *i, int num);
42  int setFloatArray (int id, float *f, int num);
43  int setString(int id, const char *str);
44  int getIntAndReset(int id);
45  int setIntAndWaitForReset(int id, int i);
46  int setInt0Semaphore(int i);
47  int getInt0Semaphore();
48  int run(rlSocket *socket);
49  private:
50  typedef char* CHARPTR;
51  int *ints;
52  float *floats;
53  char **strings;
57 };
63 {
64  public:
66  virtual ~rlDataProviderClient();
67  int getInt (rlSocket *socket, int id, int *status);
68  float getFloat (rlSocket *socket, int id, int *status);
69  int getIntArray (rlSocket *socket, int id, int *array, int nmax);
70  int getFloatArray (rlSocket *socket, int id, float *array, int nmax);
71  const char *getString (rlSocket *socket, int id, int *status);
72  int setInt (rlSocket *socket, int id, int i);
73  int setFloat (rlSocket *socket, int id, float f);
74  int setIntArray (rlSocket *socket, int id, int *i, int num);
75  int setFloatArray (rlSocket *socket, int id, float *f, int num);
76  int setString (rlSocket *socket, int id, const char *str);
77  int getIntAndReset (rlSocket *socket, int id, int *status);
78  int setIntAndWaitForReset(rlSocket *socket, int id, int i);
79  int getInt0Semaphore (rlSocket *socket, int *status);
80  private:
83 };
90 {
91  public:
92  rlDataProviderThreads(int Port, rlDataProvider *Provider);
93  virtual ~rlDataProviderThreads();
94  void start();
97  int port;
98 };
100 #endif
int setFloat(int id, float f)
int getFloatArray(rlSocket *socket, int id, float *array, int nmax)
rlSemaphore int0semaphore
#define rl_PRINTF_LENGTH
Definition: rldefine.h:71
int getIntAndReset(int id)
const char * getString(rlSocket *socket, int id, int *status)
float getFloat(int id)
char cret[rl_PRINTF_LENGTH]
const char * getString(int id)
int setString(int id, const char *str)
int getInt(int id)
int run(rlSocket *socket)
rlDataProviderThreads(int Port, rlDataProvider *Provider)
int setInt(rlSocket *socket, int id, int i)
int setIntArray(rlSocket *socket, int id, int *i, int num)
virtual ~rlDataProvider()
int setIntAndWaitForReset(rlSocket *socket, int id, int i)
int getInt(rlSocket *socket, int id, int *status)
rlInterpreter interpreter
int setString(rlSocket *socket, int id, const char *str)
int setInt0Semaphore(int i)
int getIntArray(rlSocket *socket, int id, int *array, int nmax)
int getInt0Semaphore(rlSocket *socket, int *status)
float getFloat(rlSocket *socket, int id, int *status)
rlDataProvider * provider
int setIntAndWaitForReset(int id, int i)
int setFloat(rlSocket *socket, int id, float f)
int setFloatArray(int id, float *f, int num)
int setIntArray(int id, int *i, int num)
int setInt(int id, int i)
int getFloatArray(int id, float *f, int nmax)
int getIntArray(int id, int *i, int nmax)
int getIntAndReset(rlSocket *socket, int id, int *status)
rlDataProvider(int numInteger, int numFloat=0, int numString=0)
int setFloatArray(rlSocket *socket, int id, float *f, int num)