BrahmsCore documentation
Index
Annotated List
Hierarchy
Globals
Files

class Compound

The compound class is an abstract class to provide some list features.

Contains pure virtuals

#include <unselect.h>

Inherits: Element

Inherited by: Table, Part, Track, AudioTrack, CommentTrack, DrumTrack, MasterTrack, ScoreTrack, Song, Vector, Selection

More...


List of all Methods

Public Members

Protected Members


Detailed Description

The compound class is an abstract class to provide some list features. The simplest implementation is the vector.


Compound ()

empty constructor


Compound (Compound * c,Type)

makes a copy of all elements contained in c, using the copy() method


~Compound () [virtual]

calls the scratch() method


void scratch ()

removes and(!) deletes all elements from the compound (using the element's remove() method and calling delete). Caution: The table class has an own scratch method, but don't make this method virtual!


Element * content ()

returns the content (usually the first element) of the compound


Element * get (int n)

returns the n'th element of the compound


Element * next (Element * e)

returns the successor of e


Element * prev (Element * e)

returns the predecessor of e


void splitBefore (Element * e)

splits the compound before an element w


Element * first ()

returns the first element of the compound


Element * last ()

returns the last element of the compound


int size ()

returns the number of elements


bool empty ()

returns true if emtpy


void add (Element * e) [virtual]

this method appends an element to the compound at the very end. It is declared virtual to allow special compound to implement a more sophisticated add method, e.g. the Part wants to have the events time ordered!


void push (Element * e)

adds an element e at the beginning of the compound


void insertBefore (Element * ne, Element * base)

adds an element ne before the element base


void insertAt (int i, Element *e )

adds an element e at position i


void replace (Element * e1, Element * e2)

This method replaces the elements e1 and e2. e1 has to belong to the content of the compound object. e2 may not(!) be the first element in any compound object. In most cases, e2 is free (does not belong to a compound), but it still works fine, if it is just not the first element in a compound


void remove (Element *)

does not(!) delete the element, but removes it from the list.


Element * cutFirst ()

removes (does not delete!) the first element from the compound and returns it


Element * cutLast ()

removes (does not delete!) the last element from the compound and returns it


void setContent (Element*)

sets the compounds content


void hide () [virtual]

overload this, if this element has a presentation, and delegate to it


void show () [virtual]

overload this, if this element has a presentation, and delegate to it


ostream & print (int,ostream&) [pure virtual]

implement this to define output for each element


void flush (char*) [virtual]

implement this to define short output for each element


Element * copy () [pure virtual]

implement this to define the copy process for each element


Generated by: wuerthne@clouseau on Fri Jan 19 23:08:00 200.