type()

Post Reply
bjkwon
Posts: 109
Joined: September 26th, 2018, 9:36 pm

type()

Post by bjkwon » September 26th, 2020, 7:52 pm

//Let sig be a CVar object.
Is it a string: sig.IsString()
Is it a boolean sig.IsBool()
Is it complex? sig.IsComplex()
Is It a GO? sig.IsGO()

uint16_t type = sig.type();

If the object is non-cell, non-strut, non-handle=================
Is it a time signal (audio, time series): type >= TYPEBIT_TEMPORAL
Is it an audio signal? type >= TYPEBIT_TEMPORAL && type < TYPEBIT_SNAP
Is it a time series? type >= TYPEBIT_SNAP
Is it a non-temporal constant or vector? type < TYPEBIT_TEMPORAL

If the object may be a cell, strut, or handle=================
Is it a time signal (audio, time series): type & 0x000F >= TYPEBIT_TEMPORAL
Is it an audio signal? type & 0x000F >= TYPEBIT_TEMPORAL && type & 0x000F < TYPEBIT_SNAP
Is it a time series? type & 0x000F >= TYPEBIT_SNAP
Is it a non-temporal constant or vector? type & 0x000F < TYPEBIT_TEMPORAL

Is it strut? type & TYPEBIT_STRUT
Is it cell? type & TYPEBIT_CELL
Is it a handle? type & TYPEBIT_STRUT && (needs more work)

TYPEBIT_STRUT can be anything below the TYPEBIT_STRUT level
Last edited by bjkwon on September 26th, 2020, 9:59 pm, edited 2 times in total.

bjkwon
Posts: 109
Joined: September 26th, 2018, 9:36 pm

Re: type()

Post by bjkwon » September 26th, 2020, 9:47 pm

fig: A named figure object
fig.IsString() --> true
fig.IsGO() --> true

Post Reply