libmapper 2.4.12
mapper::List< T > Class Template Reference

#include <mapper_cpp.h>

Public Member Functions

int size ()
 
Listjoin (const List &rhs)
 
Listintersect (const List &rhs)
 
template<typename P , typename V >
Listfilter (P &&prop, V &&value, Operator op)
 
Listsubtract (const List &rhs)
 
List operator+ (const List &rhs) const
 
List operator* (const List &rhs) const
 
List operator- (const List &rhs) const
 
Listoperator+= (const List &rhs)
 
Listoperator*= (const List &rhs)
 
Listoperator-= (const List &rhs)
 
template<typename... Values>
Listset_property (const Values... vals)
 
operator[] (int idx)
 
virtual operator std::vector< T > () const
 

Detailed Description

template<class T>
class mapper::List< T >

List objects provide a lazily-computed iterable list of results from running queries against a mapper::Graph.

Member Function Documentation

◆ filter()

template<class T >
template<typename P , typename V >
List & mapper::List< T >::filter ( P && prop,
V && value,
Operator op )

Filter items from this List based on property matching

Parameters
propThe name or id of the property to match.
valueThe property value.
opThe comparison operator.
Returns
Self.

◆ intersect()

template<class T >
List & mapper::List< T >::intersect ( const List< T > & rhs)
inline

Remove items NOT found in List rhs from this List

Parameters
rhsA second List.
Returns
Self.

◆ join()

template<class T >
List & mapper::List< T >::join ( const List< T > & rhs)
inline

Add items found in List rhs to this List (without duplication).

Parameters
rhsA second List.
Returns
Self.

◆ operator std::vector< T >()

template<class T >
virtual mapper::List< T >::operator std::vector< T > ( ) const
inlinevirtual

Convert this List to a std::vector of CLASS_NAME.

Returns
The converted List results.

◆ operator*()

template<class T >
List mapper::List< T >::operator* ( const List< T > & rhs) const
inline

Remove items NOT found in List rhs from this List

Parameters
rhsA second List.
Returns
A new List containing the results.

◆ operator*=()

template<class T >
List & mapper::List< T >::operator*= ( const List< T > & rhs)
inline

Remove items NOT found in List rhs from this List

Parameters
rhsA second List.
Returns
Self.

◆ operator+()

template<class T >
List mapper::List< T >::operator+ ( const List< T > & rhs) const
inline

Add items found in List rhs to this List (without duplication).

Parameters
rhsA second List.
Returns
A new List containing the results.

◆ operator+=()

template<class T >
List & mapper::List< T >::operator+= ( const List< T > & rhs)
inline

Add items found in List rhs to this List (without duplication).

Parameters
rhsA second List.
Returns
Self.

◆ operator-()

template<class T >
List mapper::List< T >::operator- ( const List< T > & rhs) const
inline

Remove items found in List rhs from this List

Parameters
rhsA second List.
Returns
A new List containing the results.

◆ operator-=()

template<class T >
List & mapper::List< T >::operator-= ( const List< T > & rhs)
inline

Remove items found in List rhs from this List

Parameters
rhsA second List.
Returns
Self.

◆ operator[]()

template<class T >
T mapper::List< T >::operator[] ( int idx)
inline

Retrieve an indexed item in the List.

Parameters
idxThe index of the element to retrieve.
Returns
The retrieved Object.

◆ set_property()

template<class T >
template<typename... Values>
List & mapper::List< T >::set_property ( const Values... vals)

Set properties for each Object in the List.

Parameters
valsThe Properties to add of modify.
Returns
Self.

◆ size()

template<class T >
int mapper::List< T >::size ( )
inline

Return the number ot items in a List

Returns
The number of items in this list.

◆ subtract()

template<class T >
List & mapper::List< T >::subtract ( const List< T > & rhs)
inline

Remove items found in List rhs from this List

Parameters
rhsA second list.
Returns
Self.