Qore EmpathicBuildingDataProvider Module Reference 1.1
Loading...
Searching...
No Matches
EmpathicBuildingDataProvider::EmpathicBuildingWatchSensorDataProvider Class Reference

The EmpathicBuilding watch sensor data provider class. More...

#include <EmpathicBuildingWatchSensorDataProvider.qc.dox.h>

Inheritance diagram for EmpathicBuildingDataProvider::EmpathicBuildingWatchSensorDataProvider:
[legend]

Public Member Functions

 constructor (RestClient::RestClient rest, *Logger::LoggerInterface logger, hash< auto > org, hash< auto > loc, hash< auto > sensor)
 Create the object from the REST connection.
 
 destructor ()
 Destroys the object.
 
*string getDesc ()
 Returns the data provider description.
 
string getName ()
 Returns the data provider name.
 
 observersReady ()
 Called when all observers have been added to the object.
 
 stopEvents ()
 Called to stop generating events.
 
- Public Member Functions inherited from EmpathicBuildingDataProvider::EmpathicBuildingDataProviderBase
 constructor ()
 Creates the object.
 
 constructor (RestClient::RestClient rest, *Logger::LoggerInterface logger)
 Creates the object.
 
 setLogger (*LoggerInterface logger)
 Accepts a LoggerInterface object for logging (or clears it)
 
 updateConnectionObjects (object conn, object connobj)
 Update any connection used by the data provider.
 

Public Attributes

const PollInterval = 10000
 Default poll interval in milliseconds.
 
const ProviderInfo = ...
 Provider info.
 
const ProviderSummaryInfo = ...
 Provider summary info.
 
const RequestType = AbstractDataProviderTypeMap."nothing"
 Request type.
 
const ResponseType = new EmpathicBuildingSensorType()
 Response type.
 
- Public Attributes inherited from EmpathicBuildingDataProvider::EmpathicBuildingDataProviderBase
const MaxIoRetries = 5
 Max retries.
 
const RetrySet = ...
 IO errors for REST retries.
 

Protected Member Functions

Counter cnt ()
 I/O thread counter.
 
Condition cond ()
 I/O thread condition.
 
hash< auto > getEvent (*reference< hash< auto > > info)
 Returns event data.
 
hash< string, hash< DataProviderMessageInfo > > getEventTypesImpl ()
 Returns a hash of all supported event types.
 
auto getExampleEventDataImpl (string event_id)
 Returns example data for the given observable event.
 
hash< DataProvider::DataProviderInfo > getStaticInfoImpl ()
 Returns data provider static info.
 
 ioThread ()
 I/O thread.
 
Mutex m ()
 I/O thread lock.
 
 start ()
 Connects and starts receiving messages.
 
 stop ()
 Stops listening for new events.
 
- Protected Member Functions inherited from EmpathicBuildingDataProvider::EmpathicBuildingDataProviderBase
hash< auto > doRestCommand (string method, string path, auto body, reference< hash< auto > > info)
 Makes a REST call and returns the response.
 
bool retry (hash< ExceptionInfo > ex, reference< int > retries)
 Returns True if the error indicates that the operation should be retried.
 

Protected Attributes

hash< auto > loc
 Loc data.
 
hash< auto > org
 Org data.
 
timeout poll_interval_ms
 Poll interval in milliseconds.
 
hash< auto > sensor
 Sensor data.
 
*code start_thread
 callable value to start a new thread; must take a callable object as a parameter and return an integer TID
 
bool stop_flag
 Stop flag.
 
int tid
 TID of the I/O thread.
 
- Protected Attributes inherited from EmpathicBuildingDataProvider::EmpathicBuildingDataProviderBase
RestClient::RestClient rest
 The REST client object for API calls.
 

Additional Inherited Members

- Static Public Member Functions inherited from EmpathicBuildingDataProvider::EmpathicBuildingDataProviderBase
static date getTimestamp (int epoch_ms)
 Converts a Haltian ms epoch offset to a date/time value.
 

Detailed Description

The EmpathicBuilding watch sensor data provider class.

Member Function Documentation

◆ getEventTypesImpl()

hash< string, hash< DataProviderMessageInfo > > EmpathicBuildingDataProvider::EmpathicBuildingWatchSensorDataProvider::getEventTypesImpl ( )
protected

Returns a hash of all supported event types.

Returns
a hash of all supported event types
Note
only called if the provider supports the observer pattern / event API

◆ getExampleEventDataImpl()

auto EmpathicBuildingDataProvider::EmpathicBuildingWatchSensorDataProvider::getExampleEventDataImpl ( string event_id)
protected

Returns example data for the given observable event.

Parameters
event_idthe event ID of the event
Returns
example data for the given observable event
Exceptions
INVALID-OPERATIONthe data provider does not support the observer pattern / event API
INVALID-EVENTthe event_id is not valid
Since
DataProvider 3.0

◆ observersReady()

EmpathicBuildingDataProvider::EmpathicBuildingWatchSensorDataProvider::observersReady ( )

Called when all observers have been added to the object.

This method is meant to trigger event generation

◆ stopEvents()

EmpathicBuildingDataProvider::EmpathicBuildingWatchSensorDataProvider::stopEvents ( )

Called to stop generating events.

Stops polling for new events