It looks like UnbufferedSerial::attach() is a private function and you can’t call it in user code. To get similar behavior to what you have (call a function when serial port is readable), it looks like you want sigio().
Also note that if you are receiving input over the serial port, you probably want to be using BufferedSerial since UnbufferedSerial can only store at most a few bytes at a time for reading.
EDIT: Actually attach() is a public function, never mind. I think all you need to do is change UnbufferedSerial::RxIrq to SerialBase::RxIrq.
Instead of UnbufferedSerial use RawSerial class. I have not checked your library header file (try to check access specifier)
Use any circular buffer method to store data.
Here is one example , method is almost same as you used.