BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslma_managedptr_pairproxy.h
Go to the documentation of this file.
1/// @file bslma_managedptr_pairproxy.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslma_managedptr_pairproxy.h -*-C++-*-
8#ifndef INCLUDED_BSLMA_MANAGEDPTR_PAIRPROXY
9#define INCLUDED_BSLMA_MANAGEDPTR_PAIRPROXY
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bslma_managedptr_pairproxy bslma_managedptr_pairproxy
15/// @brief Provide the internal state of a managed pointer class.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslma
19/// @{
20/// @addtogroup bslma_managedptr_pairproxy
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslma_managedptr_pairproxy-purpose"> Purpose</a>
25/// * <a href="#bslma_managedptr_pairproxy-classes"> Classes </a>
26/// * <a href="#bslma_managedptr_pairproxy-description"> Description </a>
27///
28/// # Purpose {#bslma_managedptr_pairproxy-purpose}
29/// Provide the internal state of a managed pointer class.
30///
31/// # Classes {#bslma_managedptr_pairproxy-classes}
32///
33/// - bslma::ManagedPtr_PairProxy: internal state of a `bslma::ManagedPtr` object
34///
35/// @see bslma_managedptr
36///
37/// # Description {#bslma_managedptr_pairproxy-description}
38/// This component provides a class, `bslma::ManagedPtr_PairProxy`,
39/// that can be used to create a `bsl::pair` with the same arguments. It is
40/// provided in order to support a (deprecated) legacy API in `ManagedPtr` as
41/// part of the transition from the `bdema` package to `bslma`. With the
42/// transition, the `bslma` managed pointer component is lower in the package
43/// group levelization than `bsl::pair`, so we instead return a type that is
44/// implicitly convertible to `pair`. Note that this implies that an implicit
45/// constructor has been added to `bsl::pair`.
46/// @}
47/** @} */
48/** @} */
49
50/** @addtogroup bsl
51 * @{
52 */
53/** @addtogroup bslma
54 * @{
55 */
56/** @addtogroup bslma_managedptr_pairproxy
57 * @{
58 */
59
60#include <bslscm_version.h>
61
63
64#include <bsls_assert.h>
65
66
67namespace bslma {
68
69 // ==========================
70 // class ManagedPtr_PairProxy
71 // ==========================
72
73/// This class is a simple aggregate that may be used to construct a
74/// `bsl::pair` object. It will be a POD if the (template parameter)
75/// `ASSOCIATED_TYPE` is a POD. Note that the names of the data members
76/// must exactly match those of `bsl::pair` to support users simply acting
77/// on the result of a function call from which a pair proxy is returned,
78/// and not assigning that result to a `bsl::pair` first.
79template <class POINTER_TYPE, class ASSOCIATED_TYPE>
81
82 POINTER_TYPE *first;
83 ASSOCIATED_TYPE second;
84};
85
86// ============================================================================
87// INLINE DEFINITIONS
88// ============================================================================
89
90 // --------------------------
91 // class ManagedPtr_PairProxy
92 // --------------------------
93
94} // close package namespace
95
96// TYPE TRAITS
97namespace bslmf {
98
99template <class POINTER_TYPE, class ASSOCIATED_TYPE>
100struct IsBitwiseMoveable<bslma::ManagedPtr_PairProxy<POINTER_TYPE,
101 ASSOCIATED_TYPE> >
102 : IsBitwiseMoveable<ASSOCIATED_TYPE>::type
103{
104};
105
106} // close namespace bslmf
107
108
109#endif
110
111// ----------------------------------------------------------------------------
112// Copyright 2016 Bloomberg Finance L.P.
113//
114// Licensed under the Apache License, Version 2.0 (the "License");
115// you may not use this file except in compliance with the License.
116// You may obtain a copy of the License at
117//
118// http://www.apache.org/licenses/LICENSE-2.0
119//
120// Unless required by applicable law or agreed to in writing, software
121// distributed under the License is distributed on an "AS IS" BASIS,
122// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
123// See the License for the specific language governing permissions and
124// limitations under the License.
125// ----------------------------- END-OF-FILE ----------------------------------
126
127/** @} */
128/** @} */
129/** @} */
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
Definition bslma_managedptr_pairproxy.h:80
POINTER_TYPE * first
Definition bslma_managedptr_pairproxy.h:82
ASSOCIATED_TYPE second
Definition bslma_managedptr_pairproxy.h:83
Definition bslmf_isbitwisemoveable.h:718