Buffer Interface
Public Member Functions | Static Public Member Functions | List of all members
BiException Class Reference

Exception thrown when a BitFlow SDK error occurs. More...

#include <BFException.hpp>

Inheritance diagram for BiException:
BFExceptionBase

Public Member Functions

 BiException (void)
 
 BiException (Bd hBoard, const BFU32 error)
 
 BiException (BiException const &to_copy)
 
 BiException (BiException &&to_take)
 
BiExceptionoperator= (BiException const &to_copy)
 
BiExceptionoperator= (BiException &&to_take)
 
virtual BFU32 showErrorMsg (void) const
 
- Public Member Functions inherited from BFExceptionBase
 BFExceptionBase (void)
 
 BFExceptionBase (BFExceptionBase const &to_copy)
 
 BFExceptionBase (BFExceptionBase &&to_take)
 
virtual ~BFExceptionBase (void)
 
BFExceptionBaseoperator= (BFExceptionBase const &to_copy)
 
BFExceptionBaseoperator= (BFExceptionBase &&to_take)
 
virtual BFU32 getErrorText (PBFCHAR ErrorText, PBFU32 ErrorTextSize) const
 
virtual std::string getErrorText (void) const
 
virtual BFU32 getErrorNumber (void) const
 

Static Public Member Functions

static void check (Bd hBoard, const BFU32 error)
 
static std::string getErrorText (Bd hBoard, const BFU32 error)
 

Additional Inherited Members

- Protected Member Functions inherited from BFExceptionBase
 BFExceptionBase (const BFU32 number, std::string const &message)
 
 BFExceptionBase (const BFU32 number, std::string &&message)
 

Detailed Description

Exception thrown when a BitFlow SDK error occurs.

Note
This is based upon the BiApi error stack, not the BF/CiApi error stack.
See also
BIRC_Enum

Constructor & Destructor Documentation

BiException::BiException ( void  )

Referenced by check().

BiException::BiException ( Bd  hBoard,
const BFU32  error 
)

Initialize a BiException with the given error code and message.

Parameters
[in]hBoard- The board which generated the error.
[in]error- The error code value to check.
346  : BFExceptionBase (error, getErrorText(hBoard, error))
347 { }
virtual std::string getErrorText(void) const
Definition: BFException.cpp:164
BFExceptionBase(void)
Definition: BFException.cpp:36
BiException::BiException ( BiException const &  to_copy)

Initialize a BiException as a copy of another BiException.

Parameters
[in]to_copy- The exception to copy.
355  : BFExceptionBase (to_copy)
356 { }
BFExceptionBase(void)
Definition: BFException.cpp:36
BiException::BiException ( BiException &&  to_take)

Initialize a BiException, taking the contents of another BiException.

Parameters
[in]to_take- The exception to copy.
364  : BFExceptionBase ( std::move(to_take) )
365 { }
BFExceptionBase(void)
Definition: BFException.cpp:36

Member Function Documentation

void BiException::check ( Bd  hBoard,
const BFU32  error 
)
static

Throw a BFException, if error isn't BF_OK.

Parameters
[in]hBoard- The board which generated the error.
[in]error- The error code value to check.
Exceptions
BiExceptionthrown, initialized to error, if error isn't BF_OK.

References BiException().

Referenced by CLComm::CLAllSerial::bfSerialInit(), CLComm::CLAllSerial::bfSWConnectorSerialInit(), BufferAcquisition::BufferInterface::boardCount(), BFGTLUtilities::Device::boardCount(), BufferAcquisition::CircularInterface::cirControl(), BufferAcquisition::CircularInterface::cirErrorWait(), BufferAcquisition::CircularInterface::cleanup(), BufferAcquisition::SequenceInterface::cleanup(), BufferAcquisition::SequenceInterface::clearBufferInfo(), BufferAcquisition::BufferInterface::clearBuffers(), BufferAcquisition::BufferInterface::enumerateCameraModes(), BufferAcquisition::BufferInterface::getAbortAcqFlag(), BufferAcquisition::BufferInterface::getBrdInfo(), BufferAcquisition::BufferInterface::getBufferArrayPointers(), BufferAcquisition::SequenceInterface::getBufferInfo(), BufferAcquisition::BufferInterface::getBufferQueueSize(), BufferAcquisition::CircularInterface::getBufferStatus(), BufferAcquisition::CircularInterface::getCirError(), BufferAcquisition::BufferInterface::getCleanupAcqFlag(), BufferAcquisition::SequenceInterface::getCurFrameAcquired(), BufferAcquisition::BufferInterface::getErrorText(), BufferAcquisition::BufferInterface::getMajorVersion(), BufferAcquisition::BufferInterface::getMinorVersion(), BufferAcquisition::BufferInterface::getNumFramesCaptured(), BufferAcquisition::BufferInterface::getNumFramesMissed(), BufferAcquisition::BufferInterface::getPauseAcqFlag(), BufferAcquisition::SequenceInterface::getSeqError(), BufferAcquisition::BufferInterface::getStartAcqFlag(), BufferAcquisition::BufferInterface::getStopAcqFlag(), BufferAcquisition::BufferInterface::getTriggerMode(), BufferAcquisition::BufferInterface::getTriggerPolarity(), BufferAcquisition::BufferInterface::Properties::interface_type(), BufferAcquisition::BufferInterface::issueSoftwareTrigger(), BufferAcquisition::BufferInterface::loadCamFile(), CXPReg::Device::open(), BufferAcquisition::BufferInterface::open(), BFGTLUtilities::Device::open(), CXPReg::Device::openSWConnector(), BufferAcquisition::BufferInterface::openSWConnector(), BFGTLUtilities::Device::openSWConnector(), BufferAcquisition::BufferInterface::readSeqFile(), BufferAcquisition::SequenceInterface::seqControl(), BufferAcquisition::SequenceInterface::seqErrorWait(), BufferAcquisition::SequenceInterface::seqWaitDone(), BufferAcquisition::CircularInterface::setBufferStatus(), BufferAcquisition::BufferInterface::setCameraMode(), BufferAcquisition::SequenceInterface::setSettings(), BufferAcquisition::BufferInterface::setTimeout(), BufferAcquisition::BufferInterface::setTriggerMode(), BufferAcquisition::SequenceInterface::setup(), BufferAcquisition::CircularInterface::setup(), BufferAcquisition::BufferInterface::showError(), BufferAcquisition::CircularInterface::waitDoneFrame(), BufferAcquisition::SequenceInterface::waitDoneFrame(), BufferAcquisition::BufferInterface::writeBuffer(), and BufferAcquisition::BufferInterface::writeSeqBuffer().

307 {
308  if (BF_OK == error)
309  return;
310 
311  throw BiException(hBoard, error);
312 }
BiException(void)
std::string BiException::getErrorText ( Bd  hBoard,
const BFU32  error 
)
static

Return the error text associated with the given error code.

Parameters
[in]hBoard- The board which generated the error.
[in]error- The error code value to check.

References BI_ERROR_BUFFER_TOO_SMALL, and MAX_STRING.

321 {
322  std::vector<char> errTxt (MAX_STRING);
323  BFU32 errTxtSize = (BFU32)errTxt.size();
324 
325  BFRC rc = BiErrorTextGet(hBoard, error, errTxt.data(), &errTxtSize);
326  if (BI_ERROR_BUFFER_TOO_SMALL == rc)
327  {
328  errTxt.resize(++errTxtSize);
329  rc = BiErrorTextGet(hBoard, error, errTxt.data(), &errTxtSize);
330  }
331 
332  if (BF_OK != rc)
333  return "Bi error code message unavailable.";
334 
335  errTxt.push_back(0);
336  return errTxt.data();
337 }
unsigned long BFU32
Definition: BFTypeNT.h:55
Definition: BiError.h:330
BFU32 BFRC
Definition: BFType.h:92
#define MAX_STRING
Definition: BFType.h:65
BiException & BiException::operator= ( BiException const &  to_copy)

Copy the contents of the exception to_copy.

Parameters
[in]to_copy- The exception to be copied.
Returns
Returns a reference to this exception.

References BFExceptionBase::operator=().

375 {
377  return *this;
378 }
BFExceptionBase & operator=(BFExceptionBase const &to_copy)
Definition: BFException.cpp:95
BiException & BiException::operator= ( BiException &&  to_take)

Take the contents of the exception to_take.

Parameters
[in]to_take- The exception to be taken.
Returns
Returns a reference to this exception.

References BFExceptionBase::operator=().

388 {
389  BFExceptionBase::operator=( std::move(to_take) );
390  return *this;
391 }
BFExceptionBase & operator=(BFExceptionBase const &to_copy)
Definition: BFException.cpp:95
BFU32 BiException::showErrorMsg ( void  ) const
virtual

Pops up a dialog displaying a text description of the error that was thrown.

Returns
Returns one of the following:
  • BI_OK - The user clicked on the ok button on the dialog.
  • BI_CANCEL - The user clicked on the cancel button on the dialog.

Reimplemented from BFExceptionBase.

References BFExceptionBase::getErrorNumber().

402 {
403  return BiErrorShow(0, getErrorNumber());
404 }
virtual BFU32 getErrorNumber(void) const
Definition: BFException.cpp:172

The documentation for this class was generated from the following files: