refactor: add eoOperatorFoundry

- Simpler relationships between encoding and set of operators in foundry.
- Rename "instanciate" in "instantiate"
This commit is contained in:
Johann Dreo 2020-05-03 15:31:25 +02:00
commit ae81793f7c
8 changed files with 193 additions and 112 deletions

View file

@ -28,14 +28,14 @@ int main(int /*argc*/, char** /*argv*/)
// Forge container using indices.
eoForgeVector<OpInterface> indexed_factories;
// Capture constructor's parameters and defer instanciation.
// Capture constructor's parameters and defer instantiation.
indexed_factories.add<OpA>("I'm A");
indexed_factories.setup<OpA>(0, "I'm actually A"); // Edit
indexed_factories.add<OpB>("I'm B", " prime");
indexed_factories.add<OpB>("I'm a B", " junior");
// Actually instanciante and call.
indexed_factories.instanciate(0)();
indexed_factories.instanciate(1)();
indexed_factories.instanciate(2)();
// Actually instantiante and call.
indexed_factories.instantiate(0)();
indexed_factories.instantiate(1)();
indexed_factories.instantiate(2)();
}