Make tags generated during component initialization stable.

The order in which the plugin initializers are executed is compiler
dependent. With this change, Tags will always be generated in
alphabetical ordering, not in compiler-dependent order.
This commit is contained in:
Johanna Amann 2016-08-11 17:06:56 -07:00
parent 2756dfe581
commit 65d977f278
13 changed files with 95 additions and 11 deletions

View file

@ -13,7 +13,11 @@ Component::Component(const std::string& name, factory_callback arg_factory, Tag:
plugin::TaggedComponent<file_analysis::Tag>(subtype)
{
factory = arg_factory;
}
void Component::Initialize()
{
InitializeTag();
file_mgr->RegisterComponent(this, "ANALYZER_");
}

View file

@ -54,6 +54,13 @@ public:
*/
~Component();
/**
* Initialization function. This function has to be called before any
* plugin component functionality is used; it is used to add the
* plugin component to the list of components and to initialize tags
*/
void Initialize() override;
/**
* Returns the analyzer's factory function.
*/
@ -63,7 +70,7 @@ protected:
/**
* Overriden from plugin::Component.
*/
virtual void DoDescribe(ODesc* d) const;
void DoDescribe(ODesc* d) const override;
private:
factory_callback factory; // The analyzer's factory callback.