Quantum Fog  0.9.3
DICTIONARY.h
1 //******************************************
2 // Purpose: To define a class that
3 // orders a collection of stringies alpahbetically. Also,
4 // given any stringy, it tells what is its dictionary position.
5 //******************************************
6 #pragma once
7 
8 #include "STRINGY.h"
9 #include "VECTOR.h"
10 #include "UI_MAP.h"
11 
12 //#include <stdlib.h>
13 //#include <stdio.h>
14 //******************************************
16 {
17 private:
18  // stringies ordered so ids are listed in increasing order
19  const STRINGY * * its_stringies_p_p;
20  VECTOR<STRINGY> * its_stringies_p;
21 
22  USHORT its_num_of_stringies;
23  USHORT its_num_of_users;
24 
25  // ID's ordered so stringies are listed alphabetically
26  USHORT * its_ids_p;
27 
28  VOID sort_vec_of_ids_by_abc();
29 public:
30 // VOID sort_vec_of_ids_by_abc();
31  DICTIONARY( const STRINGY * * stringies_p_p, USHORT len);
32  DICTIONARY( VECTOR<STRINGY> * stringies_p);
33  virtual ~DICTIONARY();
34 
35  const STRINGY & get_stringy(USHORT id) const;
36  USHORT get_id_of_this_stringy(const STRINGY & stringy) const;
37  VOID get_map(UI_MAP & map) const;
38  USHORT get_num_of_stringies() const;
39 
40  USHORT get_num_of_users() const;
41  VOID add_one_user();
42  VOID del_one_user();
43 
44 };
45 #pragma mark -
46 
47 //******************************************
48 inline
49 USHORT DICTIONARY::get_num_of_stringies()
50 const
51 {
52  return its_num_of_stringies;
53 }
54 //******************************************
55 inline
56 USHORT DICTIONARY::get_num_of_users()
57 const
58 {
59  return its_num_of_users;
60 }
61 //******************************************
62 inline
63 VOID DICTIONARY::add_one_user()
64 {
65  its_num_of_users++;
66 }
67 //******************************************
68 inline
69 VOID DICTIONARY::del_one_user()
70 {
71  its_num_of_users--;
72 }
73 
74 
75 
Definition: STRINGY.h:22
Definition: DICTIONARY.h:15
Definition: UI_MAP.h:7