Listing 3 The overflow function

// Overflow function -- flush buffer and make more room
void gpibout::overflow() 
{
   // See if we have an output buffer first
   if(pbase_)
   {
      ::ibwrt(device,pbase_,(int)(pptr_-pbase_));
      status = ibsta;              // get write status
   }
   else
   {
      pbase_ = new char[128];
      if(pbase_ == NULL)
      {
         cerr << "Can't allocate Output Stream Buffer." << endl;
         exit(1);
      }
      epptr_ = pbase_ + 128;
      status = 0;
   }
   pptr_ = pbase_;
}

//End of File