home *** CD-ROM | disk | FTP | other *** search
/ ftp.umcs.maine.edu / 2015-02-07.ftp.umcs.maine.edu.tar / ftp.umcs.maine.edu / pub / thesis / zhongy / rule / object.h_back2 < prev    next >
Text File  |  1994-05-19  |  2KB  |  82 lines

  1. #include <sys/time.h>
  2.  
  3. #define MaxCharactersObjectValue 50
  4. #define MaxCharactersObjectName 50
  5. #define MaxHostName 50
  6. #define MaxCharactersRuleName 50
  7. #define Nlines 18
  8. #define True 1
  9. #define False 0
  10.  
  11. #define MIB_VALUE 0
  12. #define MIB_VARIANCE 1
  13. #define PROBLEM 2
  14. #define EVENT 3
  15.  
  16. typedef char RuleNameType[MaxCharactersRuleName];
  17. typedef char ObjectValueType[MaxCharactersObjectValue];
  18. typedef char ObjectNameType[MaxCharactersObjectName];
  19.  
  20.  
  21. class ObjectType{
  22.         private:
  23.           int IN_type; /*MIB_VALUE, MIB_VARIANCE, PROBLEM, EVENT*/
  24.           char IN_Name[MaxCharactersObjectName];
  25.           int IN_Known;
  26.           ObjectType *IN_Next;
  27.  
  28.           /*object value*/
  29.           union {
  30.  
  31.             struct{
  32.               int pre_value;         /*the value of last record*/
  33.               int diff;              /*the difference of last two record*/
  34.               struct timeval time_left; /*the time left we should poll again*/
  35.               struct timeval time_interval; /*the time interval we define for 
  36.                                      this object*/
  37.               char Obj_Name[MaxCharactersObjectName]; /*object name of this 
  38.                                       object */ 
  39.               char hostname[MaxHostName];    /*domain name or dot format name
  40.                                               of the host */
  41.               } VAR_VALUE;
  42.             
  43.              char Prob_Value[MaxCharactersObjectValue];  /*true or False*/
  44.           
  45.              char Event_Value[MaxCharactersObjectValue]; /*true or false*/
  46.  
  47.              } IN_Value;
  48.  
  49.         public:
  50.            void set_Name(char *Obj_Name);
  51.            void set_Value(char *Obj_Value);
  52.            void set_Known(int Know);
  53.            void set_Next(ObjectType *Next);
  54.            void set_Type(int t);
  55.            char *Name();
  56.            char *Value();
  57.            int Known();
  58.            ObjectType *Next();
  59.            int Type();
  60.         };
  61.  
  62.  
  63. /*
  64. class ObjectType{
  65.         private:
  66.            ObjectNameType IN_Name;
  67.            ObjectValueType IN_Value;
  68.            int IN_Known;
  69.            ObjectType *IN_Next;
  70.         public:
  71.            void set_Name(char *Obj_Name);
  72.            void set_Value(char *Obj_Value);
  73.            void set_Known(int Know);
  74.            void set_Next(ObjectType *Next);
  75.            char *Name();
  76.            char *Value();
  77.            int Known();
  78.            ObjectType *Next();
  79.         };
  80. */
  81.  
  82.