21#include "client/enums.h"
71 time_t lastUpdate = 0;
72 std::vector<uint8_t> data {};
78 std::enable_if_t<std::is_trivially_copyable_v<T>,
bool> =
true,
79 std::enable_if_t<std::is_default_constructible_v<T>,
bool> =
true>
80 inline operator T()
const {
90 template<
typename T, std::enable_if_t<std::is_trivially_copyable_v<T>,
bool> = true>
93 if ((ret = data.size() ==
sizeof(T)))
94 memcpy(&result, data.data(),
sizeof(T));
100 using DataRequest::operator=;
111 char variableType =
'L';
112 std::string variableName {};
113 std::string unitName {};
119 uint8_t simVarIndex = 0;
120 bool createLVar =
false;
123 explicit VariableRequest(
char variableType =
'L',
const std::string &variableName = std::string(),
const std::string &unitName = std::string(), uint8_t simVarIndex = 0,
bool createVariable =
false) :
124 variableType{variableType}, variableName{variableName}, unitName{unitName}, simVarIndex(simVarIndex), createLVar{createVariable} { }
126 explicit VariableRequest(
char variableType,
int variableId,
int unitId = -1, uint8_t simVarIndex = 0) :
127 variableType{variableType}, variableId{variableId}, unitId{unitId}, simVarIndex(simVarIndex) { }
129 explicit VariableRequest(
const std::string &simVarName,
const std::string &unitName, uint8_t simVarIndex = 0) :
130 variableType{
'A'}, variableName{simVarName}, unitName{unitName}, simVarIndex(simVarIndex) { }
133 variableType{
'A'}, variableId{simVarId}, unitId{unitId}, simVarIndex(simVarIndex) { }
136 explicit VariableRequest(
const std::string &localVarName,
bool createVariable =
false,
const std::string &unitName = std::string()) :
137 variableType{
'L'}, variableName{localVarName}, unitName{unitName}, createLVar{createVariable} { }
140 variableType{
'L'}, variableId{localVarId} { }
151 uint32_t eventId = -1;
160 RegisteredEvent(uint32_t eventId = -1,
const std::string &code =
"",
const std::string &name =
"");
WASimCommander::Client namespace. Defines/declares everything needed to interact with the WASimComman...
HRESULT result
Execution result, one of: S_OK, E_FAIL, E_TIMEOUT
WASimCommander::Enums::LookupItemType listType
the type of items being listed
ClientEventType eventType
The type of event. See enum docs for details.
std::string message
A short message about the event (eg. "Server Connected")
listResult_t list
Mapping of numeric item IDs to name strings.
std::vector< std::pair< int, std::string > > listResult_t
A mapping of IDs to names.
ClientStatus status
Current status flag(s). See enum docs for details.
ClientEventType
Client event type enumeration.
ClientStatus
Client status flags.
Client Event data, delivered via callback.
Structure for delivering list results, eg. of local variables sent from Server.
LookupItemType
Types of things to look up or list.
DataRequestRecord inherits and extends WASimCommander::DataRequest with data pertinent for use by a d...
bool tryConvert(T &result) const
Tries to populate a pre-initialized value reference of the desired type and returns true or false dep...
Structure to hold data for registered (reusable) calculator events. Used to submit events with WASimC...
Structure for using with WASimClient::getVariable() and WASimClient::setVariable() to specify informa...
VariableRequest(const std::string &localVarName, bool createVariable=false, const std::string &unitName=std::string())
Construct a variable request for a Local variable ('L') with the given name. createVariable will crea...
VariableRequest(char variableType, int variableId, int unitId=-1, uint8_t simVarIndex=0)
Construct a variable request using numeric variable and (optionally) unit IDs, and optional SimVar in...
VariableRequest(char variableType='L', const std::string &variableName=std::string(), const std::string &unitName=std::string(), uint8_t simVarIndex=0, bool createVariable=false)
Default constructor, with optional parameters for variable type, name, unit name, SimVar index and cr...
VariableRequest(int simVarId, int unitId, uint8_t simVarIndex=0)
Construct a variable request for a Simulator Variable ('A') using numeric variable and unit IDs,...
VariableRequest(const std::string &simVarName, const std::string &unitName, uint8_t simVarIndex=0)
Construct a variable request for a Simulator Variable (SimVar) with given name, unit,...
VariableRequest(int localVarId)
Construct a variable request for a Local variable ('L') with the given numeric ID.
Structure for variable value subscription requests.
DataRequest(uint32_t requestId, uint32_t valueSize=sizeof(double), WASimCommander::Enums::RequestType requestType=WASimCommander::Enums::RequestType::Calculated, WASimCommander::Enums::CalcResultType calcResultType=WASimCommander::Enums::CalcResultType::Double, WASimCommander::Enums::UpdatePeriod period=WASimCommander::Enums::UpdatePeriod::Tick, const char *nameOrCode=nullptr, const char *unitName=nullptr, char varTypePrefix='L', float deltaEpsilon=0.0f, uint8_t interval=0, uint8_t simVarIndex=0)
Constructor with required request ID, all other parameters optional. See member documentation for exp...