libmapper 2.4.12
|
#include <mapper_cpp.h>
Public Types | |
enum class | Event { OBJ_NEW = MPR_OBJ_NEW , OBJ_MOD = MPR_OBJ_MOD , OBJ_REM = MPR_OBJ_REM , OBJ_EXP = MPR_OBJ_EXP } |
![]() | |
enum class | Status { UNDEFINED = MPR_STATUS_UNDEFINED , EXPIRED = MPR_STATUS_EXPIRED , NEW = MPR_STATUS_NEW , MODIFIED = MPR_STATUS_MODIFIED , STAGED = MPR_STATUS_STAGED , ACTIVE = MPR_STATUS_ACTIVE , REMOVED = MPR_STATUS_REMOVED , HAS_VALUE = MPR_STATUS_HAS_VALUE , NEW_VALUE = MPR_STATUS_NEW_VALUE , UPDATE_LOC = MPR_STATUS_UPDATE_LOC , UPDATE_REM = MPR_STATUS_UPDATE_REM , REL_UPSTRM = MPR_STATUS_REL_UPSTRM , REL_DNSTRM = MPR_STATUS_REL_DNSTRM , INST_OFLW = MPR_STATUS_OVERFLOW , ANY = MPR_STATUS_ANY } |
Public Member Functions | |
Graph (Type types=Type::OBJECT) | |
Graph & | set_iface (const str_type &iface) |
std::string | iface () const |
Graph & | set_address (const str_type &group, int port) |
std::string | address () const |
int | poll (int block_ms=0) const |
Graph & | start (int block_ms=100) |
Graph & | stop () |
const Graph & | subscribe (const device_type &dev, Type types, int timeout) |
const Graph & | subscribe (Type types) |
const Graph & | unsubscribe (const device_type &dev) |
const Graph & | unsubscribe () |
template<typename T > | |
const Graph & | add_callback (void(*h)(Graph &&, T &&, Graph::Event), Type types=Type::OBJECT) |
const Graph & | remove_callback (void(*h)(Graph &&, Object &&, Graph::Event)) |
List< Device > | devices () const |
List< Signal > | signals () const |
List< Map > | maps () const |
const Graph & | push () const |
![]() | |
operator bool () const | |
Type | type () const |
Graph | graph () const |
int | get_status () const |
Object & | reset_status () |
template<typename... Values> | |
Object & | set_property (const Values... vals) |
template<typename... Values> | |
Object & | set_local_property (const Values... vals) |
virtual Object & | remove_property (Property prop) |
virtual Object & | remove_property (const str_type &key) |
int | num_props (bool staged=false) const |
PropVal | property (const str_type &key=NULL) const |
PropVal | property (Property prop) const |
PropVal | property (int idx) const |
Graphs are the primary interface through which a program may observe the network and store information about Devices and Signals that are present. Each Graph stores records of Devices, Signals, and Maps, which can be queried.
|
strong |
|
inline |
Create a peer in the libmapper distributed graph.
types | Sets whether the graph should automatically subscribe to information about Signals and Maps when it encounters a previously-unseen Device. |
|
inline |
Register a callback for when an Object record is added, updated, or removed.
h | Callback function. |
types | Bitflags setting the type of information of interest. Can be a combination of Type values. |
|
inline |
Retrieve the multicast url currently in use.
|
inline |
Return a string indicating the name of the network interface in use.
|
inline |
Synchronize a Graph object with the distributed graph.
block_ms | The number of milliseconds to block, or 0 for non-blocking behavior. |
|
inlinevirtual |
Push "staged" property changes out to the distributed graph.
Reimplemented from mapper::Object.
|
inline |
|
inline |
Specify the multicast group and port to use.
group | A string specifying the multicast group to use. |
port | The multicast port to use. |
|
inline |
Specify the network interface to use.
iface | A string specifying the name of the network interface to use. |
|
inline |
Start automatically synchronizing a Graph object in a separate thread.
block_ms | The number of milliseconds to block on each iteration, or <0 to process all incoming messages. |
|
inline |
Stop automatically synchronizing a Graph object in a separate thread.
|
inline |
Subscribe to information about a specific Device.
dev | The Device of interest. |
types | Bitflags setting the type of information of interest. Can be a combination of MPR_DEV, MPR_SIG_IN, MPR_SIG_OUT, MPR_SIG, MPR_MAP_IN, MPR_MAP_OUT, MPR_MAP, or simply MPR_OBJ for all information. |
timeout | The desired duration in seconds for this subscription. If set to -1, the graph will automatically renew the subscription until it is freed or this function is called again. |
|
inline |
Subscribe to information about all discovered Devices.
types | Bitflags setting the type of information of interest. Can be a combination of MPR_DEV, MPR_SIG_IN, MPR_SIG_OUT, MPR_SIG, MPR_MAP_IN, MPR_MAP_OUT, MPR_MAP, or simply MPR_OBJ for all information. |
|
inline |
Cancel all subscriptions.