LinuxShMem.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
00035
00039
00041
00042
00043 #ifndef __LINUX_SH_MEM_UDP_
00044 #define __LINUX_SH_MEM_UDP_
00045
00046 #include <stdlib.h>
00047 #include <stdio.h>
00048 #include <sys/types.h>
00049 #include <sys/ipc.h>
00050 #include <sys/shm.h>
00051 #include <semaphore.h>
00052 #include <ctype.h>
00053 #include <string.h>
00054
00055 #include <baselib.h>
00056
00057 struct ShMemSegment{
00058 char testString[10];
00059 int wrappLoopbacks[255];
00060 };
00061
00062 class LinuxShMem : public MIPObject{
00063 private:
00064 int _shmid;
00065 ShMemSegment *_segptr;
00066
00067
00068
00069 stringstream _ssfatal;
00070
00071 void _init();
00072
00073 void _usage();
00074 void _write(char *text);
00075 void _changemode(char *mode);
00076 void _read();
00077
00078 public:
00080 LinuxShMem(int argc, char *argv[]);
00081
00083 LinuxShMem();
00084
00086 ~LinuxShMem();
00087
00089 void remove();
00090
00091
00092
00093
00094
00095
00096 void regWrappLoopback(int loopback);
00097 int getWrappLoopback(int index);
00098 void resetWrappLoopback();
00099
00100 string getObjectName() const {
00101 return string("LShMem");
00102 }
00103 };
00104
00105
00106
00107 #endif
00108
00109
00110
00111