tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
ceammc::AtomList Class Reference

#include <ceammc_atomlist.h>

Public Types

enum  NonEqualLengthBehaivor {
  MINSIZE = 0, PADZERO, CLIP, WRAP,
  FOLD
}
 

Public Member Functions

 AtomList ()
 
 AtomList (const Atom &a)
 
 AtomList (const Atom &a, const Atom &b)
 
 AtomList (size_t n, t_atom *lst)
 
 AtomList (int n, t_atom *lst)
 
size_t size () const
 
bool empty () const
 
Atomat (size_t pos)
 returns reference to element at specified position More...
 
const Atomat (size_t pos) const
 
Atomoperator[] (size_t pos)
 
const Atomoperator[] (size_t pos) const
 
AtomrelativeAt (int pos)
 
const AtomrelativeAt (int pos) const
 
AtomclipAt (int pos)
 
const AtomclipAt (int pos) const
 
AtomwrapAt (int pos)
 
const AtomwrapAt (int pos) const
 
AtomfoldAt (int pos)
 
const AtomfoldAt (int pos) const
 
void resizePad (size_t n, const Atom &v)
 
void resizeClip (size_t n)
 
void resizeWrap (size_t n)
 
void resizeFold (size_t n)
 
bool property (const std::string &name, Atom *dest) const
 
std::deque< AtomListproperties () const
 
bool hasProperty (const std::string &name) const
 
AtomList slice (int start) const
 
AtomList slice (int start, int end, size_t step=1) const
 
void fromPdData (size_t n, t_atom *lst)
 
void fromPdData (int n, t_atom *lst)
 
t_atomtoPdData () const
 
void append (const Atom &a)
 
void append (const AtomList &l)
 
bool insert (size_t pos, const Atom &a)
 
bool insert (size_t pos, const AtomList &l)
 
bool remove (size_t pos)
 
void removeAll (const Atom &a)
 
void removeAll (AtomPredicate pred)
 
void replaceAll (const Atom &old_value, const Atom &new_value)
 
void replaceAll (AtomPredicate pred, const Atom &new_value)
 
void clear ()
 
void fill (const Atom &a)
 
void fill (const Atom &a, size_t sz)
 
Atomfirst ()
 
Atomlast ()
 
const Atomfirst () const
 
const Atomlast () const
 
void sort ()
 
void shuffle ()
 
void reverse ()
 
AtomList subList (int begin, int end)
 
AtomList filtered (AtomPredicate pred) const
 
const Atommin () const
 
const Atommax () const
 
bool range (Atom &min, Atom &max) const
 
const Atomfind (const Atom &a) const
 
const Atomfind (AtomPredicate pred) const
 
const AtomfindLast (const Atom &a) const
 
const AtomfindLast (AtomPredicate pred) const
 
Atommin ()
 
Atommax ()
 
Atomfind (const Atom &a)
 
Atomfind (AtomPredicate pred)
 
AtomfindLast (const Atom &a)
 
AtomfindLast (AtomPredicate pred)
 
float sum () const
 
float product () const
 
bool contains (const Atom &a) const
 
int findPos (const Atom &a) const
 
int findPos (AtomPredicate pred) const
 
size_t count (const Atom &a) const
 
size_t count (AtomPredicate pred) const
 
bool allOff (AtomPredicate pred) const
 
bool anyOff (AtomPredicate pred) const
 
bool noneOff (AtomPredicate pred) const
 
FloatList asFloats () const
 
size_t asSizeT (size_t defaultValue=0) const
 
void outputAtoms (t_outlet *x) const
 output list atoms separatly, one by one More...
 
void output (t_outlet *x) const
 
void outputAsAny (t_outlet *x) const
 
void outputAsAny (t_outlet *x, t_symbol *s) const
 
template<typename T >
reduce (T init, T(*fn)(const Atom &, const Atom &)) const
 
t_float reduceFloat (t_float init, t_float def, t_float(*fn)(t_float, t_float)) const
 
bool normalizeFloats ()
 
AtomListoperator+= (double v)
 
AtomListoperator-= (double v)
 
AtomListoperator*= (double v)
 
AtomListoperator/= (double v)
 
AtomList operator+ (double v) const
 
AtomList operator- (double v) const
 
AtomList operator* (double v) const
 
AtomList operator/ (double v) const
 

Static Public Member Functions

static AtomList zeroes (size_t n)
 
static AtomList ones (size_t n)
 
static AtomList filled (const Atom &a, size_t n)
 
static AtomList values (size_t n,...)
 
static AtomList add (const AtomList &a, const AtomList &b, NonEqualLengthBehaivor lb=MINSIZE)
 returns new list that is a sum of original list values and new list ("l") values More...
 
static AtomList sub (const AtomList &a, const AtomList &b, NonEqualLengthBehaivor lb=MINSIZE)
 returns new list that contains difference from given lists More...
 

Friends

bool operator== (const AtomList &l1, const AtomList &l2)
 
bool operator!= (const AtomList &l1, const AtomList &l2)
 

Member Enumeration Documentation

Enumerator
MINSIZE 
PADZERO 
CLIP 
WRAP 
FOLD 

Constructor & Destructor Documentation

ceammc::AtomList::AtomList ( )
ceammc::AtomList::AtomList ( const Atom a)
ceammc::AtomList::AtomList ( const Atom a,
const Atom b 
)
ceammc::AtomList::AtomList ( size_t  n,
t_atom lst 
)
ceammc::AtomList::AtomList ( int  n,
t_atom lst 
)
explicit

Member Function Documentation

static AtomList ceammc::AtomList::add ( const AtomList a,
const AtomList b,
NonEqualLengthBehaivor  lb = MINSIZE 
)
static

returns new list that is a sum of original list values and new list ("l") values

Parameters
l- list
b- behaivor flag, when lists are different lengths
Returns
new list
bool ceammc::AtomList::allOff ( AtomPredicate  pred) const
bool ceammc::AtomList::anyOff ( AtomPredicate  pred) const
void ceammc::AtomList::append ( const Atom a)
void ceammc::AtomList::append ( const AtomList l)
FloatList ceammc::AtomList::asFloats ( ) const
size_t ceammc::AtomList::asSizeT ( size_t  defaultValue = 0) const
Atom& ceammc::AtomList::at ( size_t  pos)

returns reference to element at specified position

Parameters
pos- position (starting from 0)
Returns
reference to element
Exceptions
exceptionif invalid position given
const Atom& ceammc::AtomList::at ( size_t  pos) const
void ceammc::AtomList::clear ( )
Atom* ceammc::AtomList::clipAt ( int  pos)

Same as at(), but values for index greater than the size of the List will be clipped to the last index.

Parameters
pos- position index
Returns
pointer to element, or NULL if empty
const Atom* ceammc::AtomList::clipAt ( int  pos) const
bool ceammc::AtomList::contains ( const Atom a) const
size_t ceammc::AtomList::count ( const Atom a) const
size_t ceammc::AtomList::count ( AtomPredicate  pred) const
bool ceammc::AtomList::empty ( ) const
void ceammc::AtomList::fill ( const Atom a)
void ceammc::AtomList::fill ( const Atom a,
size_t  sz 
)
static AtomList ceammc::AtomList::filled ( const Atom a,
size_t  n 
)
static
AtomList ceammc::AtomList::filtered ( AtomPredicate  pred) const
const Atom* ceammc::AtomList::find ( const Atom a) const
const Atom* ceammc::AtomList::find ( AtomPredicate  pred) const
Atom* ceammc::AtomList::find ( const Atom a)
Atom* ceammc::AtomList::find ( AtomPredicate  pred)
const Atom* ceammc::AtomList::findLast ( const Atom a) const
const Atom* ceammc::AtomList::findLast ( AtomPredicate  pred) const
Atom* ceammc::AtomList::findLast ( const Atom a)
Atom* ceammc::AtomList::findLast ( AtomPredicate  pred)
int ceammc::AtomList::findPos ( const Atom a) const
int ceammc::AtomList::findPos ( AtomPredicate  pred) const
Atom* ceammc::AtomList::first ( )
const Atom* ceammc::AtomList::first ( ) const
Atom* ceammc::AtomList::foldAt ( int  pos)

Same as at(), but values for index greater than the size of the List will be folded back.

Parameters
pos- position index
Returns
pointer to element, or NULL if empty
const Atom* ceammc::AtomList::foldAt ( int  pos) const
void ceammc::AtomList::fromPdData ( size_t  n,
t_atom lst 
)
void ceammc::AtomList::fromPdData ( int  n,
t_atom lst 
)
bool ceammc::AtomList::hasProperty ( const std::string &  name) const

Checks is has property in list

bool ceammc::AtomList::insert ( size_t  pos,
const Atom a 
)
bool ceammc::AtomList::insert ( size_t  pos,
const AtomList l 
)
Atom* ceammc::AtomList::last ( )
const Atom* ceammc::AtomList::last ( ) const
const Atom* ceammc::AtomList::max ( ) const
Atom* ceammc::AtomList::max ( )
const Atom* ceammc::AtomList::min ( ) const
Atom* ceammc::AtomList::min ( )
bool ceammc::AtomList::noneOff ( AtomPredicate  pred) const
bool ceammc::AtomList::normalizeFloats ( )
static AtomList ceammc::AtomList::ones ( size_t  n)
static
AtomList ceammc::AtomList::operator* ( double  v) const
AtomList& ceammc::AtomList::operator*= ( double  v)
AtomList ceammc::AtomList::operator+ ( double  v) const
AtomList& ceammc::AtomList::operator+= ( double  v)

arithmetic operators

AtomList ceammc::AtomList::operator- ( double  v) const
AtomList& ceammc::AtomList::operator-= ( double  v)
AtomList ceammc::AtomList::operator/ ( double  v) const
AtomList& ceammc::AtomList::operator/= ( double  v)
Atom& ceammc::AtomList::operator[] ( size_t  pos)
const Atom& ceammc::AtomList::operator[] ( size_t  pos) const
void ceammc::AtomList::output ( t_outlet x) const

Outputs list to given outlet

Parameters
x- pointer to outlet
void ceammc::AtomList::outputAsAny ( t_outlet x) const

Outputs list content as any message. First list atom became selector

void ceammc::AtomList::outputAsAny ( t_outlet x,
t_symbol s 
) const

Outputs list content as any message.

Parameters
x- pointer to outlet
s- any selector
void ceammc::AtomList::outputAtoms ( t_outlet x) const

output list atoms separatly, one by one

Parameters
x- output outlet
float ceammc::AtomList::product ( ) const

Returns product of floats in list or 0 if empty

std::deque<AtomList> ceammc::AtomList::properties ( ) const

Returns all properties and their values from list

bool ceammc::AtomList::property ( const std::string &  name,
Atom dest 
) const

Get property value from list

Parameters
name- property name with (starts with '@')
dest- output destination
Returns
true if property was found and it has value
bool ceammc::AtomList::range ( Atom min,
Atom max 
) const
template<typename T >
T ceammc::AtomList::reduce ( init,
T(*)(const Atom &, const Atom &)  fn 
) const
t_float ceammc::AtomList::reduceFloat ( t_float  init,
t_float  def,
t_float(*)(t_float, t_float fn 
) const
Atom* ceammc::AtomList::relativeAt ( int  pos)
const Atom* ceammc::AtomList::relativeAt ( int  pos) const
bool ceammc::AtomList::remove ( size_t  pos)
void ceammc::AtomList::removeAll ( const Atom a)
void ceammc::AtomList::removeAll ( AtomPredicate  pred)
void ceammc::AtomList::replaceAll ( const Atom old_value,
const Atom new_value 
)
void ceammc::AtomList::replaceAll ( AtomPredicate  pred,
const Atom new_value 
)
void ceammc::AtomList::resizeClip ( size_t  n)

Resize list. If new size is less than current, last values are dropped. If new size is bigger - pad with last value

Parameters
n- new size
v- pad value
Note
do nothing on empty list
void ceammc::AtomList::resizeFold ( size_t  n)

Resize list. If new size is less than current, last values are dropped. If new size is bigger - fold with list values

Parameters
n- new size
v- pad value
Note
do nothing on empty list
void ceammc::AtomList::resizePad ( size_t  n,
const Atom v 
)

Resize list. If new size is less than current, last values are dropped. If new size is bigger - pad with given value

Parameters
n- new size
v- pad value
void ceammc::AtomList::resizeWrap ( size_t  n)

Resize list. If new size is less than current, last values are dropped. If new size is bigger - wrap with list values

Parameters
n- new size
v- pad value
Note
do nothing on empty list
void ceammc::AtomList::reverse ( )
void ceammc::AtomList::shuffle ( )
size_t ceammc::AtomList::size ( ) const
AtomList ceammc::AtomList::slice ( int  start) const
AtomList ceammc::AtomList::slice ( int  start,
int  end,
size_t  step = 1 
) const
void ceammc::AtomList::sort ( )
static AtomList ceammc::AtomList::sub ( const AtomList a,
const AtomList b,
NonEqualLengthBehaivor  lb = MINSIZE 
)
static

returns new list that contains difference from given lists

Parameters
a- first list
b- second list
lb- behaivor flag, when lists are different lengths
Returns
new list
AtomList ceammc::AtomList::subList ( int  begin,
int  end 
)
float ceammc::AtomList::sum ( ) const

Returns sum of floats in list or 0 if empty

t_atom* ceammc::AtomList::toPdData ( ) const
static AtomList ceammc::AtomList::values ( size_t  n,
  ... 
)
static
Atom* ceammc::AtomList::wrapAt ( int  pos)

Same as at(), but values for index greater than the size of the List will be wrapped around to 0.

Parameters
pos- position index
Returns
pointer to element, or NULL if empty
const Atom* ceammc::AtomList::wrapAt ( int  pos) const
static AtomList ceammc::AtomList::zeroes ( size_t  n)
static

Friends And Related Function Documentation

bool operator!= ( const AtomList l1,
const AtomList l2 
)
friend
bool operator== ( const AtomList l1,
const AtomList l2 
)
friend

The documentation for this class was generated from the following file: