From 5035899c4686b7ea4be9307ab8dbbe0c00a47226 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 14 May 1997 09:38:38 +0000 Subject: [PATCH] lilypond-0.0.62 --- flower/include/pointer.hh | 33 +++++++++++++++++++++++++++++---- flower/include/pointer.tcc | 10 +++++----- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/flower/include/pointer.hh b/flower/include/pointer.hh index e29a298ace..58f8e198b0 100644 --- a/flower/include/pointer.hh +++ b/flower/include/pointer.hh @@ -20,19 +20,42 @@ Sorry for the silly naming */ template class P { - - void copy(T*); + /** + Set contents to a copy of #t_l# + */ + void copy(T const*t_l); T* t_p; + + /** + junk contents and set to 0 + */ void junk(); public: P(P const &src); + /** + Remove the pointer, and return it. + */ T *get_p() { T*p = t_p; t_p=0; return p; } - T *get_l() { return t_p; } + /** + return the pointer + */ + T *get_l() { return t_p; } + + T const *get_C() const { return t_p; } + /** + copy the contents of pointer, and return it + */ T *copy_p() const; + /** + swallow new_p, and set contents t new_p + */ void set_p (T *new_p); - void set_l (T *t_l); + /** + junk contents, and copy contents of t_l + */ + void set_l (T const *t_C); P &operator =(P const &); ~P(); @@ -42,6 +65,8 @@ public: T *operator ->() { return t_p; } operator T * () { return t_p; } const T *operator ->() const { return t_p ; } + T &operator *() { return *t_p; } + T const &operator *() const { return *t_p; } operator const T *() const { return t_p; } }; #endif // POINTER_HH diff --git a/flower/include/pointer.tcc b/flower/include/pointer.tcc index d595f2bcfe..80cadfd23a 100644 --- a/flower/include/pointer.tcc +++ b/flower/include/pointer.tcc @@ -21,9 +21,9 @@ P::copy_p()const template inline void -P::copy(T *l) +P::copy(T const *l_C) { - t_p = l ? new T(*l) : 0; + t_p = l_C ? new T(*l_C) : 0; } template @@ -74,13 +74,13 @@ P::set_p(T * np) template inline void -P::set_l(T * l) +P::set_l(T const * l_C) { - if (t_p == l) + if (t_p == l_C) return; junk(); - copy(l); + copy(l_C); } -- 2.11.4.GIT