/vqdr/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/vqdr/trunk
54 by Gustav Hartvigsson
More work torwards inperementing the parser.
1
/*
2
 * The contects of this file is in the Public Domain.
3
 *
4
 * Created by Gustav Hartivgsson.
5
 */
64 by Gustav Hartvigsson
[General] Major refactoring. Utils -> Vee nenaming.
6
7
namespace  Vee {
62 by Gustav Hartvigsson
various changes
8
  [Compact]
49 by Gustav Hartvigsson
Added NamedVector
9
  public class Pair<T1, T2> {
10
    public T1 v1;
11
    public T2 v2;
62 by Gustav Hartvigsson
various changes
12
    public unowned FreeFunc v1_free_func;
13
    public unowned FreeFunc v2_free_func;
14
    [CCode (cname = "v_pair_new")]
49 by Gustav Hartvigsson
Added NamedVector
15
    public Pair (T1 v1, T2 v2) {
16
      this.v1 = v1;
17
      this.v2 = v2;
18
    }
64 by Gustav Hartvigsson
[General] Major refactoring. Utils -> Vee nenaming.
19
    
62 by Gustav Hartvigsson
various changes
20
    public Pair.with_free_func (T1 v1, T2 v2,
21
                               FreeFunc v1_free_func,
22
                               FreeFunc v2_free_func) {
23
      this.v1 = v1;
24
      this.v2 = v2;
25
      this.v1_free_func = v1_free_func;
26
      this.v2_free_func = v2_free_func;
27
    }
28
    
64 by Gustav Hartvigsson
[General] Major refactoring. Utils -> Vee nenaming.
29
    
62 by Gustav Hartvigsson
various changes
30
    ~Pair () {
31
      if (this.v1_free_func != null) {
32
        this.v1_free_func (v1);
33
      }
34
      if (this.v2_free_func != null) {
35
        this.v2_free_func (v2);
36
      }
37
    }
49 by Gustav Hartvigsson
Added NamedVector
38
  }
39
}