Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Beginner's help with list_base_t (Read 2862 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Beginner's help with list_base_t

Hello,

I am working on a component that interacts with the playback queue, but i am having issues retrieving the list of queued items.

I am using the provided function in playlist.h:

Code: [Select]
virtual void queue_get_contents(pfc::list_base_t<t_playback_queue_item> & p_out) = 0;


Here is the code that i have, however it gives errors:
Code: [Select]
static_api_ptr_t<playlist_manager> api;
text << "Current queue size:   " << api->queue_get_count();

pfc::list_base_t<t_playback_queue_item> queueContents;
api->queue_get_contents(queueContents);


The first two lines of the code work fine, but the third line gives me the error.

The problem is, it appears list_base_t is an abstract class so i cannot directly instantiate it.  I did find list_impl_t but that takes two template parameters, and i am not sure what to use for the second one (t_storage).

Actual error message:

Code: [Select]
error C2259: 'pfc::list_base_t<T>' : cannot instantiate abstract class


It then goes on to list every member of list_base_const_t that is virtual.

Any ideas or suggestions are appreciated.  Thanks.

Beginner's help with list_base_t

Reply #1
Use list_t instead of list_base_t:

Code: [Select]
pfc::list_t<t_playback_queue_item> queueContents;

 

Beginner's help with list_base_t

Reply #2
Ugh, such a simple fix.

Works great now, thanks