Qpid Proton C++  0.14.0
terminus.hpp
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 "./internal/export.hpp"
26 #include "./internal/object.hpp"
27 #include "./value.hpp"
28 
29 #include <proton/link.h>
30 #include <string>
31 
32 namespace proton {
33 
40 class terminus {
42  terminus(pn_terminus_t* t);
44 
45  public:
46  terminus() : object_(0), parent_(0) {}
47 
51  NONDURABLE = PN_NONDURABLE,
53  CONFIGURATION = PN_CONFIGURATION,
55  UNSETTLED_STATE = PN_DELIVERIES
56  };
57 
61  LINK_CLOSE = PN_EXPIRE_WITH_LINK,
63  SESSION_CLOSE = PN_EXPIRE_WITH_SESSION,
65  CONNECTION_CLOSE = PN_EXPIRE_WITH_CONNECTION,
67  NEVER = PN_EXPIRE_NEVER
68  };
69 
70  // XXX This should have address?
71 
73  PN_CPP_EXTERN enum expiry_policy expiry_policy() const;
74 
77  PN_CPP_EXTERN duration timeout() const;
78 
80  PN_CPP_EXTERN enum durability_mode durability_mode();
81 
83  PN_CPP_EXTERN bool dynamic() const;
84 
87  PN_CPP_EXTERN value node_properties() const;
88 
89  protected:
90  pn_terminus_t *pn_object() { return object_; }
91  private:
92  pn_terminus_t* object_;
93  pn_link_t* parent_;
94 
96  friend class internal::factory<terminus>;
97  friend class source;
98  friend class target;
100 };
101 
102 } // proton
103 
104 #endif // PROTON_TERMINUS_HPP
value node_properties() const
Obtain a reference to the AMQP dynamic node properties for the terminus.
One end of a link, either a source or a target.
Definition: terminus.hpp:40
No persistence.
Definition: terminus.hpp:51
expiry_policy
When expiration of the source or target begins.
Definition: terminus.hpp:59
A span of time in milliseconds.
Definition: duration.hpp:34
duration timeout() const
The period after which the source is discarded on expiry.
The terminus never expires.
Definition: terminus.hpp:67
When the link is closed.
Definition: terminus.hpp:61
A point of origin for messages.
Definition: source.hpp:43
When the containing session is closed.
Definition: terminus.hpp:63
Configuration and unsettled state are persisted.
Definition: terminus.hpp:55
A holder for any AMQP value, simple or complex.
Definition: value.hpp:60
Only configuration is persisted.
Definition: terminus.hpp:53
A destination for messages.
Definition: target.hpp:40
When the containing connection is closed.
Definition: terminus.hpp:65
enum expiry_policy expiry_policy() const
Get the policy for when expiration begins.
enum durability_mode durability_mode()
Get the durability flag.
Type traits for mapping between AMQP and C++ types.
Definition: annotation_key.hpp:28
durability_mode
The persistence mode of the source or target.
Definition: terminus.hpp:49
bool dynamic() const
True if the remote node is created dynamically.