MEM: Introduce the master/slave port sub-classes in C++