-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaggregator.h
44 lines (36 loc) · 1.04 KB
/
aggregator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file aggregator.h
* @author Krzysztof Trzepla
* @copyright (C) 2016 ACK CYFRONET AGH
* @copyright This software is released under the MIT license cited in
* 'LICENSE.txt'
*/
#ifndef ONECLIENT_EVENTS_AGGREGATORS_AGGREGATOR_H
#define ONECLIENT_EVENTS_AGGREGATORS_AGGREGATOR_H
#include "events/declarations.h"
namespace one {
namespace client {
namespace events {
/**
* @c Aggregator class represents an abstract event stream layer responsible for
* homogeneous events aggregation. It provides an interface for concrete
* aggregators.
*/
template <class T> class Aggregator {
public:
virtual ~Aggregator() = default;
/**
* Aggregates an event.
* @param event An event to be aggregated.
*/
virtual void process(EventPtr<T> event) = 0;
/**
* Clears the container by returning aggregated events.
* @return A collection of aggregated events.
*/
virtual Events<T> flush() = 0;
};
} // namespace events
} // namespace client
} // namespace one
#endif // ONECLIENT_EVENTS_AGGREGATORS_AGGREGATOR_H