serialization - How to implement global string to constructor map in C++? -


i have interface file parser. parser can configured, saved file. new parsers new file types can added using .dll plugins.

class fileparserinterface { public:     qstring tostring() const = 0;     qstring constructorname() const {return "fileparserinterface";}     somedatastruct getdata() = 0; } 

therefore need way save instances name (can name of constructor). have method instance string, eg:

static std::shared_ptr<fileparserinterface> fileparserfromstring(const qstring& name, const qstring& parameters); 

i have no idea how thread-safely implement this. using boost , qt libraries. prefer use stdlib , qt when possible.


Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -