OpenCPN Partial API docs
Loading...
Searching...
No Matches
ObservedEvt Class Reference

Custom event class for OpenCPN's notification system. More...

#include <ocpn_plugin.h>

Inheritance diagram for ObservedEvt:

Public Member Functions

 ObservedEvt (wxEventType commandType=obsNOTIFY, int id=0)
 Constructor.
 
 ObservedEvt (const ObservedEvt &event)
 
wxEvent * Clone () const
 Creates a cloned copy of this event.
 
std::shared_ptr< const void > GetSharedPtr () const
 Gets the event's payload data.
 
void SetSharedPtr (std::shared_ptr< const void > p)
 Sets the event's payload data.
 

Detailed Description

Custom event class for OpenCPN's notification system.

This class extends wxCommandEvent to add support for passing shared pointer payloads between event producers and consumers. It's used by the notification/listening system to deliver messages and data between plugins and the core application.

Key features:

  • Built on standard wxWidgets event system
  • Supports arbitrary data payloads via shared pointers
  • Thread-safe message passing
  • Reference-counted memory management
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 6177 of file ocpn_plugin.h.

Constructor & Destructor Documentation

◆ ObservedEvt() [1/2]

ObservedEvt::ObservedEvt ( wxEventType  commandType = obsNOTIFY,
int  id = 0 
)
inline

Constructor.

Parameters
commandTypeEvent type ID, defaults to obsNOTIFY
idWindow identifier, defaults to 0

Definition at line 6185 of file ocpn_plugin.h.

◆ ObservedEvt() [2/2]

ObservedEvt::ObservedEvt ( const ObservedEvt event)
inline

Definition at line 6187 of file ocpn_plugin.h.

Member Function Documentation

◆ Clone()

wxEvent * ObservedEvt::Clone ( ) const
inline

Creates a cloned copy of this event.

Required by wxWidgets event system for event propagation.

Returns
Pointer to new copy of this event
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 6198 of file ocpn_plugin.h.

◆ GetSharedPtr()

std::shared_ptr< const void > ObservedEvt::GetSharedPtr ( ) const
inline

Gets the event's payload data.

Returns
Shared pointer to the payload data
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 6205 of file ocpn_plugin.h.

◆ SetSharedPtr()

void ObservedEvt::SetSharedPtr ( std::shared_ptr< const void >  p)
inline

Sets the event's payload data.

Parameters
pShared pointer to payload data
Examples
/home/runner/work/main/main/opencpn/include/ocpn_plugin.h.

Definition at line 6212 of file ocpn_plugin.h.


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