1 /*
2  * hunt-proton: AMQP Protocol library for D programming language.
3  *
4  * Copyright (C) 2018-2019 HuntLabs
5  *
6  * Website: https://www.huntlabs.net/
7  *
8  * Licensed under the Apache-2.0 License.
9  *
10  */
11 
12 module hunt.proton.codec.impl.Element;
13 
14 import hunt.io.ByteBuffer;
15 import hunt.proton.codec.Data;
16 
17 interface IElement
18 {
19     int size();
20     Data.DataType getDataType();
21     int encode(ByteBuffer b);
22     IElement replaceWith(IElement elt);
23 
24     IElement addChild(IElement element);
25     IElement checkChild(IElement element);
26 
27     IElement next();
28     IElement prev();
29     IElement child();
30     IElement parent();
31 
32     void setNext(IElement elt);
33     void setPrev(IElement elt);
34     void setParent(IElement elt);
35     void setChild(IElement elt);
36 
37     bool canEnter();
38 
39     void render(string sb);
40     Object getValue();
41 }
42 
43 interface Element(T) : IElement
44 {
45     //int size();
46 
47    // Data.DataType getDataType();
48     //int encode(ByteBuffer b);
49     //Element!T next();
50     //Element!T prev();
51     //Element!T child();
52     //Element!T parent();
53 
54     //void setNext(Element!T elt);
55     //void setPrev(Element!T elt);
56     //void setParent(Element!T elt);
57     //void setChild(Element!T elt);
58 
59     //Element!T replaceWith(Element!T elt);
60     //
61     //Element!T addChild(Element!T element);
62     //Element!T checkChild(Element!T element);
63 
64     //bool canEnter();
65     //
66     //void render(string sb);
67 }