|
34 | 34 |
|
35 | 35 | namespace proton { |
36 | 36 |
|
| 37 | +class transaction_handler; |
| 38 | + |
37 | 39 | class |
38 | | -PN_CPP_CLASS_EXTERN Transaction { |
39 | | - proton::sender txn_ctrl; |
40 | | - proton::transaction_handler handler; |
41 | | - // TODO int |
42 | | - int id = 0; |
43 | | - proton::tracker _declare; |
44 | | - proton::tracker _discharge; |
45 | | - bool failed = false; |
46 | | - std::vector<proton::tracker> pending; |
| 40 | +PN_CPP_CLASS_EXTERN transaction { |
47 | 41 | public: |
48 | 42 | // TODO: |
49 | | - PN_CPP_EXTERN Transaction(proton::sender _txn_ctrl, proton::transaction_handler _handler, bool _settle_before_discharge = false); |
50 | | - PN_CPP_EXTERN virtual ~Transaction(); |
| 43 | + PN_CPP_EXTERN virtual ~transaction(); |
51 | 44 | PN_CPP_EXTERN virtual void commit(); |
52 | 45 | PN_CPP_EXTERN virtual void abort(); |
53 | 46 | PN_CPP_EXTERN virtual void declare(); |
54 | | - PN_CPP_EXTERN virtual void discharge(bool failed); |
55 | | - PN_CPP_EXTERN virtual proton::tracker send_ctrl(proton::symbol descriptor, proton::value _value); |
56 | 47 | PN_CPP_EXTERN virtual proton::tracker send(proton::sender s, proton::message msg); |
57 | | - PN_CPP_EXTERN virtual void handle_outcome(proton::tracker t); |
58 | 48 | }; |
59 | 49 |
|
60 | 50 | class |
61 | 51 | PN_CPP_CLASS_EXTERN transaction_handler { |
62 | | - |
63 | 52 | public: |
64 | | - PN_CPP_EXTERN transaction_handler(); |
65 | 53 | PN_CPP_EXTERN virtual ~transaction_handler(); |
66 | 54 |
|
67 | 55 | /// Called when a local transaction is declared. |
68 | | - PN_CPP_EXTERN virtual void on_transaction_declared(Transaction&); |
| 56 | + PN_CPP_EXTERN virtual void on_transaction_declared(transaction&); |
69 | 57 |
|
70 | 58 | /// Called when a local transaction is discharged successfully. |
71 | | - PN_CPP_EXTERN virtual void on_transaction_committed(Transaction&); |
| 59 | + PN_CPP_EXTERN virtual void on_transaction_committed(transaction&); |
72 | 60 |
|
73 | 61 | /// Called when a local transaction is discharged unsuccessfully (aborted). |
74 | | - PN_CPP_EXTERN virtual void on_transaction_aborted(Transaction&); |
| 62 | + PN_CPP_EXTERN virtual void on_transaction_aborted(transaction&); |
75 | 63 |
|
76 | 64 | /// Called when a local transaction declare fails. |
77 | | - PN_CPP_EXTERN virtual void on_transaction_declare_failed(Transaction&); |
| 65 | + PN_CPP_EXTERN virtual void on_transaction_declare_failed(transaction&); |
78 | 66 |
|
79 | 67 | /// Called when the commit of a local transaction fails. |
80 | | - PN_CPP_EXTERN virtual void on_transaction_commit_failed(Transaction&); |
| 68 | + PN_CPP_EXTERN virtual void on_transaction_commit_failed(transaction&); |
81 | 69 | }; |
82 | 70 |
|
83 | 71 | } // namespace proton |
|
0 commit comments