~ubuntu-branches/ubuntu/quantal/texmacs/quantal

« back to all changes in this revision

Viewing changes to src/Classes/Compound/rel_hashmap.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA, Kamaraju Kusumanchi, kohda
  • Date: 2008-04-06 15:11:41 UTC
  • mfrom: (1.1.7 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080406151141-w0sg20jnv86mlt6f
Tags: 1:1.0.6.14-1
[Kamaraju Kusumanchi <kamaraju@gmail.com>]
* New upstream release
* 01_american.dpatch is updated
* Since thread support in guile-1.8 is now disabled, the segmentation faults
  should not arise anymore. More info at #439923. (Closes: #450499, #458685)
[kohda]
* This version fixed menu problem.  (Closes: #447083)
* Reverted orig.tar.gz to the upstream tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/******************************************************************************
3
 
* MODULE     : rel_hashmap.hpp
4
 
* DESCRIPTION: see rel_hashmap.cpp
5
 
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
6
 
*******************************************************************************
7
 
* This software falls under the GNU general public license and comes WITHOUT
8
 
* ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for more details.
9
 
* If you don't have this file, write to the Free Software Foundation, Inc.,
10
 
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
11
 
******************************************************************************/
12
 
 
13
 
#ifndef REL_HASMAP_H
14
 
#define REL_HASMAP_H
15
 
#include "hashmap.hpp"
16
 
 
17
 
template<class T, class U> class rel_hashmap;
18
 
template<class T, class U> class rel_hashmap_rep;
19
 
template<class T, class U> bool nil (rel_hashmap<T,U> h);
20
 
 
21
 
template<class T, class U> class rel_hashmap {
22
 
  CONCRETE_NULL_TEMPLATE_2(rel_hashmap,T,U);
23
 
  inline rel_hashmap (U init);
24
 
  inline rel_hashmap (hashmap<T,U> item);
25
 
  inline rel_hashmap (hashmap<T,U> item, rel_hashmap<T,U> next);
26
 
  U  operator [] (T x);
27
 
  U& operator () (T x);
28
 
};
29
 
 
30
 
template<class T, class U> class rel_hashmap_rep: concrete_struct {
31
 
public:
32
 
  hashmap<T,U>     item;
33
 
  rel_hashmap<T,U> next;
34
 
 
35
 
  inline rel_hashmap_rep<T,U> (hashmap<T,U> item2, rel_hashmap<T,U> next2):
36
 
    item(item2), next(next2) {}
37
 
  bool contains (T x);
38
 
  void extend ();
39
 
  void shorten ();
40
 
  void merge ();
41
 
  void find_changes (hashmap<T,U>& CH);
42
 
  void find_differences (hashmap<T,U>& CH);
43
 
  void change (hashmap<T,U> CH);
44
 
 
45
 
  friend class rel_hashmap<T,U>;
46
 
};
47
 
 
48
 
CONCRETE_NULL_TEMPLATE_2_CODE(rel_hashmap,class,T,class,U);
49
 
#define TMPL template<class T, class U>
50
 
TMPL inline rel_hashmap<T,U>::rel_hashmap (U init):
51
 
  rep (new rel_hashmap_rep<T,U> (hashmap<T,U> (init), rel_hashmap<T,U> ())) {}
52
 
TMPL inline rel_hashmap<T,U>::rel_hashmap (hashmap<T,U> item):
53
 
  rep (new rel_hashmap_rep<T,U> (item, rel_hashmap<T,U> ())) {}
54
 
TMPL inline rel_hashmap<T,U>::rel_hashmap
55
 
  (hashmap<T,U> item, rel_hashmap<T,U> next):
56
 
    rep (new rel_hashmap_rep<T,U> (item, next)) {}
57
 
 
58
 
TMPL ostream& operator << (ostream& out, rel_hashmap<T,U> H);
59
 
#undef TMPL
60
 
 
61
 
#include "rel_hashmap.cpp"
62
 
 
63
 
#endif // defined REL_HASMAP_H