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 >
Wrap
Text File
|
1994-05-19
|
2KB
|
82 lines
#include <sys/time.h>
#define MaxCharactersObjectValue 50
#define MaxCharactersObjectName 50
#define MaxHostName 50
#define MaxCharactersRuleName 50
#define Nlines 18
#define True 1
#define False 0
#define MIB_VALUE 0
#define MIB_VARIANCE 1
#define PROBLEM 2
#define EVENT 3
typedef char RuleNameType[MaxCharactersRuleName];
typedef char ObjectValueType[MaxCharactersObjectValue];
typedef char ObjectNameType[MaxCharactersObjectName];
class ObjectType{
private:
int IN_type; /*MIB_VALUE, MIB_VARIANCE, PROBLEM, EVENT*/
char IN_Name[MaxCharactersObjectName];
int IN_Known;
ObjectType *IN_Next;
/*object value*/
union {
struct{
int pre_value; /*the value of last record*/
int diff; /*the difference of last two record*/
struct timeval time_left; /*the time left we should poll again*/
struct timeval time_interval; /*the time interval we define for
this object*/
char Obj_Name[MaxCharactersObjectName]; /*object name of this
object */
char hostname[MaxHostName]; /*domain name or dot format name
of the host */
} VAR_VALUE;
char Prob_Value[MaxCharactersObjectValue]; /*true or False*/
char Event_Value[MaxCharactersObjectValue]; /*true or false*/
} IN_Value;
public:
void set_Name(char *Obj_Name);
void set_Value(char *Obj_Value);
void set_Known(int Know);
void set_Next(ObjectType *Next);
void set_Type(int t);
char *Name();
char *Value();
int Known();
ObjectType *Next();
int Type();
};
/*
class ObjectType{
private:
ObjectNameType IN_Name;
ObjectValueType IN_Value;
int IN_Known;
ObjectType *IN_Next;
public:
void set_Name(char *Obj_Name);
void set_Value(char *Obj_Value);
void set_Known(int Know);
void set_Next(ObjectType *Next);
char *Name();
char *Value();
int Known();
ObjectType *Next();
};
*/