Qpid Proton C++  0.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
terminus.hpp
1 #ifndef PROTON_CPP_TERMINUS_H
2 #define PROTON_CPP_TERMINUS_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include "proton/export.hpp"
26 #include "proton/object.hpp"
27 #include "proton/value.hpp"
28 
29 #include "proton/link.h"
30 #include <string>
31 
32 namespace proton {
33 
34 class link;
35 
42 class terminus {
43  public:
45  terminus(pn_terminus_t* t);
47 
49  enum type {
50  TYPE_UNSPECIFIED = PN_UNSPECIFIED,
51  SOURCE = PN_SOURCE,
52  TARGET = PN_TARGET,
53  COORDINATOR = PN_COORDINATOR
54  };
55 
57  enum durability {
58  NONDURABLE = PN_NONDURABLE,
59  CONFIGURATION = PN_CONFIGURATION,
60  DELIVERIES = PN_DELIVERIES
61  };
62 
65  EXPIRE_WITH_LINK = PN_EXPIRE_WITH_LINK,
66  EXPIRE_WITH_SESSION = PN_EXPIRE_WITH_SESSION,
67  EXPIRE_WITH_CONNECTION = PN_EXPIRE_WITH_CONNECTION,
68  EXPIRE_NEVER = PN_EXPIRE_NEVER
69  };
70 
73  MODE_UNSPECIFIED = PN_DIST_MODE_UNSPECIFIED,
74  COPY = PN_DIST_MODE_COPY,
75  MOVE = PN_DIST_MODE_MOVE
76  };
77 
79  PN_CPP_EXTERN enum type type() const;
80 
82  PN_CPP_EXTERN void type(enum type);
83 
85  PN_CPP_EXTERN enum expiry_policy expiry_policy() const;
86 
88  PN_CPP_EXTERN void expiry_policy(enum expiry_policy);
89 
92  PN_CPP_EXTERN uint32_t timeout() const;
93  PN_CPP_EXTERN void timeout(uint32_t seconds);
95 
97  PN_CPP_EXTERN enum distribution_mode distribution_mode() const;
98 
100  PN_CPP_EXTERN void distribution_mode(enum distribution_mode);
101 
103  PN_CPP_EXTERN enum durability durability();
104 
106  PN_CPP_EXTERN void durability(enum durability);
107 
109  PN_CPP_EXTERN std::string address() const;
110 
112  PN_CPP_EXTERN void address(const std::string &);
113 
115  PN_CPP_EXTERN bool dynamic() const;
116 
118  PN_CPP_EXTERN void dynamic(bool);
119 
122  PN_CPP_EXTERN value& node_properties();
123 
126  PN_CPP_EXTERN const value& node_properties() const;
127 
130  PN_CPP_EXTERN value& filter();
131 
134  PN_CPP_EXTERN const value& filter() const;
135 
136  private:
137  pn_terminus_t* object_;
138  value properties_, filter_;
139 };
140 
141 }
142 
143 #endif // PROTON_CPP_TERMINUS_H
Transaction coordinator.
Definition: terminus.hpp:53
type
Type of terminus.
Definition: terminus.hpp:49
distribution_mode
Distribution mode.
Definition: terminus.hpp:72
One end of a link, either a source or a target.
Definition: terminus.hpp:42
enum distribution_mode distribution_mode() const
Get the distribution mode.
expiry_policy
Expiry policy.
Definition: terminus.hpp:64
value & filter()
Obtain a reference to the AMQP filter set for the terminus.
enum type type() const
Get the terminus type.
durability
Durability.
Definition: terminus.hpp:57
A holder for an AMQP value.
Definition: value.hpp:33
std::string address() const
Get the source or target address.
value & node_properties()
Obtain a reference to the AMQP dynamic node properties for the terminus.
enum expiry_policy expiry_policy() const
Get the expiration policy.
enum durability durability()
Get the durability flag.
bool dynamic() const
True if the remote node is created dynamically.