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 
13 module hunt.proton.amqp.messaging.Accepted;
14 
15 import hunt.proton.amqp.Symbol;
16 import hunt.proton.amqp.transport.DeliveryState;
17 import hunt.proton.amqp.messaging.Outcome;
18 
19 
20 import std.concurrency : initOnce;
21 
22 class Accepted : DeliveryState, Outcome
23 {
24    // __gshared Symbol DESCRIPTOR_SYMBOL = Symbol.valueOf("amqp:accepted:list");
25 
26    // private static Accepted INSTANCE = new Accepted();
27 
28 
29     static Symbol DESCRIPTOR_SYMBOL()
30     {
31         __gshared Symbol inst;
32         return initOnce!inst(Symbol.valueOf("amqp:accepted:list"));
33     }
34 
35 
36     __gshared Accepted INSTANCE = null;
37 
38     /**
39      *  TODO should this (and other DeliveryStates) have a private constructor??
40      */
41     this()
42     {
43     }
44 
45 
46     public static Accepted getInstance()
47     {
48         if (INSTANCE is null)
49             INSTANCE = new Accepted();
50         return INSTANCE;
51     }
52 
53     override
54     public DeliveryStateType getType() {
55         return DeliveryStateType.Accepted;
56     }
57 }