Mech-Eye API 2.5.0
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Public Types | Static Public Member Functions | List of all members
mmind::eye::ProfilerEvent Class Reference

Describes the event of profiler. Use ProfilerEvent::registerProfilerEventCallback to register an event of interest. More...

#include <ProfilerEvent.h>

Classes

struct  EventData
 
struct  EventInfo
 Describes the event information. More...
 
struct  PayloadMember
 Describes the data member of the event's payload. More...
 

Public Types

enum  Event { PROFILER_EVENT_DISCONNECTED = 0x0001 , PROFILER_EVENT_ALL = 0xFFFF }
 Describes the types of Event. More...
 
using EventCallback = std::function< void(Event event, void *pUser)>
 
using Payload = std::vector< PayloadMember >
 
using ProfilerEventCallback = std::function< void(const EventData *eventData, const void *extraPayload)>
 callback function for a camera event.
 

Static Public Member Functions

static ErrorStatus registerProfilerEventCallback (Profiler &profiler, EventCallback callback, void *pUser, unsigned int events)
 Registers a profiler event of interest.
 
static ErrorStatus getSupportedEvents (const Profiler &profiler, std::vector< EventInfo > &eventInfos)
 Get supported events by the profiler.
 
static ErrorStatus registerProfilerEventCallback (Profiler &profiler, uint16_t event, const ProfilerEventCallback &callback)
 Registers a callback function to be executed when the specified Event occurs on the specified Profiler object.
 
static ErrorStatus unregisterProfilerEventCallback (Profiler &profiler, uint16_t event)
 Cancels the registration of a callback function for the specified event and Profiler object.
 

Detailed Description

Describes the event of profiler. Use ProfilerEvent::registerProfilerEventCallback to register an event of interest.

Definition at line 48 of file ProfilerEvent.h.

Member Typedef Documentation

◆ EventCallback

using mmind::eye::ProfilerEvent::EventCallback = std::function<void(Event event, void* pUser)>

Definition at line 61 of file ProfilerEvent.h.

◆ Payload

using mmind::eye::ProfilerEvent::Payload = std::vector<PayloadMember>

Definition at line 148 of file ProfilerEvent.h.

◆ ProfilerEventCallback

using mmind::eye::ProfilerEvent::ProfilerEventCallback = std::function<void(const EventData* eventData, const void* extraPayload)>

callback function for a camera event.

Parameters
[in]eventDatashared data among events.
[in]extraPayloadevent-specific data.

Definition at line 155 of file ProfilerEvent.h.

Member Enumeration Documentation

◆ Event

Describes the types of Event.

Deprecated:
This enum is deprecated since version 2.5.0. Please use the following method: getSupportedEvents(const Profiler&, std::vector<EventInfo>&) to get supported events.
Enumerator
PROFILER_EVENT_DISCONNECTED 

The profiler has disconnected.

PROFILER_EVENT_ALL 

All profiler events.

Definition at line 56 of file ProfilerEvent.h.

Member Function Documentation

◆ getSupportedEvents()

static ErrorStatus mmind::eye::ProfilerEvent::getSupportedEvents ( const Profiler profiler,
std::vector< EventInfo > &  eventInfos 
)
static

Get supported events by the profiler.

Parameters
profilerThe profiler for which to get supported events.
eventInfosThe information of the events supported.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid camera handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Camera disconnected.

◆ registerProfilerEventCallback() [1/2]

static ErrorStatus mmind::eye::ProfilerEvent::registerProfilerEventCallback ( Profiler profiler,
EventCallback  callback,
void *  pUser,
unsigned int  events 
)
static

Registers a profiler event of interest.

Deprecated:
This method is deprecated since version 2.5.0. Please use the following method: registerProfilerEventCallback(Profiler&, uint16_t, const ProfilerEventCallback&).
Parameters
[in]profilerThe profiler handle.
[in]callbackThe callback function for responding to profiler events.
[in]pUserPointer used by the user.
[in]eventsThe profiler event. See ProfilerEvent::Event for details.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid profiler handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Profiler disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Not supported profiler model or firmware version.

◆ registerProfilerEventCallback() [2/2]

static ErrorStatus mmind::eye::ProfilerEvent::registerProfilerEventCallback ( Profiler profiler,
uint16_t  event,
const ProfilerEventCallback callback 
)
static

Registers a callback function to be executed when the specified Event occurs on the specified Profiler object.

Parameters
profilerThe profiler for which the callback function is registered.
eventThe event for which the callback function is registered.
callbackThe callback function to be executed when the specified event occurs.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid profiler handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Profiler disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported profiler model or firmware version.
ErrorStatus::MMIND_STATUS_INVALID_CALLBACKFUNC The registered callback function is invalid.
ErrorStatus.MMIND_STATUS_DUPLICATED_REGISTRATION A callback function for this event has already been registered.
ErrorStatus::MMIND_STATUS_MESSAGE_CHANNEL_ERROR Failed to establish the channel for delivering the event occurrence.

◆ unregisterProfilerEventCallback()

static ErrorStatus mmind::eye::ProfilerEvent::unregisterProfilerEventCallback ( Profiler profiler,
uint16_t  event 
)
static

Cancels the registration of a callback function for the specified event and Profiler object.

Parameters
profilerThe Profiler for which to cancel the registration of the callback function.
eventThe event for which to cancel the registration of the callback function.
Returns
ErrorStatus::MMIND_STATUS_SUCCESS Success.
ErrorStatus::MMIND_STATUS_INVALID_DEVICE Invalid profiler handle.
ErrorStatus::MMIND_STATUS_DEVICE_OFFLINE Profiler disconnected.
ErrorStatus::MMIND_STATUS_NO_SUPPORT_ERROR Unsupported profiler model or firmware version.
ErrorStatus::MMIND_STATUS_INVALID_CALLBACKFUNC The registered callback function is invalid.
ErrorStatus::MMIND_STATUS_MESSAGE_CHANNEL_ERROR Failed to close the channel for delivering the event occurrence.

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