4 * @brief Interface policy_store_t.
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #ifndef POLICY_STORE_H_
24 #define POLICY_STORE_H_
27 #include <config/policies/policy.h>
30 typedef struct policy_store_t policy_store_t
;
33 * @brief The interface for a store of policy_t's.
40 struct policy_store_t
{
43 * @brief Returns a policy identified by two IDs.
45 * The returned policy gets created/cloned and therefore must be
46 * destroyed by the caller.
48 * @param this calling object
49 * @param my_id own ID of the policy
50 * @param other_id others ID of the policy
52 * - matching policy_t, if found
55 policy_t
*(*get_policy
) (policy_store_t
*this, identification_t
*my_id
, identification_t
*other_id
);
58 * @brief Add a policy to the list.
60 * The policy is owned by the store after the call. Do
61 * not modify nor free.
63 * @param this calling object
64 * @param policy policy to add
66 void (*add_policy
) (policy_store_t
*this, policy_t
*policy
);
69 * @brief Destroys a policy_store_t object.
71 * @param this calling object
73 void (*destroy
) (policy_store_t
*this);
76 #endif /*POLICY_STORE_H_*/