Help - Search - Members - Calendar
Full Version: Beginner's help with list_base_t
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Development - (fb2k)
localhost127
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

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

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

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.
Frank Bicking
Use list_t instead of list_base_t:

CODE
pfc::list_t<t_playback_queue_item> queueContents;
localhost127
Ugh, such a simple fix.

Works great now, thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.