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

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -