1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_core_oam_Handler_hpp
10 #define anna_core_oam_Handler_hpp
13 #include <anna/core/RuntimeException.hpp>
18 #include <anna/core/oam/defines.hpp>
31 * Class used to manage OAM events and registration over a OAM module
38 * Event for counters generated at the module provided. Base implementation trace the event based on #Module::getDefaultCounterDescription.
40 * Any re-implementation should invoke base class method.
42 * @param module Reference OAM module.
43 * @param type Counter enum-identification within the own context/module.
44 * @param amount Units increased.
46 * @return Boolean counter data for 'type' when registered, NULL if not found
48 virtual const counter_data_t *counterEvent(const Module *module, const int & type, const int & amount) const throw();
51 * Event for alarms generated at the module provided. Base implementation trace the event based on #Module::getDefaultAlarmDescription,
52 * replacing tags '__s__' and '__d__' by '<\%s>' and '<\%d>' (for texts and numbers) if they exists, and parsing with
53 * dynamic variables passed on activateAlarm()/cancelAlarm() prototypes.
55 * Any re-implementation should invoke base class method.
57 * @param module Reference OAM module.
58 * @param textPreffix Dynamic alarm modification regarding text preffix.
59 * @param textSuffix Dynamic alarm modification regarding text suffix.
60 * @param textSeparator Dynamic alarm modification regarding text sections separator.
61 * @param Activation activation/cancellation indicator.
62 * @param type Alarm enum-identification within the own context/module.
63 * @param argList Optional parsing data for dynamic-composed text.
65 * @return Boolean alarm data for 'type' when registered, NULL if not found
67 virtual const alarm_data_t *alarmEvent(const Module *module, const char *textPreffix, const char *textSuffix, char textSeparator, bool activation, const int & type, va_list argList) const throw();
84 * Invokes module counter registration procedure.
85 * Default implementation does nothing specific
87 * @param module Reference OAM module
88 * @see #anna::oam::Module::registerCounter
90 virtual void registerCounter(Module *module, const int &type, const std::string &description, const int &offset) throw(anna::RuntimeException) {;}
93 * Invokes module alarm registration procedure.
94 * Default implementation does nothing specific
96 * @param module Reference OAM module
97 * @see #anna::oam::Module::registerAlarm
99 virtual void registerAlarm(Module *module, const int &type, const std::string &description, const int &externalId, const std::string &dynamicVariablesCSL, const int &activationId, const int &cancellationId = -1) throw(anna::RuntimeException) {;}