Previous: Music Type Definitions, Up: music class definition



7.4.4 Functions

— Function: void push_back (const music_details &);

This function adds a music_details expression onto the vector of expressions to be matched. It will also add it to the tree ready for processing against rows.

— Function: music::iterator begin (void);
— Function: music::const_iterator begin (void) const;

These functions return an iterator that points at the beginning of the expression list.

— Function: music::iterator end (void);
— Function: music::const_iterator end (void) const;

These functions return an iterator that points past the end of the expression list.

— Function: music::size_type size (void);

This function returns the number of expressions currently stored.

— Function: void set_bells (const unsigned int &b);

This function sets the number of bells that will be in the matched rows to b.

— Function: template <class RowIterator> void process_rows (RowIterator first, RowIterator last, bool backstroke = false);

This function first resets the all of the music counts, and then processes the supplied rows. If backstroke is true, then a backstroke is assumed to be the first row, otherwise it will be noted as a handstroke. The stroke will be toggled for every row processed.

— Function: int get_score (const EStroke& = eBoth);

Returns the score for music matched at the specified stroke. If eBoth is specified as the stroke, then scores for both strokes are added together and returned.

— Function: unsigned int get_count (const EStroke& = eBoth);

Returns the total number of matches for all music expressions at the specified stroke. If eBoth is specified, then the counts for both strokes are added and returned.

— Function: int get_possible_score (void);

This function returns the maximum possible score that could be obtained matching the expressions currently stored against a true extent on the number of bells previously specified.