BAOS .net SDK  18.2.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
kdrive::baos::bindings::BaosEvent Class Reference

BAOS Events (datapoint modified, bus connected and connector closed) More...

#include <BaosEvent.h>

Public Member Functions

 BaosEvent (Connector^connector)
 Creates a BaosEvent Requires a connector. More...
 
 ~BaosEvent ()
 Destroys the BaosEvent. More...
 
void enable ()
 Enables (starts) the event callback notifications More...
 
void disable ()
 Disables (stops) the event callback notifications More...
 
delegate void DatapointEventHandler (Object^sender, BaosDatapoint^datapoint)
 The callback is handled using the event system More...
 
delegate void BusConnectedEventHandler (Object^sender, bool connected)
 Callback function called when a server value indication is received to indicate whether the bus is connected or not More...
 
delegate void ConnectorClosedEventHandler (Object^sender)
 Callback function called when the connector is disconnected More...
 

Public Attributes

event DatapointEventHandler DatapointEvent
 
event BusConnectedEventHandler BusConnectedEvent
 
event ConnectorClosedEventHandler ConnectorClosedEvent
 

Protected Member Functions

 !BaosEvent ()
 Finalizer (non-deterministic destructor) cleans up unmanaged resources. More...
 

Detailed Description

BAOS Events (datapoint modified, bus connected and connector closed)

Constructor & Destructor Documentation

kdrive::baos::bindings::BaosEvent::BaosEvent ( Connector connector)

Creates a BaosEvent Requires a connector.

Note: the callbacks occur in the context of the notification thread, and not in the main thread (or the GUI thread). If you are developing an application in C# for example that needs to update the GUI you should connect to the BaosEvent events and in your code re-raise the event so it is in the main gui thread context. See Invoke for more information. An example is implemented in the C# samples for the PushButtonDemo:

@verbatim
void onDatapointEventInThreadContext(object sender, BaosDatapoint datapoint)
{
Invoke(new BaosEvent.DatapointEventHandler(onDatapointEvent), new object[] { sender, datapoint });
}
@endverbatim
kdrive::baos::bindings::BaosEvent::~BaosEvent ( )

Destroys the BaosEvent.

Destructor cleans up unmanaged and managed resources.

kdrive::baos::bindings::BaosEvent::!BaosEvent ( )
protected

Finalizer (non-deterministic destructor) cleans up unmanaged resources.

Member Function Documentation

delegate void kdrive::baos::bindings::BaosEvent::BusConnectedEventHandler ( Object^  sender,
bool  connected 
)

Callback function called when a server value indication is received to indicate whether the bus is connected or not

delegate void kdrive::baos::bindings::BaosEvent::ConnectorClosedEventHandler ( Object^  sender)

Callback function called when the connector is disconnected

delegate void kdrive::baos::bindings::BaosEvent::DatapointEventHandler ( Object^  sender,
BaosDatapoint datapoint 
)

The callback is handled using the event system

void kdrive::baos::bindings::BaosEvent::disable ( )

Disables (stops) the event callback notifications

void kdrive::baos::bindings::BaosEvent::enable ( )

Enables (starts) the event callback notifications

Member Data Documentation

event BusConnectedEventHandler kdrive::baos::bindings::BaosEvent::BusConnectedEvent
event ConnectorClosedEventHandler kdrive::baos::bindings::BaosEvent::ConnectorClosedEvent
event DatapointEventHandler kdrive::baos::bindings::BaosEvent::DatapointEvent

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