Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

SMcommon.h

Go to the documentation of this file.
00001 #ifndef __SMCOMMON_H__
00002 #define __SMCOMMON_H__
00003 
00004 #include <stdio.h>
00005 #include <stdlib.h>
00006 #include <unistd.h>
00007 #include <sys/types.h>
00008 #include <sys/ipc.h>
00009 #include <sys/shm.h>
00010 #include <sys/msg.h>
00011 
00012 //#include "TH1D"
00013 #include "../header.hh"
00014 
00015 //#define KEYFILE_PATH "../../../jikken3/DataTaking/viewer"
00016 #define KEYFILE_PATH "/daq/DAQ/lifetime/CounterTest/CounterDAQ"
00017 #define PROJ_CHAR    (char)'r'
00018 #define FIN (int)6
00019 #define PAUSE (int)16
00020 #define RESTART (int)18
00021 
00022 struct SHM_PARAM{
00023   int shd_param_id;
00024   int status;
00025   int ctrl;
00026   char StartTime[150];
00027   //  char *filename;
00028   //  char filename2[100];
00029   int nEvent;
00030   int nOverFlow;
00031   int Hist[250];
00032 };
00033 
00034 class SharedMemory{
00035  private:
00036 //  int shd_param_id;
00037 //  struct SHM_PARAM *param_ptr;
00038 //  double *data_ptr;
00039 //  key_t key;
00040  public:
00041   SharedMemory();//{std::cout<<"SharedMemory_Constructor"<<std::endl;}
00042   int shm_initialize(key_t shm_key, int shm_size,int *shrd_id,int *shm_ptr);
00043   int shm_access(key_t shm_key, int shm_size, int *shrd_id, int *shm_ptr);
00044   int erase_shm(struct SHM_PARAM *param_ptr);
00045   //  SHM_PARAM GetPtr(){return *param_ptr;}
00046 };
00047 
00048 #endif /*  __SMCOMMON_H__ */

Generated on Sun Dec 14 23:32:46 2008 by doxygen 1.3.5