From: fred Date: Sun, 24 Mar 2002 19:37:34 +0000 (+0000) Subject: lilypond-0.0.46.jcn1 X-Git-Tag: release/1.5.59~5057 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=87514a97419846a31e6d26950bead6bbf2a660d9;p=lilypond.git lilypond-0.0.46.jcn1 --- diff --git a/flower/include/cursor.hh b/flower/include/cursor.hh index af2e251a08..168ee50393 100644 --- a/flower/include/cursor.hh +++ b/flower/include/cursor.hh @@ -107,7 +107,7 @@ template_instantiate_compare(Cursor, Cursor::compare, template); #include "pcursor.hh" #include "list.hh" -#include "cursor.inl" +#include "cursor.icc" #include "iterate.hh" #endif // CURSOR_HH diff --git a/flower/include/cursor.icc b/flower/include/cursor.icc new file mode 100644 index 0000000000..e103c88e43 --- /dev/null +++ b/flower/include/cursor.icc @@ -0,0 +1,113 @@ + // cursor.icc -*-c++-*- +#ifndef CURSOR_INL +#define CURSOR_INL +#include + + +template +inline +Cursor::Cursor( const List& list, Link* pointer ) : + list_((List&) list ) +{ + if ( list.size() ) + pointer_ = pointer ? pointer : list.top_; + else + pointer_ = pointer; +} + +template +inline +Cursor::Cursor( const Cursor& cursor ) : + list_( cursor.list_ ) +{ + pointer_ = cursor.pointer_; +} + +template +inline T& +Cursor::thing() +{ + assert( pointer_ ); + return pointer_->thing(); +} + +template +Cursor +Cursor::operator =( const Cursor& c ) +{ + assert( &list_ == &c.list_ ); + pointer_ = c.pointer_; + return *this; +} + +template +inline void +Cursor::add( const T& th ) +{ + list_.add( th, *this ); +} + +template +inline void +Cursor::insert( const T& th ) +{ + list_.insert( th, *this ); +} + +template +inline List& +Cursor::list() const +{ + return list_; +} + +template +inline Link* +Cursor::pointer() +{ + return pointer_; +} + +template +inline bool +Cursor::backward() +{ + return ( pointer_ != 0 ); +} + +template +inline bool +Cursor::forward() +{ + return ( pointer_ != 0 ); +} + +template +inline bool +Cursor::ok() +{ + return ( pointer_ != 0 ); +} + + +template +inline Cursor +Cursor::operator ++( int ) +{ + Cursor r (*this); + assert( pointer_ ); + pointer_ = pointer_->next(); + return r; +} + +template +inline Cursor +Cursor::operator --( int ) +{ + Cursor r (*this); + assert( pointer_ ); + pointer_ = pointer_->previous(); + return r; +} + +#endif diff --git a/flower/include/link.hh b/flower/include/link.hh index 22fcec4e71..218a0f8e55 100644 --- a/flower/include/link.hh +++ b/flower/include/link.hh @@ -33,6 +33,6 @@ private: Link* next_; }; -#include "link.inl" +#include "link.icc" #endif // __LINK_HH // diff --git a/flower/include/list.hh b/flower/include/list.hh index fbb79e6edf..1cfa9f54ed 100644 --- a/flower/include/list.hh +++ b/flower/include/list.hh @@ -83,7 +83,7 @@ class List Link* bottom_; }; -#include "list.inl" +#include "list.icc" #include "cursor.hh" // instantiate a template: explicit instantiation. diff --git a/flower/include/plist.hh b/flower/include/plist.hh index f9af4c693b..1fc4d941ab 100644 --- a/flower/include/plist.hh +++ b/flower/include/plist.hh @@ -67,6 +67,6 @@ void PL_copy(IPointerList &dst,IPointerList const&src); #define IPL_instantiate(a) PL_instantiate(a); \ template class IPointerList -#include "plist.inl" +#include "plist.icc" #endif diff --git a/flower/include/plist.icc b/flower/include/plist.icc new file mode 100644 index 0000000000..8b5f8eea56 --- /dev/null +++ b/flower/include/plist.icc @@ -0,0 +1,21 @@ +/* -*-c++-*- + plist.icc -- part of flowerlib + + (c) 1996 Han-Wen Nienhuys& Jan Nieuwenhuizen +*/ + +#ifndef PLIST_INL +#define PLIST_INL + +template +void +PL_copy(IPointerList &to, IPointerList const&src) +{ + for (PCursor pc(src); pc.ok(); pc++) { + T *q = pc; + T *p=new T(*q) ; + to.bottom().add(p); + } +} + +#endif diff --git a/flower/include/string-handle.hh b/flower/include/string-handle.hh index 3f42e860e6..88954cb168 100644 --- a/flower/include/string-handle.hh +++ b/flower/include/string-handle.hh @@ -60,9 +60,9 @@ public: #ifdef STRING_UTILS_INLINED #ifndef INLINE -#define INLINE inline +#define INLINE.iccine #endif -#include "string-handle.inl" +#include "string-handle.icc" /* we should be resetting INLINE. oh well. */ #endif diff --git a/flower/stringutil.cc b/flower/stringutil.cc index 43c8e15d82..d73e4f14d3 100644 --- a/flower/stringutil.cc +++ b/flower/stringutil.cc @@ -29,5 +29,5 @@ mymemmove( void* dest, void const* src, size_t n ) #include "string-handle.hh" #include "string-data.hh" -#include "string-data.inl" -#include "string-handle.inl" +#include "string-data.icc" +#include "string-handle.icc"