summaryrefslogtreecommitdiffstats
path: root/src/Term.vala
blob: 2a9cca8fd9af9ca3009798b3ef765a640107aedf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
namespace Eva {
  public interface Term : Object {
    public abstract string to_string();
    
    public abstract void encode(Erl.Buffer buffer);
  }
  
  public class Long : Object, Term {
    public long value {get; construct;}
    
    public Long(long v) {
      Object(value: v);
    }
    
    public string to_string() {
      return value.to_string();
    }
    
    public void encode(Erl.Buffer buffer) {
      buffer.encode_long(value);
    }
  }
  
  public class ULong : Object, Term {
    public ulong value {get; construct;}
    
    public ULong(ulong v) {
      Object(value: v);
    }
    
    public string to_string() {
      return value.to_string();
    }
    
    public void encode(Erl.Buffer buffer) {
      buffer.encode_ulong(value);
    }
  }
  
  public class Double : Object, Term {
    public double value {get; construct;}
    
    public Double(double v) {
      Object(value: v);
    }
    
    public string to_string() {
      return value.to_string();
    }
    
    public void encode(Erl.Buffer buffer) {
      buffer.encode_double(value);
    }
  }
  
  public class Atom : Object, Term {
    public string value {get; construct;}
    
    public Atom(string v) {
      Object(value: v);
    }
    
    public string to_string() {
      return value.to_string();
    }
    
    public void encode(Erl.Buffer buffer) {
      buffer.encode_atom(value.to_utf8());
    }
  }
}