libmapper 2.4.12
mapper::Object Class Reference

#include <mapper_cpp.h>

Inheritance diagram for mapper::Object:
mapper::Device mapper::Graph mapper::Map mapper::Signal

Public Types

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

 operator bool () const
 
Type type () const
 
Graph graph () const
 
int get_status () const
 
Objectreset_status ()
 
template<typename... Values>
Objectset_property (const Values... vals)
 
template<typename... Values>
Objectset_local_property (const Values... vals)
 
virtual Objectremove_property (Property prop)
 
virtual Objectremove_property (const str_type &key)
 
virtual const Objectpush () const
 
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
 

Detailed Description

Objects provide a generic representation of Devices, Signals, and Maps.

Member Enumeration Documentation

◆ Status

enum class mapper::Object::Status
strong

The set of possible statuses for an Object.

Enumerator
UNDEFINED 

Object status is undefined.

EXPIRED 

Object record has expired.

NEW 

Object record is new.

MODIFIED 

Object properties have changed.

STAGED 

Object has been staged.

ACTIVE 

Object is active.

REMOVED 

Object was removed.

HAS_VALUE 

Object has a value.

NEW_VALUE 

Object value has changed since last check.

UPDATE_LOC 

Object value was set locally since last check.

UPDATE_REM 

Object value was set remotely since last check.

REL_UPSTRM 

Object instance was released upstream since last check.

REL_DNSTRM 

Object instance was released downstream since last check.

INST_OFLW 

No local object instances left.

Member Function Documentation

◆ get_status()

int mapper::Object::get_status ( ) const
inline

Get the status bitflags for an Object.

Returns
Status bitflags.

◆ graph()

Graph mapper::Object::graph ( ) const
inline

Get the underlying Graph.

Returns
Graph.

◆ num_props()

int mapper::Object::num_props ( bool staged = false) const
inline

Retrieve the number of Properties owned by an Object.

Parameters
stagedSet to true to count properties that have been staged but not synchronized with the graph.
Returns
The number of Properties.

◆ operator bool()

mapper::Object::operator bool ( ) const
inline

Cast to a boolean value based on whether the underlying C object exists.

Returns
True if object exists, otherwise false.

◆ property() [1/3]

PropVal mapper::Object::property ( const str_type & key = NULL) const
inline

Retrieve a Property by name.

Parameters
keyThe name of the Property to retrieve.
Returns
The retrieved PropVal.

◆ property() [2/3]

PropVal mapper::Object::property ( int idx) const
inline

Retrieve a Property by index.

Parameters
idxThe index of the Property to retrieve.
Returns
The retrieved Property.

◆ property() [3/3]

PropVal mapper::Object::property ( Property prop) const
inline

Retrieve a Property by Property enum value.

Parameters
propThe symbolic identifier of the Property to retrieve.
Returns
The retrieved Property.

◆ push()

virtual const Object & mapper::Object::push ( ) const
inlinevirtual

Push "staged" property changes out to the distributed graph.

Returns
Self.

Reimplemented in mapper::Device, mapper::Graph, mapper::Map, and mapper::Signal.

◆ remove_property() [1/2]

virtual Object & mapper::Object::remove_property ( const str_type & key)
inlinevirtual

Remove a named Property from an Object.

Parameters
keyName of the Property to remove.
Returns
Self.

◆ remove_property() [2/2]

virtual Object & mapper::Object::remove_property ( Property prop)
inlinevirtual

Remove a Property from an Object by symbolic identifier.

Parameters
propThe Property to remove.
Returns
Self.

◆ reset_status()

Object & mapper::Object::reset_status ( )
inline

Reset the ephemeral status bitflags for an Object.

Returns
Self.

◆ set_local_property()

template<typename... Values>
Object & mapper::Object::set_local_property ( const Values... vals)
inline

Set arbitrary properties for an Object but do not push them to the distributed Graph.

Parameters
valsThe Properties to add or modify.
Returns
Self.

◆ set_property()

template<typename... Values>
Object & mapper::Object::set_property ( const Values... vals)
inline

Set arbitrary properties for an Object.

Parameters
valsThe Properties to add or modify.
Returns
Self.

◆ type()

Type mapper::Object::type ( ) const
inline

Get the specific type of an Object.

Returns
Object type.