add_with_user_data


Description:

[ Version ( since = "3.58" ) ]
public void add_with_user_data (Client client, Component comp, void* user_data, BoxedCopyFunc? copy_user_data, BoxedFreeFunc? free_user_data)

Adds a component into the bag.

It's possible to add the same component from the same client multiple times, in which case any previous occurrence is removed.

The component is identified by the client and its uid/rid.

The function also sets the user data member of a newly created ComponentBagItem. The user_data is replaced in an existing item only if it's set (non-null), otherwise it's left unchanged. See set_user_data for more information.

Parameters:

this

an ComponentBag

client

an Client

comp

an Component

user_data

custom user data, or null

copy_user_data

a copy function for the user_data, or null

free_user_data

a free function for the user_data, or null