Passing HardwareSerial and SoftwareSerial as a Class Property
A base type for Arduino hardware serial classes, SoftwareSerial and other software serial classes and some other Arduino classes is Stream (reference). Stream.h on GitHub



class CustomSerial {

private:
  Stream &amp;stream;

public:
  CustomSerial(Stream &amp;_stream) : stream(_stream) {}

  int read() {
    return stream.read();
  }

  int available() {
    return stream.available();
  }

  int peek() {
    return stream.peek();
  }

  void write(byte b) {
    stream.write(b);
  }

};

SoftwareSerial Serial0(10, 11);
CustomSerial SerialCus(Serial0);

void setup() {
}

void loop(){
  if (SerialCus.available()) {
    char c = SerialCus.read();
    SerialCus.write(c);
  }
}