HF Interface Wrapper 0.1.0-dev
Embedded C++ hardware abstraction layer
Loading...
Searching...
No Matches
BaseBluetooth Class Referenceabstract

Abstract base class for Bluetooth functionality. More...

#include <BaseBluetooth.h>

Inheritance diagram for BaseBluetooth:
[legend]

Public Member Functions

virtual ~BaseBluetooth () noexcept=default
 Virtual destructor for proper cleanup of derived classes.
 
virtual hf_bluetooth_err_t Initialize (hf_bluetooth_mode_t mode) noexcept=0
 Initialize the Bluetooth subsystem.
 
virtual hf_bluetooth_err_t Deinitialize () noexcept=0
 Deinitialize the Bluetooth subsystem.
 
virtual bool IsInitialized () const noexcept=0
 Check if Bluetooth is initialized.
 
virtual hf_bluetooth_err_t Enable () noexcept=0
 Enable Bluetooth.
 
virtual hf_bluetooth_err_t Disable () noexcept=0
 Disable Bluetooth.
 
virtual bool IsEnabled () const noexcept=0
 Check if Bluetooth is enabled.
 
virtual hf_bluetooth_err_t SetMode (hf_bluetooth_mode_t mode) noexcept=0
 Set Bluetooth operating mode.
 
virtual hf_bluetooth_mode_t GetMode () const noexcept=0
 Get current Bluetooth operating mode.
 
virtual hf_bluetooth_err_t GetLocalAddress (hf_bluetooth_address_t &address) const noexcept=0
 Get local Bluetooth address.
 
virtual hf_bluetooth_err_t SetDeviceName (const std::string &name) noexcept=0
 Set local device name.
 
virtual std::string GetDeviceName () const noexcept=0
 Get local device name.
 
virtual hf_bluetooth_err_t ConfigureClassic (const hf_bluetooth_classic_config_t &config) noexcept=0
 Configure Bluetooth Classic parameters.
 
virtual hf_bluetooth_err_t SetDiscoverable (bool discoverable, uint32_t timeout_ms=0) noexcept=0
 Make device discoverable.
 
virtual bool IsDiscoverable () const noexcept=0
 Check if device is discoverable.
 
virtual hf_bluetooth_err_t ConfigureBle (const hf_bluetooth_ble_config_t &config) noexcept=0
 Configure Bluetooth Low Energy parameters.
 
virtual hf_bluetooth_err_t StartAdvertising () noexcept=0
 Start BLE advertising.
 
virtual hf_bluetooth_err_t StopAdvertising () noexcept=0
 Stop BLE advertising.
 
virtual bool IsAdvertising () const noexcept=0
 Check if BLE advertising is active.
 
virtual hf_bluetooth_err_t StartScan (uint32_t duration_ms=0, hf_bluetooth_scan_type_t type=hf_bluetooth_scan_type_t::HF_BLUETOOTH_SCAN_TYPE_ACTIVE) noexcept=0
 Start device discovery/scanning.
 
virtual hf_bluetooth_err_t StopScan () noexcept=0
 Stop device discovery/scanning.
 
virtual bool IsScanning () const noexcept=0
 Check if scanning is in progress.
 
virtual hf_bluetooth_err_t GetDiscoveredDevices (std::vector< hf_bluetooth_device_info_t > &devices) noexcept=0
 Get discovered devices.
 
virtual hf_bluetooth_err_t ClearDiscoveredDevices () noexcept=0
 Clear discovered devices list.
 
virtual hf_bluetooth_err_t Connect (const hf_bluetooth_address_t &address, uint32_t timeout_ms=0) noexcept=0
 Connect to a remote device.
 
virtual hf_bluetooth_err_t Disconnect (const hf_bluetooth_address_t &address) noexcept=0
 Disconnect from a remote device.
 
virtual bool IsConnected (const hf_bluetooth_address_t &address) const noexcept=0
 Check if connected to a device.
 
virtual hf_bluetooth_err_t GetConnectedDevices (std::vector< hf_bluetooth_device_info_t > &devices) noexcept=0
 Get list of connected devices.
 
virtual hf_bluetooth_err_t Pair (const hf_bluetooth_address_t &address, const std::string &pin="") noexcept=0
 Pair with a remote device.
 
virtual hf_bluetooth_err_t Unpair (const hf_bluetooth_address_t &address) noexcept=0
 Unpair from a remote device.
 
virtual bool IsPaired (const hf_bluetooth_address_t &address) const noexcept=0
 Check if paired with a device.
 
virtual hf_bluetooth_err_t GetPairedDevices (std::vector< hf_bluetooth_device_info_t > &devices) noexcept=0
 Get list of paired devices.
 
virtual hf_bluetooth_err_t SendData (const hf_bluetooth_address_t &address, const std::vector< uint8_t > &data) noexcept=0
 Send data to a connected device.
 
virtual int GetAvailableData (const hf_bluetooth_address_t &address) const noexcept=0
 Check if data is available to read.
 
virtual hf_bluetooth_err_t ReadData (const hf_bluetooth_address_t &address, std::vector< uint8_t > &data, size_t max_bytes=0) noexcept=0
 Read available data from a connected device.
 
virtual hf_bluetooth_err_t DiscoverServices (const hf_bluetooth_address_t &address, std::vector< hf_bluetooth_gatt_service_t > &services) noexcept=0
 Discover GATT services on a connected device.
 
virtual hf_bluetooth_err_t DiscoverCharacteristics (const hf_bluetooth_address_t &address, const std::string &service_uuid, std::vector< hf_bluetooth_gatt_characteristic_t > &characteristics) noexcept=0
 Discover GATT characteristics for a service.
 
virtual hf_bluetooth_err_t ReadCharacteristic (const hf_bluetooth_address_t &address, const std::string &service_uuid, const std::string &characteristic_uuid, std::vector< uint8_t > &value) noexcept=0
 Read GATT characteristic value.
 
virtual hf_bluetooth_err_t WriteCharacteristic (const hf_bluetooth_address_t &address, const std::string &service_uuid, const std::string &characteristic_uuid, const std::vector< uint8_t > &value, bool with_response=true) noexcept=0
 Write GATT characteristic value.
 
virtual hf_bluetooth_err_t SubscribeCharacteristic (const hf_bluetooth_address_t &address, const std::string &service_uuid, const std::string &characteristic_uuid, bool enable) noexcept=0
 Subscribe to GATT characteristic notifications.
 
virtual hf_bluetooth_state_t GetState () const noexcept=0
 Get current Bluetooth state.
 
virtual int8_t GetRssi (const hf_bluetooth_address_t &address) const noexcept=0
 Get signal strength for a connected device.
 
virtual hf_bluetooth_err_t RegisterEventCallback (hf_bluetooth_event_callback_t callback) noexcept=0
 Register event callback.
 
virtual hf_bluetooth_err_t UnregisterEventCallback () noexcept=0
 Unregister event callback.
 
virtual hf_bluetooth_err_t RegisterDataCallback (hf_bluetooth_data_callback_t callback) noexcept=0
 Register data received callback.
 
virtual hf_bluetooth_err_t UnregisterDataCallback () noexcept=0
 Unregister data received callback.
 

Static Public Member Functions

static std::string_view GetErrorString (hf_bluetooth_err_t error)
 Get error description string.
 

Protected Member Functions

 BaseBluetooth ()=default
 Protected constructor - only derived classes can instantiate.
 
 BaseBluetooth (const BaseBluetooth &)=delete
 Copy constructor - deleted to prevent copying.
 
BaseBluetoothoperator= (const BaseBluetooth &)=delete
 Assignment operator - deleted to prevent copying.
 

Detailed Description

Abstract base class for Bluetooth functionality.

This class provides the interface for Bluetooth operations including:

  • Bluetooth Classic and BLE operations
  • Device discovery and scanning
  • Pairing and bonding management
  • Connection management
  • Data transmission and reception
  • GATT operations (for BLE)
  • Event handling and callbacks

Constructor & Destructor Documentation

◆ ~BaseBluetooth()

virtual BaseBluetooth::~BaseBluetooth ( )
virtualdefaultnoexcept

Virtual destructor for proper cleanup of derived classes.

◆ BaseBluetooth() [1/2]

BaseBluetooth::BaseBluetooth ( )
protecteddefault

Protected constructor - only derived classes can instantiate.

◆ BaseBluetooth() [2/2]

BaseBluetooth::BaseBluetooth ( const BaseBluetooth & )
protecteddelete

Copy constructor - deleted to prevent copying.

Member Function Documentation

◆ ClearDiscoveredDevices()

virtual hf_bluetooth_err_t BaseBluetooth::ClearDiscoveredDevices ( )
pure virtualnoexcept

Clear discovered devices list.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ ConfigureBle()

virtual hf_bluetooth_err_t BaseBluetooth::ConfigureBle ( const hf_bluetooth_ble_config_t & config)
pure virtualnoexcept

Configure Bluetooth Low Energy parameters.

Parameters
configBLE configuration
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ ConfigureClassic()

virtual hf_bluetooth_err_t BaseBluetooth::ConfigureClassic ( const hf_bluetooth_classic_config_t & config)
pure virtualnoexcept

Configure Bluetooth Classic parameters.

Parameters
configClassic configuration
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ Connect()

virtual hf_bluetooth_err_t BaseBluetooth::Connect ( const hf_bluetooth_address_t & address,
uint32_t timeout_ms = 0 )
pure virtualnoexcept

Connect to a remote device.

Parameters
addressRemote device address
timeout_msConnection timeout in milliseconds (0 for default)
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ Deinitialize()

virtual hf_bluetooth_err_t BaseBluetooth::Deinitialize ( )
pure virtualnoexcept

Deinitialize the Bluetooth subsystem.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ Disable()

virtual hf_bluetooth_err_t BaseBluetooth::Disable ( )
pure virtualnoexcept

Disable Bluetooth.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ Disconnect()

virtual hf_bluetooth_err_t BaseBluetooth::Disconnect ( const hf_bluetooth_address_t & address)
pure virtualnoexcept

Disconnect from a remote device.

Parameters
addressRemote device address
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ DiscoverCharacteristics()

virtual hf_bluetooth_err_t BaseBluetooth::DiscoverCharacteristics ( const hf_bluetooth_address_t & address,
const std::string & service_uuid,
std::vector< hf_bluetooth_gatt_characteristic_t > & characteristics )
pure virtualnoexcept

Discover GATT characteristics for a service.

Parameters
addressRemote device address
service_uuidService UUID
characteristicsVector to store discovered characteristics
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ DiscoverServices()

virtual hf_bluetooth_err_t BaseBluetooth::DiscoverServices ( const hf_bluetooth_address_t & address,
std::vector< hf_bluetooth_gatt_service_t > & services )
pure virtualnoexcept

Discover GATT services on a connected device.

Parameters
addressRemote device address
servicesVector to store discovered services
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ Enable()

virtual hf_bluetooth_err_t BaseBluetooth::Enable ( )
pure virtualnoexcept

Enable Bluetooth.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ GetAvailableData()

virtual int BaseBluetooth::GetAvailableData ( const hf_bluetooth_address_t & address) const
pure virtualnoexcept

Check if data is available to read.

Parameters
addressRemote device address
Returns
Number of bytes available, or -1 on error

Implemented in EspBluetooth.

◆ GetConnectedDevices()

virtual hf_bluetooth_err_t BaseBluetooth::GetConnectedDevices ( std::vector< hf_bluetooth_device_info_t > & devices)
pure virtualnoexcept

Get list of connected devices.

Parameters
devicesVector to store connected devices
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ GetDeviceName()

virtual std::string BaseBluetooth::GetDeviceName ( ) const
pure virtualnoexcept

Get local device name.

Returns
Device name string

Implemented in EspBluetooth.

◆ GetDiscoveredDevices()

virtual hf_bluetooth_err_t BaseBluetooth::GetDiscoveredDevices ( std::vector< hf_bluetooth_device_info_t > & devices)
pure virtualnoexcept

Get discovered devices.

Parameters
devicesVector to store discovered devices
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ GetLocalAddress()

virtual hf_bluetooth_err_t BaseBluetooth::GetLocalAddress ( hf_bluetooth_address_t & address) const
pure virtualnoexcept

Get local Bluetooth address.

Parameters
addressReference to store local address
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ GetMode()

virtual hf_bluetooth_mode_t BaseBluetooth::GetMode ( ) const
pure virtualnoexcept

Get current Bluetooth operating mode.

Returns
Current Bluetooth mode

Implemented in EspBluetooth.

◆ GetPairedDevices()

virtual hf_bluetooth_err_t BaseBluetooth::GetPairedDevices ( std::vector< hf_bluetooth_device_info_t > & devices)
pure virtualnoexcept

Get list of paired devices.

Parameters
devicesVector to store paired devices
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ GetRssi()

virtual int8_t BaseBluetooth::GetRssi ( const hf_bluetooth_address_t & address) const
pure virtualnoexcept

Get signal strength for a connected device.

Parameters
addressRemote device address
Returns
Signal strength in dBm, or INT8_MIN on error

Implemented in EspBluetooth.

◆ GetState()

virtual hf_bluetooth_state_t BaseBluetooth::GetState ( ) const
pure virtualnoexcept

Get current Bluetooth state.

Returns
Current Bluetooth state

Implemented in EspBluetooth.

◆ Initialize()

virtual hf_bluetooth_err_t BaseBluetooth::Initialize ( hf_bluetooth_mode_t mode)
pure virtualnoexcept

Initialize the Bluetooth subsystem.

Parameters
modeBluetooth operating mode
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ IsAdvertising()

virtual bool BaseBluetooth::IsAdvertising ( ) const
pure virtualnoexcept

Check if BLE advertising is active.

Returns
true if advertising, false otherwise

Implemented in EspBluetooth.

◆ IsConnected()

virtual bool BaseBluetooth::IsConnected ( const hf_bluetooth_address_t & address) const
pure virtualnoexcept

Check if connected to a device.

Parameters
addressRemote device address
Returns
true if connected, false otherwise

Implemented in EspBluetooth.

◆ IsDiscoverable()

virtual bool BaseBluetooth::IsDiscoverable ( ) const
pure virtualnoexcept

Check if device is discoverable.

Returns
true if discoverable, false otherwise

Implemented in EspBluetooth.

◆ IsEnabled()

virtual bool BaseBluetooth::IsEnabled ( ) const
pure virtualnoexcept

Check if Bluetooth is enabled.

Returns
true if enabled, false otherwise

Implemented in EspBluetooth.

◆ IsInitialized()

virtual bool BaseBluetooth::IsInitialized ( ) const
pure virtualnoexcept

Check if Bluetooth is initialized.

Returns
true if initialized, false otherwise

Implemented in EspBluetooth.

◆ IsPaired()

virtual bool BaseBluetooth::IsPaired ( const hf_bluetooth_address_t & address) const
pure virtualnoexcept

Check if paired with a device.

Parameters
addressRemote device address
Returns
true if paired, false otherwise

Implemented in EspBluetooth.

◆ IsScanning()

virtual bool BaseBluetooth::IsScanning ( ) const
pure virtualnoexcept

Check if scanning is in progress.

Returns
true if scanning, false otherwise

Implemented in EspBluetooth.

◆ operator=()

BaseBluetooth & BaseBluetooth::operator= ( const BaseBluetooth & )
protecteddelete

Assignment operator - deleted to prevent copying.

◆ Pair()

virtual hf_bluetooth_err_t BaseBluetooth::Pair ( const hf_bluetooth_address_t & address,
const std::string & pin = "" )
pure virtualnoexcept

Pair with a remote device.

Parameters
addressRemote device address
pinPIN code (for Classic, empty for BLE)
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ ReadCharacteristic()

virtual hf_bluetooth_err_t BaseBluetooth::ReadCharacteristic ( const hf_bluetooth_address_t & address,
const std::string & service_uuid,
const std::string & characteristic_uuid,
std::vector< uint8_t > & value )
pure virtualnoexcept

Read GATT characteristic value.

Parameters
addressRemote device address
service_uuidService UUID
characteristic_uuidCharacteristic UUID
valueVector to store characteristic value
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ ReadData()

virtual hf_bluetooth_err_t BaseBluetooth::ReadData ( const hf_bluetooth_address_t & address,
std::vector< uint8_t > & data,
size_t max_bytes = 0 )
pure virtualnoexcept

Read available data from a connected device.

Parameters
addressRemote device address
dataVector to store received data
max_bytesMaximum bytes to read (0 for all available)
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ RegisterDataCallback()

virtual hf_bluetooth_err_t BaseBluetooth::RegisterDataCallback ( hf_bluetooth_data_callback_t callback)
pure virtualnoexcept

Register data received callback.

Parameters
callbackData callback function
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ RegisterEventCallback()

virtual hf_bluetooth_err_t BaseBluetooth::RegisterEventCallback ( hf_bluetooth_event_callback_t callback)
pure virtualnoexcept

Register event callback.

Parameters
callbackEvent callback function
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ SendData()

virtual hf_bluetooth_err_t BaseBluetooth::SendData ( const hf_bluetooth_address_t & address,
const std::vector< uint8_t > & data )
pure virtualnoexcept

Send data to a connected device.

Parameters
addressRemote device address
dataData to send
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ SetDeviceName()

virtual hf_bluetooth_err_t BaseBluetooth::SetDeviceName ( const std::string & name)
pure virtualnoexcept

Set local device name.

Parameters
nameDevice name
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ SetDiscoverable()

virtual hf_bluetooth_err_t BaseBluetooth::SetDiscoverable ( bool discoverable,
uint32_t timeout_ms = 0 )
pure virtualnoexcept

Make device discoverable.

Parameters
discoverableTrue to make discoverable, false otherwise
timeout_msDiscoverable timeout in milliseconds (0 for indefinite)
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ SetMode()

virtual hf_bluetooth_err_t BaseBluetooth::SetMode ( hf_bluetooth_mode_t mode)
pure virtualnoexcept

Set Bluetooth operating mode.

Parameters
modeBluetooth operating mode
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ StartAdvertising()

virtual hf_bluetooth_err_t BaseBluetooth::StartAdvertising ( )
pure virtualnoexcept

Start BLE advertising.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ StartScan()

virtual hf_bluetooth_err_t BaseBluetooth::StartScan ( uint32_t duration_ms = 0,
hf_bluetooth_scan_type_t type = hf_bluetooth_scan_type_t::HF_BLUETOOTH_SCAN_TYPE_ACTIVE )
pure virtualnoexcept

Start device discovery/scanning.

Parameters
duration_msScan duration in milliseconds (0 for indefinite)
typeScan type (BLE only)
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ StopAdvertising()

virtual hf_bluetooth_err_t BaseBluetooth::StopAdvertising ( )
pure virtualnoexcept

Stop BLE advertising.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ StopScan()

virtual hf_bluetooth_err_t BaseBluetooth::StopScan ( )
pure virtualnoexcept

Stop device discovery/scanning.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ SubscribeCharacteristic()

virtual hf_bluetooth_err_t BaseBluetooth::SubscribeCharacteristic ( const hf_bluetooth_address_t & address,
const std::string & service_uuid,
const std::string & characteristic_uuid,
bool enable )
pure virtualnoexcept

Subscribe to GATT characteristic notifications.

Parameters
addressRemote device address
service_uuidService UUID
characteristic_uuidCharacteristic UUID
enableTrue to enable notifications, false to disable
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ Unpair()

virtual hf_bluetooth_err_t BaseBluetooth::Unpair ( const hf_bluetooth_address_t & address)
pure virtualnoexcept

Unpair from a remote device.

Parameters
addressRemote device address
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ UnregisterDataCallback()

virtual hf_bluetooth_err_t BaseBluetooth::UnregisterDataCallback ( )
pure virtualnoexcept

Unregister data received callback.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ UnregisterEventCallback()

virtual hf_bluetooth_err_t BaseBluetooth::UnregisterEventCallback ( )
pure virtualnoexcept

Unregister event callback.

Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.

◆ WriteCharacteristic()

virtual hf_bluetooth_err_t BaseBluetooth::WriteCharacteristic ( const hf_bluetooth_address_t & address,
const std::string & service_uuid,
const std::string & characteristic_uuid,
const std::vector< uint8_t > & value,
bool with_response = true )
pure virtualnoexcept

Write GATT characteristic value.

Parameters
addressRemote device address
service_uuidService UUID
characteristic_uuidCharacteristic UUID
valueValue to write
with_responseTrue to wait for write response
Returns
hf_bluetooth_err_t::BLUETOOTH_SUCCESS on success, error code otherwise

Implemented in EspBluetooth.


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