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_event swima_event
18 * @{ @ingroup libimcv_swima
21 #ifndef SWIMA_EVENT_H_
22 #define SWIMA_EVENT_H_
24 #include "swima_record.h"
28 #define SWIMA_EVENT_ACTION_CREATION 1
29 #define SWIMA_EVENT_ACTION_DELETION 2
30 #define SWIMA_EVENT_ACTION_ALTERATION 3
31 #define SWIMA_EVENT_ACTION_LAST 3
33 typedef struct swima_event_t swima_event_t
;
36 * Class storing a Software [Identifier] event
38 struct swima_event_t
{
41 * Get Event ID and optionally the associated timestamp
43 * @param timestamp Timestamp associated with Event
46 uint32_t (*get_eid
)(swima_event_t
*this, chunk_t
*timestamp
);
49 * Get Action associated with Event
51 * @return Action associated with event
53 uint8_t (*get_action
)(swima_event_t
*this);
56 * Get Software [Identifier] record
58 * @return Software [Identifier] record
60 swima_record_t
* (*get_sw_record
)(swima_event_t
*this);
63 * Get a new reference to a swima_event object
65 * @return this, with an increased refcount
67 swima_event_t
* (*get_ref
)(swima_event_t
*this);
70 * Destroys a swima_event_t object.
72 void (*destroy
)(swima_event_t
*this);
77 * Creates a swima_event_t object
80 * @param timestamp Time of Event
81 * @param action Action (CREATION, DELETION, ALTERATION)
82 * @param sw_record Software [Identifier] record
84 swima_event_t
* swima_event_create(uint32_t eid
, chunk_t timestamp
,
85 uint8_t action
, swima_record_t
*sw_record
);
87 #endif /** SWIMA_EVENT_H_ @}*/