1: 
   2: 
   3: /*************
   4: *            *
   5: *  SENTINEL  *
   6: *            *
   7: *************/
   8: 
   9: 
  10: #ifndef WWWI_MIND_RRHEADER_H 
  11: #define WWWI_MIND_RRHEADER_H 
  12: 
  13: 
  14: /**********************
  15: *                     *
  16: *  COMPILER INCLUDES  *
  17: *                     *
  18: **********************/
  19: 
  20: 
  21: /*********************
  22: *                    *
  23: *  PROJECT INCLUDES  *
  24: *                    *
  25: *********************/
  26: 
  27: 
  28: #include "mind.h" 
  29: #include "labellist.h" 
  30: 
  31: 
  32: /**********************
  33: *                     *
  34: *  TYPE DECLARATIONS  *
  35: *                     *
  36: **********************/
  37: 
  38: 
  39: /*******************
  40: *                  *
  41: *  CLASS RRHEADER  *
  42: *                  *
  43: *******************/
  44: 
  45: 
  46: class RRHeader {
  47: public:
  48:                             RRHeader(void);
  49:   inline LabelListConstPtr  GetName(void) const;
  50:   inline unsigned           GetTTL(void) const;
  51:   inline void               SetTTL(unsigned i_uTTL);
  52:   inline void               SetName(LabelListPtr &i_llpr);
  53:                            ~RRHeader(void);
  54: 
  55: protected:
  56:   LabelListPtr   m_llpName;
  57:   unsigned       m_uTTL;
  58: };
  59: 
  60: 
  61: class CacheRRHeader {
  62: public:
  63:   inline time_t            GetExpire(void) const;
  64:   inline time_t            GetTTL(void) const;
  65:   inline time_t            GetTTL(time_t i_tmNow) const;
  66:   inline bool              IsExpired(time_t i_tmNow) const;
  67:   inline void              SetTTL(unsigned i_uTTL);
  68: 
  69: protected:
  70:   time_t         m_tmExpire;
  71: };
  72: 
  73: 
  74: /************************
  75: *                       *
  76: *  FUNCTION PROTOTYPES  *
  77: *                       *
  78: ************************/
  79: 
  80: 
  81: ostream& operator<<(ostream &io_smr, const CacheRRHeader &i_rrr);
  82: ostream& operator<<(ostream &io_smr, const CacheRRHeader *i_rrp);
  83: ostream& operator<<(ostream &io_smr, const RRHeader &i_rrr);
  84: ostream& operator<<(ostream &io_smr, const RRHeader *i_rrp);
  85: 
  86: 
  87: /*********************
  88: *                    *
  89: *  INLINE FUNCTIONS  *
  90: *                    *
  91: *********************/
  92: 
  93: 
  94: #include "rrheader.i" 
  95: 
  96: 
  97: /************
  98: *           *
  99: *  THE END  *
 100: *           *
 101: ************/
 102: 
 103: 
 104: #endif 
 105: 
 106: 
 107: