00001 #ifndef PSANA_MPWORKERID_H 00002 #define PSANA_MPWORKERID_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: MPWorkerId.h 7702 2014-02-27 00:54:47Z salnikov@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class MPWorkerId. 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------- 00014 // C/C++ Headers -- 00015 //----------------- 00016 #include <sys/types.h> 00017 00018 //---------------------- 00019 // Base Class Headers -- 00020 //---------------------- 00021 00022 //------------------------------- 00023 // Collaborating Class Headers -- 00024 //------------------------------- 00025 00026 //------------------------------------ 00027 // Collaborating Class Declarations -- 00028 //------------------------------------ 00029 00030 // --------------------- 00031 // -- Class Interface -- 00032 // --------------------- 00033 00034 namespace psana { 00035 00036 /// @addtogroup psana 00037 00038 /** 00039 * @ingroup psana 00040 * 00041 * @brief Structure which describes worker process (from the master point of view). 00042 * 00043 * @note This software was developed for the LCLS project. If you use all or 00044 * part of it, please give an appropriate acknowledgment. 00045 * 00046 * @version $Id: MPWorkerId.h 7702 2014-02-27 00:54:47Z salnikov@SLAC.STANFORD.EDU $ 00047 * 00048 * @author Andy Salnikov 00049 */ 00050 00051 class MPWorkerId { 00052 public: 00053 00054 // constructors 00055 MPWorkerId () {} 00056 MPWorkerId (int workerId, pid_t pid, int fdDataPipe) 00057 : m_workerId(workerId), m_pid(pid), m_fdDataPipe(fdDataPipe) {} 00058 00059 /// Return worker identifier, small non-negative number 00060 int workerId() const { return m_workerId; } 00061 00062 /// Return worker PID 00063 pid_t pid() const { return m_pid; } 00064 00065 /// Return descriptor for master-side (write-only) end of data pipe. 00066 int fdDataPipe() const { return m_fdDataPipe; } 00067 00068 protected: 00069 00070 private: 00071 00072 int m_workerId; ///< worker identifier, small non-negative number 00073 pid_t m_pid; ///< worker PID 00074 int m_fdDataPipe; ///< descriptor for master-side (write-only) end of data pipe 00075 00076 }; 00077 00078 } // namespace psana 00079 00080 #endif // PSANA_MPWORKERID_H