2 * Copyright (C) 2017 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup swima_events swima_events
18 * @{ @ingroup libimcv_swima
21 #ifndef SWIMA_EVENTS_H_
22 #define SWIMA_EVENTS_H_
24 #define SWIMA_MAX_ATTR_SIZE 10000000
26 #include "swima_event.h"
30 typedef struct swima_events_t swima_events_t
;
33 * Class managing list of Software [Identifier] Events
35 struct swima_events_t
{
40 * @param event Event to be added
42 void (*add
)(swima_events_t
*this, swima_event_t
*event
);
45 * Get the number of events in the event list
47 * @return Number of events
49 int (*get_count
)(swima_events_t
*this);
52 * Set both the Last and Last Consulted Event ID
54 * @param Last [Consulted] Event ID
55 * @param Epoch of event IDs
57 void (*set_eid
)(swima_events_t
*this, uint32_t eid
, uint32_t epoch
);
60 * Set Last Event ID if different from Last Consulted Event ID
62 * @param last_eid Last Event ID
64 void (*set_last_eid
)(swima_events_t
*this, uint32_t last_eid
);
67 * Get both the Last and Last Consulted Event ID
69 * @param eid_epoch Event ID Epoch
70 * @param last_eid Last Event ID
71 * @return Last Consulted Event ID
73 uint32_t (*get_eid
)(swima_events_t
*this, uint32_t *epoch
, uint32_t *last_eid
);
76 * Create an event enumerator
78 * @return Enumerator returning events
80 enumerator_t
* (*create_enumerator
)(swima_events_t
*this);
83 * Get a new reference to a swima_events object
85 * @return this, with an increased refcount
87 swima_events_t
* (*get_ref
)(swima_events_t
*this);
90 * Clears the events, keeping the eid and epoch values.
92 void (*clear
)(swima_events_t
*this);
95 * Destroys a swima_events_t object.
97 void (*destroy
)(swima_events_t
*this);
102 * Creates a swima_events_t object
104 swima_events_t
* swima_events_create(void);
106 #endif /** SWIMA_EVENTS_H_ @}*/