Class for the car data.
More...
#include <CarDataI.hpp>
Class for the car data.
Definition at line 37 of file CarDataI.hpp.
◆ CarDataI()
Data::CarDataI::CarDataI |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ ~CarDataI()
Data::CarDataI::~CarDataI |
( |
| ) |
|
Destructor for the CarDataI class.
This destructor is responsible for stopping the Ice communicator and destroying it.
Definition at line 36 of file CarDataI.cpp.
◆ getCarTemperatureValue()
double Data::CarDataI::getCarTemperatureValue |
( |
const Ice::Current & | | ) |
|
|
override |
Get the car temperature value.
This method is responsible for getting the car temperature value. It is thread-safe and uses a mutex to ensure that the temperature is retrieved without race conditions.
- Returns
- The current value of the car temperature
Definition at line 92 of file CarDataI.cpp.
◆ getJoystickValue()
bool Data::CarDataI::getJoystickValue |
( |
const Ice::Current & | | ) |
|
|
override |
Get the joystick value.
This method is responsible for getting the joystick value.
- Returns
- The current value of the joystick
Definition at line 63 of file CarDataI.cpp.
◆ runServer()
void Data::CarDataI::runServer |
( |
int | argc, |
|
|
char ** | argv ) |
Runs the Ice server.
This method runs the Ice server by initializing the Ice communicator with the given arguments and custom properties. The custom properties set the minimum and maximum thread pool size to 10 and 20 respectively. The server is then activated and will listen on the specified endpoint ("tcp -h 127.0.0.1 -p 10000"). The server will run until it is stopped with Ctrl+C.
- Parameters
-
argc | The number of command-line arguments. |
argv | The array of command-line arguments. |
Definition at line 109 of file CarDataI.cpp.
◆ setCarTemperatureValue()
void Data::CarDataI::setCarTemperatureValue |
( |
double | newValue, |
|
|
const Ice::Current & | ) |
|
override |
Set the car temperature value.
This method sets the temperature of the car to the specified value. It is thread-safe and uses a mutex to ensure that the temperature is updated without race conditions. Logs the new temperature value to the console.
- Parameters
-
newValue | The new temperature value to be set |
current | The current Ice context |
Definition at line 78 of file CarDataI.cpp.
◆ setJoystickValue()
void Data::CarDataI::setJoystickValue |
( |
bool | newValue, |
|
|
const Ice::Current & | ) |
|
override |
Set the joystick value.
This method is responsible for setting the joystick value.
- Parameters
-
newValue | The new value for the joystick |
current | The current Ice context |
Definition at line 51 of file CarDataI.cpp.
◆ car_temperature
double Data::CarDataI::car_temperature |
|
private |
◆ communicator
Ice::CommunicatorPtr Data::CarDataI::communicator |
|
private |
◆ joystick_enable
bool Data::CarDataI::joystick_enable |
|
private |
◆ joystick_mutex
std::mutex Data::CarDataI::joystick_mutex |
|
private |
◆ serverThread
std::thread Data::CarDataI::serverThread |
|
private |
◆ temperature_mutex
std::mutex Data::CarDataI::temperature_mutex |
|
private |
The documentation for this class was generated from the following files: