Qpid Proton C++ API  0.38.0
terminus.hpp
Go to the documentation of this file.
1 #ifndef PROTON_TERMINUS_HPP
2 #define PROTON_TERMINUS_HPP
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 "./map.hpp"
26 #include "./types_fwd.hpp"
27 #include "./internal/export.hpp"
28 
29 #include <proton/terminus.h>
30 
31 #include <map>
32 #include <string>
33 #include <vector>
34 
37 
38 struct pn_link_t;
39 struct pn_terminus_t;
40 
41 namespace proton {
42 
43 namespace internal {
44 template <class T> class factory;
45 }
46 
53 class terminus {
55  terminus(pn_terminus_t* t);
57 
58  public:
60 
61  terminus() : object_(0), parent_(0) {}
62 
66  NONDURABLE = PN_NONDURABLE,
68  CONFIGURATION = PN_CONFIGURATION,
70  UNSETTLED_STATE = PN_DELIVERIES
71  };
72 
76  LINK_CLOSE = PN_EXPIRE_WITH_LINK,
78  SESSION_CLOSE = PN_EXPIRE_WITH_SESSION,
80  CONNECTION_CLOSE = PN_EXPIRE_WITH_CONNECTION,
82  NEVER = PN_EXPIRE_NEVER
83  };
84 
85  // XXX This should have address?
86 
88  PN_CPP_EXTERN enum expiry_policy expiry_policy() const;
89 
92  PN_CPP_EXTERN duration timeout() const;
93 
95  PN_CPP_EXTERN enum durability_mode durability_mode();
96 
98  PN_CPP_EXTERN bool dynamic() const;
99 
101  PN_CPP_EXTERN bool anonymous() const;
102 
106  PN_CPP_EXTERN value node_properties() const;
107 
109  PN_CPP_EXTERN std::vector<symbol> capabilities() const;
110 
114 
115  protected:
116  pn_terminus_t *pn_object() const { return object_; }
117  private:
118  pn_terminus_t* object_;
119  pn_link_t* parent_;
120 
122  friend class internal::factory<terminus>;
123  friend class source;
124  friend class target;
126 };
127 
128 } // proton
129 
130 #endif // PROTON_TERMINUS_HPP
A span of time in milliseconds.
Definition: duration.hpp:39
A point of origin for messages.
Definition: source.hpp:44
A destination for messages.
Definition: target.hpp:45
One end of a link, either a source or a target.
Definition: terminus.hpp:53
duration timeout() const
The period after which the source is discarded on expiry.
std::vector< symbol > capabilities() const
Unsettled API Extension capabilities that are supported/requested
dynamic_property_map dynamic_properties() const
Unsettled API Obtain the AMQP dynamic node properties for the terminus as a map.
expiry_policy
When expiration of the source or target begins.
Definition: terminus.hpp:74
@ NEVER
The terminus never expires.
Definition: terminus.hpp:82
@ LINK_CLOSE
When the link is closed.
Definition: terminus.hpp:76
@ SESSION_CLOSE
When the containing session is closed.
Definition: terminus.hpp:78
@ CONNECTION_CLOSE
When the containing connection is closed.
Definition: terminus.hpp:80
durability_mode
The persistence mode of the source or target.
Definition: terminus.hpp:64
@ CONFIGURATION
Only configuration is persisted.
Definition: terminus.hpp:68
@ UNSETTLED_STATE
Configuration and unsettled state are persisted.
Definition: terminus.hpp:70
@ NONDURABLE
No persistence.
Definition: terminus.hpp:66
bool anonymous() const
True if the remote node is an anonymous-relay.
value node_properties() const
Obtain the AMQP dynamic node properties for the terminus as a single value.
bool dynamic() const
True if the remote node is created dynamically.
A holder for any AMQP value, simple or complex.
Definition: value.hpp:57
A collection of key-value pairs.
The main Proton namespace.
Definition: annotation_key.hpp:33
Forward declarations for Proton types used to represent AMQP types.