lsmp/lsmp_con.hh

00001 /* -*- mode: c++; c-basic-offset: 4; -*- */
00002 //
00003 //   LSMP is the Ligo Shared Memory Partition object class
00004 //
00005 #ifndef LSMP_CON_HH
00006 #define LSMP_CON_HH
00007 
00008 #include "lsmp.hh"
00009 
00010 // #define COLDREAD
00011 
00022 class LSMP_CON : public LSMP {
00023 
00024   //------------------------------------  Public data and methods
00025   public:
00030     LSMP_CON(void);
00031 
00044     LSMP_CON(const char *part, int nbuf=0, int mask=-1);
00045 
00051     ~LSMP_CON(void);
00052 
00057     const char* getBuffAddr(void) const;
00058 
00063     eventid_type getEvtID(void) const;
00064 
00069     int getLength(void) const;
00070 
00074     int getMask(void) const;
00075 
00079     int getNBuffer(void) const;
00080 
00085     int getNSkip(void) const;
00086 
00092     bool isConnected(void) const;
00093 
00099     bool latest_buffer(void) const;
00100 
00105     bool operator!(void) const;
00106 
00117     void setNBuffer(int nbuf);
00118 
00127     void setNSkip(int nskip);
00128 
00140     const char* get_buffer(int flags=0);
00141 
00149     const char* find_dataID(eventid_type ID);
00150 
00155     bool free_buffer();
00156 
00157   private:
00158     //------------------------------------  Private methods
00166     void get_consumer(int nbuf, int mask);
00167 
00171     int  free_consumer(void);
00172 
00176     int  get_by_ID(eventid_type dataID);
00177 
00178     //------------------------------------  Private data members.
00183     int icon;
00184 
00188     int ibuf;
00189 };
00190 
00191 //--------------------------------------  Inline functions
00192 inline const char* 
00193 LSMP_CON::getBuffAddr(void) const {
00194     return buffer_addr(ibuf);
00195 }
00196 
00197 inline int 
00198 LSMP_CON::getLength(void) const {
00199     return buffer_length(ibuf);
00200 }
00201 
00202 inline bool
00203 LSMP_CON::isConnected(void) const {
00204     return (valid() && icon >= 0);
00205 }
00206 
00207 inline bool
00208 LSMP_CON::operator!(void) const {
00209     return (!valid() || icon < 0);
00210 }
00211 
00212 #endif  // LSMP_CON_HH

Generated on Sun Mar 8 19:20:51 2009 for dmt by  doxygen 1.5.4