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.
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
20 #include "qom/object.h"
22 #define TYPE_RESETTABLE_CONTAINER "resettable-container"
23 OBJECT_DECLARE_TYPE(ResettableContainer
, ResettableContainerClass
, RESETTABLE_CONTAINER
)
26 * resettable_container_add: Add a resettable object to the 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
);
39 * resettable_container_remove: Remove an object from the 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
);