Merge remote-tracking branch 'origin/topic/johanna/bit-1181'

BIT-1181 #merged

* origin/topic/johanna/bit-1181:
  Input: Further small changes to error handling
  Add error events to input framework.
This commit is contained in:
Robin Sommer 2016-07-26 14:48:23 -07:00
commit 5b73345b73
33 changed files with 599 additions and 156 deletions

View file

@ -63,7 +63,7 @@ public:
* an argument to callbacks. One must not otherwise access the
* frontend, it's running in a different thread.
*/
ReaderBackend(ReaderFrontend* frontend);
explicit ReaderBackend(ReaderFrontend* frontend);
/**
* Destructor.
@ -186,8 +186,22 @@ public:
int NumFields() const { return num_fields; }
// Overridden from MsgThread.
virtual bool OnHeartbeat(double network_time, double current_time);
virtual bool OnFinish(double network_time);
bool OnHeartbeat(double network_time, double current_time) override;
bool OnFinish(double network_time) override;
void Info(const char* msg) override;
void Warning(const char* msg) override;
/**
* Reports an error in the child thread. For input readers, it is assumed
* that Info and Warnings do not cause the read operation to fail (they might
* signal that, e.g., a single line was ignored).
*
* It is assumed that Errors are not recoverable. Calling the Error function
* will return the error back to scriptland and also *automatically* causes
* the current reader to be disabled and torn down.
*/
void Error(const char* msg) override;
protected:
// Methods that have to be overwritten by the individual readers
@ -325,7 +339,6 @@ protected:
*/
void EndCurrentSend();
private:
// Frontend that instantiated us. This object must not be accessed
// from this class, it's running in a different thread!