Skip to main content
Topic: metadb_index_client questions (Read 175 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

metadb_index_client questions

Hey there!
I'm trying to to implement custom metadb_index_client, but for some reason `metadb_index_manager::get()->add();` fails with invalid argument exception during it's initialization.

The code was mostly (99.99%) copy-pasted from marc2003's foo_jscript_panel (which does not share this problem). The only thing that was changed is GUID for the metadb_index_client to avoid possible collision.
The code in question: https://github.com/TheQwertiest/foo-jscript-panel/blob/master/foo_spider_monkey_panel/stats.h#L46

Any help would be greatly appreciated!

... summons @Peter ...

Re: metadb_index_client questions

Reply #1
init_stages::before_config_read seems awfully early in the process for most services to be available.
The definition of objects with static storage duration in your stats.h seems a bit sketchy as you include that header in multiple translation units and as such, have duplicate registrations of objects.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

Re: metadb_index_client questions

Reply #2
init_stages::before_config_read seems awfully early in the process for most services to be available.
Welp, the code is mostly identical to the official sample:
https://github.com/zao/foo_wave_seekbar/blob/9138c3a79f3a7ed55a6bc6f915c40742a0372631/foobar2000/foo_sample/rating.cpp#L92

Do you know if there is a better example?

The definition of objects with static storage duration in your stats.h seems a bit sketchy as you include that header in multiple translation units and as such, have duplicate registrations of objects.
Yes, this is most likely the cause, thanks!

Re: metadb_index_client questions

Reply #3
Ah, didn't know that was taken directly from foo_sample.
Note that my foo_wave_seekbar repository may not be up to date with the current SDK, but it's assumedly Good Enough.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

 
SimplePortal 1.0.0 RC1 © 2008-2018