TUM-Logo

libRASCH

 

Home
 

General

About libRASCH/News
Design
Screen shots
Sample programs (with source code)
License
 

Download

libRASCH
Tools
 

Documentation

User
Developer
 

Resources

Mailing list
Supported Formats
Plugins
Status
Links
 
Contact
About this site
 
Last updated
Tue Mar 27 23:03:52 2007
libRASCH: ra_pl_comm.h Source File

ra_pl_comm.h

Go to the documentation of this file.
00001 
00010 /*----------------------------------------------------------------------------
00011  *
00012  * Copyright (C) 2002-2004, Raphael Schneider
00013  * See the file COPYING for information on usage and redistribution.
00014  *
00015  * $Header: /home/cvs_repos.bak/librasch/include/ra_pl_comm.h,v 1.5 2004/06/02 13:36:35 rasch Exp $
00016  *
00017  *--------------------------------------------------------------------------*/
00018 
00019 #ifndef _RA_PL_COMM_H
00020 #define _RA_PL_COMM_H
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 #include <ra.h>
00027 
00028 
00029 #define MAX_SIGNAL_NAME  250
00030 typedef void *dest_handle;
00031 
00038 struct slot_info
00039 {
00040         plugin_handle plugin;
00041         dest_handle dest;
00042 }; /* struct slot_info */
00043 
00044 
00045 /* FIXME: use hash to find signal */
00053 struct signal
00054 {
00055         char name[MAX_SIGNAL_NAME];
00056 
00057         int num_slots;
00058         struct slot_info *slot; /* variable-name 'slots' doesn't work with Qt */
00059 }; /* struct signal */
00060 
00061 
00068 struct plugin_comm
00069 {
00070         int num_signals;
00071         struct signal *sig;
00072 }; /* struct plugin_comm */
00073 
00074 
00075 #define PARA_CHAR                         0
00076 #define PARA_BYTE                         1
00077 #define PARA_SHORT                        2
00078 #define PARA_UNSIGNED_SHORT               3
00079 #define PARA_INT                          4
00080 #define PARA_UNSIGNED_INT                 5
00081 #define PARA_LONG                         6
00082 #define PARA_UNSIGNED_LONG                7
00083 #define PARA_FLOAT                        8
00084 #define PARA_DOUBLE                       9
00085 #define PARA_CHAR_POINTER                10
00086 #define PARA_BYTE_POINTER                11
00087 #define PARA_SHORT_POINTER               12
00088 #define PARA_UNSIGNED_SHORT_POINTER      13
00089 #define PARA_INT_POINTER                 14
00090 #define PARA_UNSIGNED_INT_POINTER        15
00091 #define PARA_LONG_POINTER                16
00092 #define PARA_UNSIGNED_LONG_POINTER       17
00093 #define PARA_FLOAT_POINTER               18
00094 #define PARA_DOUBLE_POINTER              19
00095 #define PARA_VOID_POINTER                20
00096 
00097 /* TODO: think if struct comm_para can be combined with struct ra_info or struct ra_info use
00098    this struct and if it's useful to add parameter description */
00099 struct comm_para
00100 {
00101         int type;               /* see defines PARA_* above */
00102         union
00103         {
00104                 char c;
00105                 unsigned char b;
00106                 short int sn;
00107                 unsigned short int usn;
00108                 int n;
00109                 unsigned int un;
00110                 long l;
00111                 unsigned long ul;
00112                 float f;
00113                 double d;
00114 
00115                 char *pc;
00116                 unsigned char *pb;
00117                 short int *psn;
00118                 unsigned short int *pusn;
00119                 int *pn;
00120                 unsigned int *pun;
00121                 long *pl;
00122                 unsigned long *pul;
00123                 float *pf;
00124                 double *pd;
00125                 void *pv;
00126         }
00127         v;
00128 }; /* struct comm_para */
00129 
00130 
00131 /* interface used by plugins */
00132 /* TODO: think about if these protoypes should be moved to ra.h */
00133 LIBRAAPI int ra_comm_add(meas_handle mh, plugin_handle p, dest_handle dh, const char *sig_name);
00134 LIBRAAPI void ra_comm_del(meas_handle mh, dest_handle dh, const char *sig_name);
00135 LIBRAAPI void ra_comm_emit(meas_handle mh, const char *sender, const char *sig_name, int num_para, struct comm_para *p);
00136 
00137 /* internal functions */
00138 struct signal *find_signal(struct plugin_comm *plc, const char *sig_name);
00139 struct signal *add_signal(struct plugin_comm *plc, const char *sig_name);
00140 int find_slot(struct signal *sig, dest_handle dh);
00141 
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145 
00146 #endif /* _RA_PL_COMM_H */

Generated on Fri May 27 11:32:39 2005 for libRASCH by  doxygen 1.4.2