mercredi 1 janvier 2020

How the concept described below can be desined in the C++14?

I have to develop a C++ framework for an automation engine, which is able to run arbitrary user actions (C++ classes with the abstract method Execute()) in succession. Besides the usual input and output parameters, these actions have access to a common data structure, which serves as a global environment or context for all actions. My question is about this data structure.

The context plays role of a common mailbox or locker, to which any action can put a piece of data, and later some other action can take this data and use it. So that, this context should behave as a container of named elements of different types, unknown at design time. The elements can be a simple integer, a string or a pointer to a class. Their exact type is unknown until runtime. And of course, when the context is destroyed, it should destroy all its elements.

Is there a way to implement such a concept in the modern C++?

Aucun commentaire:

Enregistrer un commentaire