libmapper 2.4.12
mapper::Signal::Instance Class Reference

#include <mapper_cpp.h>

Public Member Functions

 operator Id () const
 
int status () const
 
int get_status ()
 
template<typename... Values>
Instanceset_value (Values... vals)
 
Instancerelease ()
 
Id id () const
 
Instanceset_data (void *data)
 
void * data () const
 
const void * value () const
 
const void * value (Time time) const
 
Signal signal () const
 

Detailed Description

Signal Instances can be used to describe the multiplicity and/or ephemerality of phenomena associated with Signals. A signal describes the phenomena, e.g. the position of a 'blob' in computer vision, and the signal's instances will describe the positions of actual detected blobs.

Member Function Documentation

◆ data()

void * mapper::Signal::Instance::data ( ) const
inline

Get the user_data pointer associated with this Instance.

Returns
The user_data pointer.

◆ get_status()

int mapper::Signal::Instance::get_status ( )
inline

Get the status bitflags for this Instance.

Returns
Status bitflags.

◆ id()

Id mapper::Signal::Instance::id ( ) const
inline

Get the Id associated with this Instance.

Returns
The Instance Id.

◆ operator Id()

mapper::Signal::Instance::operator Id ( ) const
inline

get the Id for this Instance.

Returns
The Id.

◆ release()

Instance & mapper::Signal::Instance::release ( )
inline

Release this Instance.

Returns
Self.

◆ set_data()

Instance & mapper::Signal::Instance::set_data ( void * data)
inline

Set the user_data pointer associated with this Instance.

Parameters
dataA user_data pointer to store.
Returns
Self.

◆ set_value()

template<typename... Values>
Instance & mapper::Signal::Instance::set_value ( Values... vals)
inline

Set the current value for this Instance.

Parameters
valsThe value to set. Can be scalar, array, std::array, or std::vector of int, float, or double.
Returns
Self.

◆ signal()

Signal mapper::Signal::Instance::signal ( ) const
inline

Retrieve the parent Signal.

Returns
The Signal parent of this Instance.

◆ status()

int mapper::Signal::Instance::status ( ) const
inline

Return the current status for this Instance.

Returns
The status of the signal instance returned as bitflags. Test the return value against the constants defined in the Signal::Status enum class. Each time this function is called it will reset the bitflags for NEW, SET_*, and REL_*.

◆ value() [1/2]

const void * mapper::Signal::Instance::value ( ) const
inline

Get the current value of this Instance.

Returns
A pointer to the current value.

◆ value() [2/2]

const void * mapper::Signal::Instance::value ( Time time) const
inline

Get the current value of this Instance.

Parameters
timeA Time object to retrieve the time associated with the current value.
Returns
A pointer to the current value.