v1.3.0.0
WASimCommander::Client::RegisteredEvent Struct Reference

Structure to hold data for registered (reusable) calculator events. Used to submit events with WASimClient::registerEvent(). More...

#include "structs.h"

Public Member Functions

 RegisteredEvent (uint32_t eventId=-1, const std::string &code="", const std::string &name="")
 Default implicit constructor. More...
 
 RegisteredEvent (RegisteredEvent const &)=default
 

Public Attributes

uint32_t eventId = -1
 A unique ID for this event. The ID can later be used to modify, trigger, or remove this event. More...
 
std::string code {}
 The calculator code string to execute as the event action. The code is pre-compiled and stored on the server for quicker execution. Maximum length is WASimCommander::STRSZ_CMD value minus the name string length, if one is used. More...
 
std::string name {}
 Optional custom name for this event. The name is for use with SimConnect_MapClientEventToSimEvent(id, "event_name") and SimConnect_TransmitClientEvent(id). Default is to use the event ID as a string. If the custom event name contains a period (.) then it is used as-is. Otherwise "WASimCommander.[client_name]." will be prepended to the name. More...
 

Detailed Description

Structure to hold data for registered (reusable) calculator events. Used to submit events with WASimClient::registerEvent().

WASimClient also holds a list of all registered events which have been added using WASimClient::registerEvent(). These requests are available for reference using WASimClient::registeredEvent() and WASimClient::registeredEvents() methods.

See also
WASimClient::registerEvent(), WASimCommander::CommandId::Register

Definition at line 149 of file structs.h.

Constructor & Destructor Documentation

◆ RegisteredEvent()

WASimCommander::Client::RegisteredEvent::RegisteredEvent ( uint32_t  eventId = -1,
const std::string &  code = "",
const std::string &  name = "" 
)

Default implicit constructor.

Definition at line 87 of file WASimClient.cpp.

Member Data Documentation

◆ eventId

uint32_t WASimCommander::Client::RegisteredEvent::eventId = -1

A unique ID for this event. The ID can later be used to modify, trigger, or remove this event.

Definition at line 151 of file structs.h.

◆ code

std::string WASimCommander::Client::RegisteredEvent::code {}

The calculator code string to execute as the event action. The code is pre-compiled and stored on the server for quicker execution. Maximum length is WASimCommander::STRSZ_CMD value minus the name string length, if one is used.

Definition at line 152 of file structs.h.

◆ name

std::string WASimCommander::Client::RegisteredEvent::name {}

Optional custom name for this event. The name is for use with SimConnect_MapClientEventToSimEvent(id, "event_name") and SimConnect_TransmitClientEvent(id). Default is to use the event ID as a string. If the custom event name contains a period (.) then it is used as-is. Otherwise "WASimCommander.[client_name]." will be prepended to the name.

Note
The event name cannot be changed after the initial registration (it is essentially equivalent to the eventId). When updating an existing event on the server, it is not necessary to include the name again, only the eventId is required (and the code to execute, of course). Maximum length for the name string is the value of WASimCommander::STRSZ_ENAME.

Definition at line 154 of file structs.h.


The documentation for this struct was generated from the following files: