.PHONY: docxx
docxx: $(hh) $(cc) $(templatecc) $(inl)
- -mkdir docxx
doc++ -p -d docxx $(hh) $(cc) $(templatecc) $(inl)
dist:
V val;
};
-/// hungarian: map
-/** mindblowingly stupid Associative array implementation
+
+/** mindblowingly stupid Associative array implementation.Hungarian: map
*/
template<class K, class V>
struct Assoc {
#define gpp_minmax(type, prefix)
#endif
-/// handy notations for a signed comparison
-/**
+/** handy notations for a signed comparison.
make the operators{<,<=,==,>=,>} and the MAX and MIN of two.
Please fill a & in the type argument if necessary.
*/
#include "link.hh"
template<class T> class List;
-/// iterator to List
-/**
+/** iterator to List.
add and insert extend the list
items are always stored as copies in List, but:
List<String> : copies of String stored
class Cursor
{
public:
- /** this isn't true, actually, #list# surely isn't const, but I get
- tired of the warning messages. */
+ /** create cursor, set at top. The const part isn't true, actually, #list#
+ surely isn't const, but I get tired of the warning messages. */
Cursor( const List<T>& list, Link<T>* pointer = 0 );
Cursor( const Cursor<T>& cursor );
/// -- items left?
bool backward();
- /// put (copy) after me in List
- /**
+ /** put (copy) after me in List.
analogously to editor. ok() interpreted as at end
of line.
*/
void add( const T& thing );
- /// put (copy) before me in List
- /**
+ /** put (copy) before me in List.
analogously to editor. ok() interpreted as at begin of
line.
return s;
}
-/// get a char.
-/**
+/** get a char
Only class member who uses text_file::get
*/
char
template<class T> class Cursor;
template<class T> class Link;
-/// all-purpose doubly linked list
-/**
- a doubly linked list;
+/** all-purpose doubly linked list.
+
List can be seen as all items written down on paper,
from top to bottom
int size() const;
- Cursor<T> bottom() const; // const sucks..
+ Cursor<T> bottom() const; // const sucks.
Cursor<T> top() const;
void OK() const; // check list
void concatenate(List<T> const &s);
- /// make *this empty
- /**
+ /** make *this empty.
POST:
size == 0
*/
void set_empty();
- /// add after after_me
void add( const T& thing, Cursor<T> &after_me );
/// put thing before #before_me#
void insert( const T& thing, Cursor<T> &before_me );
- /** Remove link pointed to by me. Destructor of contents called
+
+ /** Remove link pointed to by me. Destructor of contents called
(nop for pointers)
POST
c.del();
}
+/**
+
+ add after after_me.
+
+ Procedure:
+ \begin{itemize}
+ \item if #after_me# is #ok()#, add after #after_me#, else
+ \item if list !empty simply add to bottom, else
+ \item list is empty: create first \Ref{Link} and initialize
+ #bottom_# and #top_#.
+ \end{itemize}
+*/
template<class T>
void
List<T>::add( const T& thing, Cursor<T> &after_me )
size_++;
}
-/**
-
- Procedure:
- \begin{itemize}
- \item if #after_me# is #ok()#, add after #after_me#, else
- \item if list !empty simply add to bottom, else
- \item list is empty: create first \Ref{Link} and initialize
- #bottom_# and #top_#.
- \end{itemize}
-*/
template<class T>
void
#include "varray.hh"
-/// searching directory for file.
-/**
+/** searching directory for file.
Abstraction of PATH variable. An interface for searching input files.
Search a number of dirs for a file.
#include "list.hh"
-/// Use for list of pointers, e.g. PointerList<AbstractType*>.
/**
+ A list of pointers.
+
+ Use for list of pointers, e.g. PointerList<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
- program only one parent List<void*> is instantiated. */
+ program only one parent List<void*> is instantiated.
+ */
template<class T>
class PointerList : public List<void *>
{
PointerList() {}
};
-/// pl. which deletes pointers given to it.
-/**
+/** PointerList which deletes pointers given to it.
NOTE:
The copy constructor doesn't do what you'd want:
*/
template<class T>
-struct IPointerList : public PointerList<T> {
+class IPointerList : public PointerList<T> {
+public:
IPointerList(const IPointerList&) { set_empty(); }
IPointerList() { }
~IPointerList();
-/****************************************************************************
+/*
PROJECT: FlowerSoft C++ library
FILE : string.cc
Rehacked by HWN 3/nov/95
removed String &
introduced Class String_handle
---*/
+
+*/
#include <string.h>
#include <stdlib.h>
#include "stringutil.hh"
-/// the smart string class.
-/**
+/** the smart string class.
Intuitive string class. provides
String_handle data; // should derive String from String_handle?
public:
- /// init to ""
- /** needed because other constructors are provided.*/
+ /** init to "". needed because other constructors are provided.*/
String() { }
String(Rational);
/// String s = "abc";
/// index of rightmost element of string
int lastPos( const char* string ) const;
- /// index of leftmost c
- /**
+ /** index of leftmost c.
RETURN:
0 if not found, else index + 1
*/
#include "string.hh"
#include "varray.hh"
-/// line counting input stream.
-/**
+/** line counting input stream.
a stream for textfiles. linecounting. Thin interface getchar and
ungetchar. (ungetc is unlimited)
*dest++ = *src++;
}
-///scaleable array/stack template, for T with def ctor.
-/**
+/**
+ scaleable array/stack template, for T with def ctor.
This template implements a scaleable vector. With (or without) range
checking. It may be flaky for objects with complicated con- and
destructors. The type T should have a default constructor. It is
assert(max >= size_ && size_ >=0);
if (max) assert(thearray);
}
- /// report the size_. See {setsize_}
-
+ /** report the size_.
+ @see {setsize_}
+ */
int size() const { return size_; }
/// POST: size() == 0
Array() { thearray = 0; max =0; size_ =0; }
- /// set the size_ to #s#
+
+ /** set the size_ to #s#.
+ POST: size() == s.
+ Warning: contents are unspecified */
void set_size(int s) {
if (s >= max) remax(s);
size_ = s;
}
- /** POST: size() == s.
- Warning: contents are unspecified */
~Array() { delete[] thearray; }
class String;
void set_matrix_debug(Dstream&ds);
-/// a row of numbers
-/**
+/** a row of numbers.
a vector. Storage is handled in Array, Vector only does the mathematics.
*/
class Vector {