template<class T> struct sstack;
template<class T,class K> struct Assoc;
template<class T> struct List;
+template<class T> struct Link_list;
template<class T> struct Pointer_list;
-template<class T> struct IPointer_list;
template<class T> struct Cursor;
template<class T> struct PCursor;
template<class T> struct Link;
items are always stored as copies in List, but:
#List<String># : copies of #String# stored
#List<String*># : copies of #String*# stored!
- (do not use, use \Ref{Pointer_list} #<String*># instead.)
+ (do not use, use \Ref{Link_list} #<String*># instead.)
{\bf note:}
retrieving "invalid" cursors, i.e.
#include "plist.hh"
#include "cursor.hh"
-/** cursor to go with Pointer_list.
- don't create Pointer_list<void*>'s.
+/** cursor to go with Link_list.
+ don't create Link_list<void*>'s.
This cursor is just an interface class for Cursor. It takes care of the
appropriate type casts
*/
template<class T>
class PCursor : private Cursor<void *> {
- friend class IPointer_list<T>;
+ friend class Pointer_list<T>;
/// delete contents
void junk();
return remove_p();
}
- Pointer_list<T> &list() { return (Pointer_list<T>&)Cursor<void*>::list(); }
+ Link_list<T> &list() { return (Link_list<T>&)Cursor<void*>::list(); }
PCursor<T> operator++(int) { return Cursor<void*>::operator++(0);}
PCursor<T> operator--(int) { return Cursor<void*>::operator--(0); }
PCursor<T> operator+=(int i) { return Cursor<void*>::operator+=(i);}
PCursor<T> operator-=(int i) { return Cursor<void*>::operator-=(i); }
PCursor<T> operator -(int no) const { return Cursor<void*>::operator-(no);}
int operator -(PCursor<T> op) const { return Cursor<void*>::operator-(op);}
- PCursor<T> operator +( int no) const {return Cursor<void*>::operator+(no);} PCursor(const Pointer_list<T> & l) : Cursor<void*> (l) {}
+ PCursor<T> operator +( int no) const {return Cursor<void*>::operator+(no);} PCursor(const Link_list<T> & l) : Cursor<void*> (l) {}
PCursor() : Cursor<void*> () {}
PCursor( const Cursor<void*>& cursor ) : Cursor<void*>(cursor) { }
void* vptr() const { return *((Cursor<void*> &) *this); }
/**
A list of pointers.
- Use for list of pointers, e.g. Pointer_list<AbstractType*>.
+ Use for list of pointers, e.g. Link_list<AbstractType*>.
This class does no deletion of the pointers, but it knows how to
copy itself (shallow copy). We could have derived it from List<T>,
- but this design saves a lot of code dup; for all Pointer_lists in the
+ but this design saves a lot of code dup; for all Link_lists in the
program only one parent List<void*> is instantiated.
*/
template<class T>
-class Pointer_list : public List<void *>
+class Link_list : public List<void *>
{
public:
PCursor<T> top() const{
return PCursor<T> (List<void*>::bottom());
}
PCursor<T> find(T) const;
- void concatenate(Pointer_list<T> const &s) { List<void*>::concatenate(s); }
- Pointer_list() {}
+ void concatenate(Link_list<T> const &s) { List<void*>::concatenate(s); }
+ Link_list() {}
};
-/** Pointer_list which deletes pointers given to it.
+/** Link_list which deletes pointers given to it.
NOTE:
The copy constructor doesn't do what you'd want:
new T(*cursor)
- You have to copy this yourself, or use the macro Pointer_list__copy
+ You have to copy this yourself, or use the macro Link_list__copy
*/
template<class T>
-class IPointer_list : public Pointer_list<T> {
+class Pointer_list : public Link_list<T> {
public:
- IPointer_list(IPointer_list const &) { set_empty(); }
- IPointer_list() { }
- ~IPointer_list();
+ Pointer_list(Pointer_list const &) { set_empty(); }
+ Pointer_list() { }
+ ~Pointer_list();
};
-#define IPointer_list__copy(T, to, from, op) \
+#define Pointer_list__copy(T, to, from, op) \
for (PCursor<T> _pc_(from); _pc_.ok(); _pc_++)\
to.bottom().add(_pc_->op)\
\
template<class T>
-void PL_copy(IPointer_list<T*> &dst,IPointer_list<T*> const&src);
+void PL_copy(Pointer_list<T*> &dst,Pointer_list<T*> const&src);
private:
const File_path * path_C_;
void add( Source_file* sourcefile_p );
- IPointer_list<Source_file*> sourcefile_p_iplist_;
+ Pointer_list<Source_file*> sourcefile_p_iplist_;
bool binary_b_ ;
};
make sure that they reach the beam and that point in the correct
direction */
struct Beam: public Directional_spanner {
- Pointer_list<Stem*> stems;
+ Link_list<Stem*> stems;
/// the slope of the beam in posns / point (dimension)
Real slope;
#include "voice.hh"
#include "moment.hh"
-struct Voice_list : public Pointer_list<Voice*> {
+struct Voice_list : public Link_list<Voice*> {
void translate_time(Moment dt);
};
/// Complex_music consists of multiple voices
struct Complex_music : Input_music {
- IPointer_list<Input_music*> elts;
+ Pointer_list<Input_music*> elts;
/* *************** */
virtual void transpose(Melodic_req const&) const ;
virtual void set_default_group(String g);
#include "input.hh"
struct Input_register : Input {
- IPointer_list<Input_register*> ireg_list_;
+ Pointer_list<Input_register*> ireg_list_;
String name_str_;
void add(Input_register*);
/// paper_, staffs_ and commands_ form the problem definition.
Paper_def *paper_p_;
Midi_def* midi_p_;
- IPointer_list<Input_staff*> staffs_;
+ Pointer_list<Input_staff*> staffs_;
/* *************************************************************** */
class Input_staff:public Input {
public:
- IPointer_list<Input_music*> music_;
+ Pointer_list<Input_music*> music_;
Input_register * ireg_p_;
/* *************** */
/** a group of individually translated symbols. You can add molecules
to the top, to the right, etc. */
struct Molecule {
- IPointer_list<Atom*> ats; // change to List<Atom>?
+ Pointer_list<Atom*> ats; // change to List<Atom>?
/* *************** */
class PCol {
public:
- Pointer_list<Item const *> its;
- Pointer_list<Spanner const *> stoppers, starters;
+ Link_list<Item const *> its;
+ Link_list<Spanner const *> stoppers, starters;
/** prebreak is put before end of line.
if broken here, then (*this) column is discarded, and prebreak
Paper_def *paper_l_;
/// the columns, ordered left to right
- IPointer_list<PCol *> cols;
+ Pointer_list<PCol *> cols;
/// the idealspacings, no particular order
- IPointer_list<Idealspacing*> suz;
+ Pointer_list<Idealspacing*> suz;
/// the staffs ordered top to bottom
- IPointer_list<PStaff*> staffs;
+ Pointer_list<PStaff*> staffs;
/// all symbols in score. No particular order.
- IPointer_list<Item*> its;
+ Pointer_list<Item*> its;
/// if broken, the different lines
- IPointer_list<Line_of_score*> lines;
+ Pointer_list<Line_of_score*> lines;
/// crescs etc; no particular order
- IPointer_list<Spanner *> spanners;
+ Pointer_list<Spanner *> spanners;
/// broken spanners
- IPointer_list<Spanner*> broken_spans;
+ Pointer_list<Spanner*> broken_spans;
/* *************** */
/* CONSTRUCTION */
PScore * pscore_l_;
- Pointer_list<Spanner const *> spans;
- Pointer_list<Item*> its;
+ Link_list<Spanner const *> spans;
+ Link_list<Item*> its;
/* *************** */
void add(Item*i);
class Pulk_voices
{
PQueue< Voice_l > voice_pq_;
- IPointer_list< Pulk_voice * > pulk_p_list_;
- Pointer_list<Staff *> staff_l_list_;
+ Pointer_list< Pulk_voice * > pulk_p_list_;
+ Link_list<Staff *> staff_l_list_;
Moment next_mom_;
public:
Moment last_;
bool ok() const;
Moment next_mom() { return next_mom_; }
- Pulk_voices(Pointer_list<Staff*> const&);
+ Pulk_voices(Link_list<Staff*> const&);
void get_aligned_request(Request_column *col_l );
};
*/
class Register_group_register : public Request_register {
protected:
- IPointer_list<Request_register*> reg_list_;
+ Pointer_list<Request_register*> reg_list_;
virtual void do_print()const;
public:
/// paper_, staffs_ and commands_ form the problem definition.
Paper_def *paper_p_;
Midi_def *midi_p_;
- IPointer_list<Staff*> staffs_;
+ Pointer_list<Staff*> staffs_;
/// "runtime" fields for setting up spacing
- IPointer_list<Request_column*> rcols_;
+ Pointer_list<Request_column*> rcols_;
- IPointer_list<Score_column*> cols_;
+ Pointer_list<Score_column*> cols_;
PScore *pscore_p_;
Input input_;
/// the columns of a score that form one line.
struct
Line_of_score {
- Pointer_list<PCol *> cols;
+ Link_list<PCol *> cols;
bool error_mark_b_;
// need to store height of each staff.
- IPointer_list<Line_of_staff*> staffs;
+ Pointer_list<Line_of_staff*> staffs;
PScore * pscore_l_; // needed to generate staffs
/* *************** */
public:
Input_register * ireg_p_;
- Pointer_list<Voice*> voice_list_;
+ Link_list<Voice*> voice_list_;
/// runtime field
- Pointer_list<Staff_column*> cols_;
+ Link_list<Staff_column*> cols_;
Score *score_l_;
PScore *pscore_l_;
/* *************************************************************** */
- void add(const Pointer_list<Voice*> &s);
+ void add(const Link_list<Voice*> &s);
void add_voice(Voice *v_p);
Paper_def*paper()const;
Voice_element */
Moment duration_;
Voice const *voice_C_;
- IPointer_list<Request*> req_p_list_;
+ Pointer_list<Request*> req_p_list_;
Request * principal_req_l_;
/* *************** */
/** the elements, earliest first.
Please use the member #add()# to add a new element
*/
- IPointer_list<Voice_element *> elts_;
+ Pointer_list<Voice_element *> elts_;
Moment start_;
/* *************** */
#include "request-column.hh"
#include "debug.hh"
-Pulk_voices::Pulk_voices(Pointer_list<Staff*> const& l)
+Pulk_voices::Pulk_voices(Link_list<Staff*> const& l)
: staff_l_list_(l)
{
int staff_i = 0;
void
-Staff::add(Pointer_list<Voice*> const &l)
+Staff::add(Link_list<Voice*> const &l)
{
for (iter_top(l,i); i.ok(); i++)
voice_list_.bottom().add(i);
/*
- template4.cc -- instantiate Pointer_list baseclass.
+ template4.cc -- instantiate Link_list baseclass.
source file of the LilyPond music typesetter
void process();
private:
- IPointer_list<Midi_track*> midi_track_p_list_;
+ Pointer_list<Midi_track*> midi_track_p_list_;
int format_i_;
int tracks_i_;
int tempo_i_;