| 619 | } |
| 620 | |
| 621 | void |
| 622 | SerialStream::SetVTime(const short vtime) |
| 623 | try |
| 624 | { |
| 625 | auto my_buffer = dynamic_cast<SerialStreamBuf *>(this->rdbuf()) ; |
| 626 | |
| 627 | // Make sure that we are dealing with a SerialStreamBuf before |
| 628 | // proceeding. This check also makes sure that we have a non-NULL |
| 629 | // buffer associated with this stream. |
| 630 | if (my_buffer != nullptr) |
| 631 | { |
| 632 | // Try to set the vTime duration in deciseconds. |
| 633 | my_buffer->SetVTime(vtime) ; |
| 634 | } |
| 635 | else |
| 636 | { |
| 637 | // If the dynamic_cast above failed then we either have a NULL |
| 638 | // streambuf associated with this stream or we have a buffer of |
| 639 | // class other than SerialStreamBuf. In either case, we have a |
| 640 | // problem and we should stop all I/O using this stream. |
| 641 | setstate(badbit) ; |
| 642 | } |
| 643 | } |
| 644 | catch (const std::exception&) |
| 645 | { |
| 646 | setstate(std::ios_base::failbit) ; |
| 647 | throw ; |
| 648 | } |
| 649 | |
| 650 | short |
| 651 | SerialStream::GetVTime() |
nothing calls this directly
no outgoing calls
no test coverage detected