summaryrefslogtreecommitdiff
path: root/polux/application/agent/inc/AlarmObjectModel.h
diff options
context:
space:
mode:
Diffstat (limited to 'polux/application/agent/inc/AlarmObjectModel.h')
-rwxr-xr-xpolux/application/agent/inc/AlarmObjectModel.h155
1 files changed, 155 insertions, 0 deletions
diff --git a/polux/application/agent/inc/AlarmObjectModel.h b/polux/application/agent/inc/AlarmObjectModel.h
new file mode 100755
index 0000000000..f693630d83
--- /dev/null
+++ b/polux/application/agent/inc/AlarmObjectModel.h
@@ -0,0 +1,155 @@
+/*
+ ****************************************************************************
+ * PROGRAM MODULE
+ *
+ * $Workfile: systemmanager.h $
+ * $Author: antunes $
+ * $Date: 2006/02/10 08:21:50 $
+ *
+ * Copyright (C) 2003 by SPiDCOM Technologies All rights reserved.
+ *
+ ****************************************************************************
+ */
+
+#ifndef __ALARM_OBJECT_MODEL__
+#define __ALARM_OBJECT_MODEL__
+
+
+
+#include "agent_pp/mib.h"
+#define FIELD_MAX_SIZE 60
+
+
+/**
+* Alarm Object Model
+*
+*/
+class AlarmObjectModel
+
+{
+public:
+
+
+ /**
+ * Define an enum to define event Type
+ */
+ enum eventType {
+ other = 1,
+ communicationAlarm = 2,
+ maxAttenuationAlarm = 3,
+ maxNoiseAlarm = 4,
+ equipmentAlarm = 5,
+ environmentalAlarm = 6,
+ userDefinedAlarm = 7
+ };
+
+
+ /**
+ * Define an enum to qualify the alarm status
+ */
+ enum alarmStatus {
+ active = 1,
+ clear = 2,
+ terminate = 3
+ };
+
+
+
+ // Attributes
+
+private:
+
+ char* m_managedObject;
+ long m_probableCause;
+ char* m_description;
+ eventType m_eventType;
+ alarmStatus m_alarmStatus;
+ unsigned long m_eventTime;
+ unsigned long m_alarmId;
+
+
+ // Copy constructor (char* => malloc for the copy) => copy constructor private
+ AlarmObjectModel(const AlarmObjectModel&){};
+
+
+
+
+public:
+
+
+ void print() const;
+
+
+ virtual ~AlarmObjectModel();
+
+ //AlarmObjectModel();
+
+ AlarmObjectModel( char* iManagedObject,
+ int iProbableCause,
+ eventType iEventType,
+ unsigned long iAlarmId,
+ alarmStatus iAlarmStatus,
+ unsigned long iEventTime,
+ char* iDescription);
+
+
+
+ // Getters/setters per attribute
+ char* getManagedObject();
+ const char* getManagedObject() const;
+ void setManagedObject(char* iManagedObject);
+
+
+ int getProbableCause();
+ const int getProbableCause() const;
+ void setProbableCause(int iProbableCause);
+
+
+ const char* getDescription() const;
+ char* getDescription();
+ void setDescription(char* iDescription);
+
+
+ enum eventType getEventType();
+ const eventType& getEventType() const;
+ void setEventType(eventType& iEventType);
+
+ const AlarmObjectModel::alarmStatus& AlarmObjectModel::getAlarmStatus() const;
+ enum alarmStatus getAlarmStatus();
+ void setAlarmStatus(const alarmStatus& iAlarmStatus);
+ bool isAlarmActive() const;
+
+
+ unsigned long getEventTime();
+ const unsigned long& getEventTime() const;
+ void setEventTime(long unsigned iEventTime);
+
+
+ unsigned long getAlarmId();
+ const unsigned long getAlarmId() const;
+ void setAlarmId(unsigned long icount);
+
+
+
+ AlarmObjectModel* clone();
+
+ // redefinition of operators to classify the alarms
+ // An alarm is uniquely defined per:
+ // its m_eventType
+ // its m_probableCause
+ // its m_managedObject
+ // its m_description
+
+ bool operator > (const AlarmObjectModel& iAlarmToCompare) const;
+ bool operator == (const AlarmObjectModel& iAlarmToCompare) const;
+ bool operator < (const AlarmObjectModel& iAlarmToCompare) const;
+
+
+};
+
+
+
+
+#endif //__ALARM_OBJECT_MODEL__
+
+