Merge tag 'v9.0.0-rc3'
[qemu/ar7.git] / include / hw / core / resetcontainer.h
blob23db0c7a880619f2e644a1bc6aa706731fae54c7
1 /*
2 * Reset container
4 * Copyright (c) 2024 Linaro, Ltd
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
10 #ifndef HW_RESETCONTAINER_H
11 #define HW_RESETCONTAINER_H
14 * The "reset container" is an object which implements the Resettable
15 * interface. It contains a list of arbitrary other objects which also
16 * implement Resettable. Resetting the reset container resets all the
17 * objects in it.
20 #include "qom/object.h"
22 #define TYPE_RESETTABLE_CONTAINER "resettable-container"
23 OBJECT_DECLARE_TYPE(ResettableContainer, ResettableContainerClass, RESETTABLE_CONTAINER)
25 /**
26 * resettable_container_add: Add a resettable object to the container
27 * @rc: container
28 * @obj: object to add to the container
30 * Add @obj to the ResettableContainer @rc. @obj must implement the
31 * Resettable interface.
33 * When @rc is reset, it will reset every object that has been added
34 * to it, in the order they were added.
36 void resettable_container_add(ResettableContainer *rc, Object *obj);
38 /**
39 * resettable_container_remove: Remove an object from the container
40 * @rc: container
41 * @obj: object to remove from the container
43 * Remove @obj from the ResettableContainer @rc. @obj must have been
44 * previously added to this container.
46 void resettable_container_remove(ResettableContainer *rc, Object *obj);
48 #endif