I have a group of classes (let's say B,C,D,E) that basically represent specific operations a user can execute. I would like to have a single point of access for creating these object and launch their executions.
My first idea to accomplish that is to create another class (let's say class A) which will hide the complexity of creating the operation object and will call the related execution methods.
The classes B,C,D,E will implements a common interface in order to simplify the call of the specific operation.
My concern is how to prevent the possibility, by other classes, to create and directly use instances of classes B,C,D,E. I thought to define them as nested classes for class A: but this would affect the possibility to easily add more operations without touching the source file of class A.
In my implementation A is a Singleton.
How can I restrict the visibility of a group of classes only to a single class?
Edit: The application has to be written in C++