PrivMX Endpoint v2.7.0
Loading...
Searching...
No Matches
privmx::endpoint::event::EventApi Class Reference

#include <privmx/endpoint/event/EventApi.hpp>

Inheritance diagram for privmx::endpoint::event::EventApi:
Collaboration diagram for privmx::endpoint::event::EventApi:

Public Member Functions

 EventApi ()
 EventApi (const EventApi &obj)
EventApioperator= (const EventApi &obj)
 EventApi (EventApi &&obj)
void emitEvent (const std::string &contextId, const std::vector< core::UserWithPubKey > &users, const std::string &channelName, const core::Buffer &eventData)
std::vector< std::string > subscribeFor (const std::vector< std::string > &subscriptionQueries)
void unsubscribeFrom (const std::vector< std::string > &subscriptionIds)
std::string buildSubscriptionQuery (const std::string &channelName, EventSelectorType selectorType, const std::string &selectorId)
Public Member Functions inherited from privmx::endpoint::core::ExtendedPointer< EventApiImpl >
ExtendedPointer & operator= (const ExtendedPointer &obj)
std::shared_ptr< EventApiImpl > getImpl () const

Static Public Member Functions

static EventApi create (core::Connection &connection)

Additional Inherited Members

Protected Member Functions inherited from privmx::endpoint::core::ExtendedPointer< EventApiImpl >
void attachToPtrIfPossible ()
void detachFromPtrIfPossible ()
Protected Attributes inherited from privmx::endpoint::core::ExtendedPointer< EventApiImpl >
std::weak_ptr< EventApiImpl > _ptr

Detailed Description

'EventApi' is a class representing Endpoint's API for context custom events.

Constructor & Destructor Documentation

◆ EventApi()

privmx::endpoint::event::EventApi::EventApi ( )

//doc-gen:ignore

Member Function Documentation

◆ buildSubscriptionQuery()

std::string privmx::endpoint::event::EventApi::buildSubscriptionQuery ( const std::string & channelName,
EventSelectorType selectorType,
const std::string & selectorId )

Generate subscription Query for the custom events.

Parameters
channelNamename of the Channel
selectorTypeselector of scope on which you listen for events
selectorIdID of the selector

◆ create()

EventApi privmx::endpoint::event::EventApi::create ( core::Connection & connection)
static

Creates an instance of 'EventApi'.

Parameters
connectioninstance of 'Connection'
Returns
EventApi object

◆ emitEvent()

void privmx::endpoint::event::EventApi::emitEvent ( const std::string & contextId,
const std::vector< core::UserWithPubKey > & users,
const std::string & channelName,
const core::Buffer & eventData )

Emits the custom event on the given Context and channel.

Parameters
contextIdID of the Context
userslist of UserWithPubKey objects which defines the recipients of the event
channelNamename of the Channel
eventDataevent's data

◆ subscribeFor()

std::vector< std::string > privmx::endpoint::event::EventApi::subscribeFor ( const std::vector< std::string > & subscriptionQueries)

Subscribe for the custom events on the given subscription query.

Parameters
subscriptionQuerieslist of queries
Returns
list of subscriptionIds in maching order to subscriptionQueries

◆ unsubscribeFrom()

void privmx::endpoint::event::EventApi::unsubscribeFrom ( const std::vector< std::string > & subscriptionIds)

Unsubscribe from events for the given subscriptionId.

Parameters
subscriptionIdslist of subscriptionId

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