MCPcopy Create free account
hub / github.com/crayzeewulf/libserial / SetVMin

Method SetVMin

src/SerialStream.cpp:565–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563 }
564
565 void
566 SerialStream::SetVMin(const short vmin)
567 try
568 {
569 auto my_buffer = dynamic_cast<SerialStreamBuf *>(this->rdbuf()) ;
570
571 // Make sure that we are dealing with a SerialStreamBuf before
572 // proceeding. This check also makes sure that we have a non-NULL
573 // buffer associated with this stream.
574 if (my_buffer != nullptr)
575 {
576 // Try to set the vMin number of characters.
577 my_buffer->SetVMin(vmin) ;
578 }
579 else
580 {
581 // If the dynamic_cast above failed then we either have a NULL
582 // streambuf associated with this stream or we have a buffer of
583 // class other than SerialStreamBuf. In either case, we have a
584 // problem and we should stop all I/O using this stream.
585 setstate(badbit) ;
586 }
587 }
588 catch (const std::exception&)
589 {
590 setstate(std::ios_base::failbit) ;
591 throw ;
592 }
593
594 short
595 SerialStream::GetVMin()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected