Hello,
I'm working on modifying a current C++ library, libserial, and I'm trying to understand something. In its implementation, this library has a class, SerialPort, which contains all of the functions to access the serial port. However, there is another class, SerialPortImpl (which I'm assuming stands for "Serial Port Implementation") which acutally does all of the work: SerialPort simply has a private member SerialPortImpl object which it acts on. For example, to get the baud rate, the code looks like so:

Code:
int
SerialPort::SetBaudRate( const BaudRate baudRate )
{
    return mSerialPortImpl->SetBaudRate( baudRate ) ;
}
Why is this done? I know that this class double-buffers the serial port into its own buffer using a signal IO catch from the port, does this have something to do with it? I guess my question is; in general, why would someone do this?

Thanks for the help.