sACN  2.0.2
Implementation of ANSI E1.31 (Streaming ACN)
View other versions:
SourceDetector::NotifyHandler Class Referenceabstract

A base class for a class that receives notification callbacks from a sACN Source Detector. More...

Public Member Functions

virtual void HandleSourceUpdated (RemoteSourceHandle handle, const etcpal::Uuid &cid, const std::string &name, const std::vector< uint16_t > &sourced_universes)=0
 Notify that a source is new or has changed. More...
 
virtual void HandleSourceExpired (RemoteSourceHandle handle, const etcpal::Uuid &cid, const std::string &name)=0
 Notify that a source is no longer transmitting Universe Discovery messages. More...
 
virtual void HandleMemoryLimitExceeded ()
 Notify that the module has run out of memory to track universes or sources. More...
 

Detailed Description

A base class for a class that receives notification callbacks from a sACN Source Detector.

Member Function Documentation

◆ HandleMemoryLimitExceeded()

virtual void HandleMemoryLimitExceeded ( )
inlinevirtual

Notify that the module has run out of memory to track universes or sources.

If SACN_DYNAMIC_MEM was defined to 1 when sACN was compiled (the default on non-embedded platforms), and the configuration you pass to Startup() has source_count_max and universes_per_source_max set to SACN_SOURCE_DETECTOR_INFINITE, this callback will never be called (except for the rare case where a heap allocation function fails).

If SACN_DYNAMIC_MEM was defined to 0 when sACN was compiled, source_count_max and universes_per_source_max are ignored and SACN_SOURCE_DETECTOR_MAX_SOURCES and SACN_SOURCE_DETECTOR_MAX_UNIVERSES_PER_SOURCE are used instead.

This callback is rate-limited: it will only be called the first time a source or universe limit is exceeded. After that, it will not be called until the number of sources or universes has dropped below their limit and hits it again.

◆ HandleSourceExpired()

virtual void HandleSourceExpired ( RemoteSourceHandle  handle,
const etcpal::Uuid cid,
const std::string name 
)
pure virtual

Notify that a source is no longer transmitting Universe Discovery messages.

Parameters
[in]handleThe handle uniquely identifying the source.
[in]cidThe CID of the source.
[in]nameThe UTF-8 name string.

◆ HandleSourceUpdated()

virtual void HandleSourceUpdated ( RemoteSourceHandle  handle,
const etcpal::Uuid cid,
const std::string name,
const std::vector< uint16_t > &  sourced_universes 
)
pure virtual

Notify that a source is new or has changed.

This passes the source's current universe list, but you will only get this callback when the module detects that the source is new or the list has somehow changed.

The protocol requires the list of sourced universes to be numerically sorted. The library enforces this rule by checking that the universe list is in ascending order before notifying.

Parameters
[in]handleThe handle uniquely identifying the source.
[in]cidThe CID of the source.
[in]nameThe UTF-8 name string.
[in]sourced_universesNumerically sorted array of the currently sourced universes. Will be empty if the source is not currently transmitting any universes.

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