2 * Copyright (C) 2011 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 pts_database pts_database
21 #ifndef PTS_DATABASE_H_
22 #define PTS_DATABASE_H_
24 typedef struct pts_database_t pts_database_t
;
26 #include "pts_meas_algo.h"
30 * Class implementing the PTS File Measurement database
33 struct pts_database_t
{
36 * Get files to be measured by PTS
38 * @product software product (os, vpn client, etc.)
39 * @return enumerator over all files matching a given release
41 enumerator_t
* (*create_file_enumerator
)(pts_database_t
*this, char *product
);
44 * Get Hash measurement of a file with given id and hashing algorithm type
46 * @product software product (os, vpn client, etc.)
47 * @id primary key in files table
48 * @algorithm measurement algorithm type
49 * @return enumerator over all measurements matching a given release
51 enumerator_t
* (*create_meas_enumerator
)(pts_database_t
*this, char *product
, int id
, pts_meas_algorithms_t algorithm
);
54 * Destroys a pts_database_t object.
56 void (*destroy
)(pts_database_t
*this);
61 * Creates an pts_database_t object
63 * @param ur database uri
65 pts_database_t
* pts_database_create(char *uri
);
67 #endif /** PTS_DATABASE_H_ @}*/