This is the Alarm System implementation for Lab 2 of Media Processing course.
Build libraries project in src
and install it by running make install
in
build directory. Afterwards test project can be built and run.
Following diagram represents the model of the system divided into packages. Each package reprsesents separate module.
Doxygen generated documentation is available in docs/html/index.html
AlarmSensors group is located in alarm-sensor
directory and includes sensor classes, i.e.
AbstractSensor
class, which defines common
attributes and operations and its different
implementation, for instance, SmokeSensor
class.
Whenever new sensor class is created it is sufficient
that this class should be inherited from
AbstractSensor
class, and update()
function should
be defined.
Here is the class diagram of AlarmSensors package:
AlarmComposite group is an implementation of
composite pattern. It is located in
alarm-composite
directory. It includes base
component class AlarmComponent
and its successor
class AlarmComponentGroup
. Leaf implementation
AbstractSensor
is a part of AlarmSensors group.
Here is the class diagram of AlarmComposite package:
AlarmObserver group is located in
alarm-observer
. It includes AlarmObservable
class,
which is a base for any actual implementation of
observable objects. There are two major differences between Observer and
Strategy. Firstly, Observer can handle a message coming from Observable,
when Strategy can only be activated/deactivated by strategy owner.
Besides, Observer passes the message to its parent, allowing to notify the
Observer of the complete Component group. Observer is implemented in
AlarmObserver
class. In order to create new alarm observer, one must inherit
it from AlarmObserver
base class and optionally redefine handle
function.
Here is the class diagram of AlarmObserver package:
AlarmStrategies group is located in
alarm-strategy
. It includes AlarmStrategy
class,
which is a base for any actual implementation of
strategy. Context is implemented in
AlarmStrategyOwner
class. In order to create new
alarm strategy, one must inherit it from
AlarmStrategy
base class.
Here is the class diagram of AlarmStrategies package:
- Implement Composite structure (classes AlarmComponent, AlarmComponentGroup)
- Implement Strategy structure ( classes AlarmStrategy and AlarmStrategyOwner)
- Implement AlarmSensor class
- Implement AlarmStrategy successors
- Implement AlarmSensor successors
- Implement SmokeSensor
- Implement MotionSensor
- Implement ToxicSensor
- Create documentation
- Reorganize project structure
- Implement operators
- Implement operator++
- Implement operator--
- Implement operator<< for each type of sensor
- Add activation flag to AlarmComponent and activation counter to AlarmStrategy
- Parent attribute for AlarmComponent
- Implement Observer structure
- Sorting and search algorithms
- Add model to the project
- Move sources to separate folder