VrTypes.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
#ifndef _VRTYPES_H_
00038
#define _VRTYPES_H_
00039
00040
extern "C" {
00041
#include <stdio.h>
00042
#include <stdlib.h>
00043
#include <unistd.h>
00044
#include <sys/types.h>
00045
#include <sys/stat.h>
00046
#include <sys/time.h>
00047
#include <errno.h>
00048
#include <signal.h>
00049
#include <string.h>
00050
#include <assert.h>
00051
#ifdef THREADS
00052
#include<pthread.h>
00053
#endif
00054
}
00055
#include <VrComplex.h>
00056
#include <VrCycleCount.h>
00057
#include <iostream>
00058
using std::cout;
00059
using std::cerr;
00060
using std::cin;
00061
using std::endl;
00062
00063
class VrSigProc;
00064
00065
#ifdef THREADS
00066
#define MUTEX_DECLARE(A) pthread_mutex_t A;
00067
#define MUTEX_INIT(M) do { if (pthread_mutex_init(M, 0) != 0) abort (); } while (0)
00068
#define MUTEX_LOCK(M) pthread_mutex_lock(M)
00069
#define MUTEX_UNLOCK(M) pthread_mutex_unlock(M)
00070
#define THREAD_GETSPECIFIC(A) pthread_getspecific(A)
00071
extern pthread_key_t startMarkedModule;
00072
00073
#define YIELD() {usleep(1);}
00074
00075
#else
00076
00077 #define MUTEX_DECLARE(A)
00078 #define MUTEX_INIT(M) do {} while (0)
00079 #define MUTEX_LOCK(M) do {} while (0)
00080 #define MUTEX_UNLOCK(M) do {} while (0)
00081 #define THREAD_GETSPECIFIC(A) (A)
00082
extern VrSigProc *
startMarkedModule;
00083 #define YIELD() {usleep(1);}
00084
00085
#endif
00086
00087 typedef unsigned int port;
00088
00089
enum {
VR_NULL,
VR_CHAR,
VR_UCHAR,
VR_SHORT,
VR_INT,
VR_FLOAT,
VR_COMPLEX,
00090
VR_FRAME,
VR_IPPACKET};
00091
00092 class VrNullData {
00093 int tmp;
00094
public:
00095 VrNullData() {}
00096 VrNullData(
int x) :
tmp(x) {}
00097 };
00098
00099 typedef char bit;
00100 typedef VrComplex complex;
00101 typedef unsigned char uchar;
00102 typedef unsigned long long VrSampleIndex;
00103 typedef struct {
00104 VrSampleIndex index;
00105 unsigned long size;
00106 }
VrSampleRange;
00107
00108 inline int is_complex(
VrComplex x) {
return 1;}
00109 inline int is_complex(
float x) {
return 0;}
00110 inline int is_complex(
double x) {
return 0;}
00111 inline int is_complex(
int x) {
return 0;}
00112 inline int is_complex(
char x) {
return 0;}
00113 inline int is_complex(
short x) {
return 0;}
00114
#endif
Generated on Wed Aug 4 02:22:06 2004 for GNU Radio by
1.3.8