template<class T> struct sstack;
template<class T,class K> struct Assoc;
template<class T> struct List;
-template<class T> struct PointerList;
-template<class T> struct IPointerList;
+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{PointerList} #<String*># instead.)
+ (do not use, use \Ref{Pointer_list} #<String*># instead.)
{\bf note:}
retrieving "invalid" cursors, i.e.
#include "plist.hh"
#include "cursor.hh"
-/** cursor to go with PointerList.
- don't create PointerList<void*>'s.
+/** cursor to go with Pointer_list.
+ don't create Pointer_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 IPointerList<T>;
+ friend class IPointer_list<T>;
/// delete contents
void junk();
return remove_p();
}
- PointerList<T> &list() { return (PointerList<T>&)Cursor<void*>::list(); }
+ Pointer_list<T> &list() { return (Pointer_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 PointerList<T> & l) : Cursor<void*> (l) {}
+ PCursor<T> operator +( int no) const {return Cursor<void*>::operator+(no);} PCursor(const Pointer_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. PointerList<AbstractType*>.
+ Use for list of pointers, e.g. Pointer_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 PointerLists in the
+ but this design saves a lot of code dup; for all Pointer_lists in the
program only one parent List<void*> is instantiated.
*/
template<class T>
-class PointerList : public List<void *>
+class Pointer_list : public List<void *>
{
public:
PCursor<T> top() const{
return PCursor<T> (List<void*>::bottom());
}
PCursor<T> find(T) const;
- void concatenate(PointerList<T> const &s) { List<void*>::concatenate(s); }
- PointerList() {}
+ void concatenate(Pointer_list<T> const &s) { List<void*>::concatenate(s); }
+ Pointer_list() {}
};
-/** PointerList which deletes pointers given to it.
+/** Pointer_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 PointerList__copy
+ You have to copy this yourself, or use the macro Pointer_list__copy
*/
template<class T>
-class IPointerList : public PointerList<T> {
+class IPointer_list : public Pointer_list<T> {
public:
- IPointerList(IPointerList const &) { set_empty(); }
- IPointerList() { }
- ~IPointerList();
+ IPointer_list(IPointer_list const &) { set_empty(); }
+ IPointer_list() { }
+ ~IPointer_list();
};
-#define IPointerList__copy(T, to, from, op) \
+#define IPointer_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(IPointerList<T*> &dst,IPointerList<T*> const&src);
+void PL_copy(IPointer_list<T*> &dst,IPointer_list<T*> const&src);
template<class T>
void
-PL_copy(IPointerList<T*> &to, IPointerList<T*> const&src)
+PL_copy(IPointer_list<T*> &to, IPointer_list<T*> const&src)
{
for (PCursor<T*> pc(src); pc.ok(); pc++) {
T *q = pc;
#include "plist.hh"
-#define PL_instantiate(a) template class PointerList<a*>; \
+#define PL_instantiate(a) template class Pointer_list<a*>; \
template class PCursor<a*>;
#define IPL_instantiate(a) PL_instantiate(a); \
- template class IPointerList<a*>
+ template class IPointer_list<a*>
template<class T>
-IPointerList<T>::~IPointerList()
+IPointer_list<T>::~IPointer_list()
{
PCursor<T> c( *this );
while (c.ok()) {
template<class T>
PCursor<T>
-PointerList<T>::find(T what ) const
+Pointer_list<T>::find(T what ) const
{
PCursor<T> i(*this);
for (; i.ok(); i++)
make sure that they reach the beam and that point in the correct
direction */
struct Beam: public Directional_spanner {
- PointerList<Stem*> stems;
+ Pointer_list<Stem*> stems;
/// the slope of the beam in posns / point (dimension)
Real slope;
#include "voice.hh"
#include "moment.hh"
-struct Voice_list : public PointerList<Voice*> {
+struct Voice_list : public Pointer_list<Voice*> {
void translate_time(Moment dt);
};
/// Complex_music consists of multiple voices
struct Complex_music : Input_music {
- IPointerList<Input_music*> elts;
+ IPointer_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 {
- IPointerList<Input_register*> ireg_list_;
+ IPointer_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_;
- IPointerList<Input_staff*> staffs_;
+ IPointer_list<Input_staff*> staffs_;
/* *************************************************************** */
class Input_staff:public Input {
public:
- IPointerList<Input_music*> music_;
+ IPointer_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 {
- IPointerList<Atom*> ats; // change to List<Atom>?
+ IPointer_list<Atom*> ats; // change to List<Atom>?
/* *************** */
class PCol {
public:
- PointerList<Item const *> its;
- PointerList<Spanner const *> stoppers, starters;
+ Pointer_list<Item const *> its;
+ Pointer_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
- IPointerList<PCol *> cols;
+ IPointer_list<PCol *> cols;
/// the idealspacings, no particular order
- IPointerList<Idealspacing*> suz;
+ IPointer_list<Idealspacing*> suz;
/// the staffs ordered top to bottom
- IPointerList<PStaff*> staffs;
+ IPointer_list<PStaff*> staffs;
/// all symbols in score. No particular order.
- IPointerList<Item*> its;
+ IPointer_list<Item*> its;
/// if broken, the different lines
- IPointerList<Line_of_score*> lines;
+ IPointer_list<Line_of_score*> lines;
/// crescs etc; no particular order
- IPointerList<Spanner *> spanners;
+ IPointer_list<Spanner *> spanners;
/// broken spanners
- IPointerList<Spanner*> broken_spans;
+ IPointer_list<Spanner*> broken_spans;
/* *************** */
/* CONSTRUCTION */
PScore * pscore_l_;
- PointerList<Spanner const *> spans;
- PointerList<Item*> its;
+ Pointer_list<Spanner const *> spans;
+ Pointer_list<Item*> its;
/* *************** */
void add(Item*i);
class Pulk_voices
{
PQueue< Voice_l > voice_pq_;
- IPointerList< Pulk_voice * > pulk_p_list_;
- PointerList<Staff *> staff_l_list_;
+ IPointer_list< Pulk_voice * > pulk_p_list_;
+ Pointer_list<Staff *> staff_l_list_;
Moment next_mom_;
public:
Moment last_;
bool ok() const;
Moment next_mom() { return next_mom_; }
- Pulk_voices(PointerList<Staff*> const&);
+ Pulk_voices(Pointer_list<Staff*> const&);
void get_aligned_request(Request_column *col_l );
};
*/
class Register_group_register : public Request_register {
protected:
- IPointerList<Request_register*> reg_list_;
+ IPointer_list<Request_register*> reg_list_;
virtual void do_print()const;
public:
*/
class Request_column
{
- IPointerList<Staff_column*> staff_cols_;
+ IPointer_list<Staff_column*> staff_cols_;
Array<Staff_column*> staff_col_l_arr_;
public:
Score_column *musical_column_l_, *command_column_l_;
- Request_column(PointerList<Staff*> const& );
+ Request_column(Pointer_list<Staff*> const& );
bool used_b()const;
Moment when();
void add_reqs(int staff_idx, Array<Request*> const&);
void add(Notehead *);
NAME_MEMBERS(Rest_column);
void translate_y(Real dy);
+ Rest_column();
};
#endif // REST_COLUMN_HH
/// paper_, staffs_ and commands_ form the problem definition.
Paper_def *paper_p_;
Midi_def *midi_p_;
- IPointerList<Staff*> staffs_;
+ IPointer_list<Staff*> staffs_;
/// "runtime" fields for setting up spacing
- IPointerList<Request_column*> rcols_;
+ IPointer_list<Request_column*> rcols_;
- IPointerList<Score_column*> cols_;
+ IPointer_list<Score_column*> cols_;
PScore *pscore_p_;
Input input_;
/// the columns of a score that form one line.
struct
Line_of_score {
- PointerList<PCol *> cols;
+ Pointer_list<PCol *> cols;
// need to store height of each staff.
- IPointerList<Line_of_staff*> staffs;
+ IPointer_list<Line_of_staff*> staffs;
PScore * pscore_l_; // needed to generate staffs
/* *************** */
public:
Input_register * ireg_p_;
- PointerList<Voice*> voice_list_;
+ Pointer_list<Voice*> voice_list_;
/// runtime field
- PointerList<Staff_column*> cols_;
+ Pointer_list<Staff_column*> cols_;
Score *score_l_;
PScore *pscore_l_;
/* *************************************************************** */
- void add(const PointerList<Voice*> &s);
+ void add(const Pointer_list<Voice*> &s);
void add_voice(Voice *v_p);
Paper_def*paper()const;
Voice_element */
Moment duration_;
Voice const *voice_C_;
- IPointerList<Request*> req_p_list_;
+ IPointer_list<Request*> req_p_list_;
Request * principal_req_l_;
/* *************** */
/** the elements, earliest first.
Please use the member #add()# to add a new element
*/
- IPointerList<Voice_element *> elts_;
+ IPointer_list<Voice_element *> elts_;
Moment start_;
/* *************** */