lookup_by_id


Description:

[ CCode ( cname = "dmap_db_lookup_by_id" ) ]
public abstract unowned DMAPRecord lookup_by_id (Db db, uint id)

Parameters:

this

A media database.

id

A record ID.

Returns:

the database record corresponding to id. This record should be unrefed by the calling code when no longer required.

If you are implementing a full database using this API, then you probably want to increment the reference count before returning a record pointer.

On the other hand, if you are implementing an adapter class and the records are stored elsewhere, then you will probably return a transient record. That is, once the user is done using it, the returned record should be free'd because it is a adapter copy of the real record. In this case, the reference count should not be incremented before returning a record pointer.




2022 vala-language.org