Qpid Proton C++  0.17.0
target_options.hpp
1 #ifndef PROTON_TARGET_OPTIONS_HPP
2 #define PROTON_TARGET_OPTIONS_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/pn_unique_ptr.hpp"
27 #include "./duration.hpp"
28 #include "./target.hpp"
29 
30 #include <string>
31 
32 namespace proton {
33 
41  public:
43  PN_CPP_EXTERN target_options();
44 
46  PN_CPP_EXTERN target_options(const target_options&);
47 
48  PN_CPP_EXTERN ~target_options();
49 
51  PN_CPP_EXTERN target_options& operator=(const target_options&);
52 
54  PN_CPP_EXTERN target_options& address(const std::string& addr);
55 
58  PN_CPP_EXTERN target_options& dynamic(bool);
59 
61  PN_CPP_EXTERN target_options& durability_mode(enum target::durability_mode);
62 
64  PN_CPP_EXTERN target_options& timeout(duration);
65 
67  PN_CPP_EXTERN target_options& expiry_policy(enum target::expiry_policy);
68 
69  private:
70  void apply(target&) const;
71 
72  class impl;
73  internal::pn_unique_ptr<impl> impl_;
74 
76  friend class target;
77  friend class sender_options;
78  friend class receiver_options;
80 };
81 
82 } // proton
83 
84 #endif // PROTON_TARGET_OPTIONS_HPP
Options for creating a sender.
Definition: sender_options.hpp:54
A span of time in milliseconds.
Definition: duration.hpp:36
target_options & dynamic(bool)
Request a dynamically created node to be created by the peer.
durability_mode
The persistence mode of the source or target.
Definition: terminus.hpp:56
expiry_policy
When expiration of the source or target begins.
Definition: terminus.hpp:66
target_options & timeout(duration)
The expiry period after which the target is discarded.
target_options()
Create an empty set of options.
target_options & address(const std::string &addr)
Set the address for the target. Ignored if dynamic is true.
target_options & durability_mode(enum target::durability_mode)
Control the persistence of target state.
Options for creating a receiver.
Definition: receiver_options.hpp:52
target_options & operator=(const target_options &)
Copy options.
A destination for messages.
Definition: target.hpp:42
target_options & expiry_policy(enum target::expiry_policy)
Control when the clock for expiration begins.
The main Proton namespace.
Definition: annotation_key.hpp:30
Options for creating a target node for a sender or receiver.
Definition: target_options.hpp:40