BDE 4.39.x 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) `ASSOCIATED_TYPE` is a POD.
75///
76/// \note Note that the names of the data members
77/// must exactly match those of `bsl::pair` to support users simply acting
78/// on the result of a function call from which a pair proxy is returned,
79/// and not assigning that result to a `bsl::pair` first.
80///
81/// See @ref bslma_managedptr_pairproxy
82template <class POINTER_TYPE, class ASSOCIATED_TYPE>
84
85 POINTER_TYPE *first;
86 ASSOCIATED_TYPE second;
87};
88
89// ============================================================================
90// INLINE DEFINITIONS
91// ============================================================================
92
93 // --------------------------
94 // class ManagedPtr_PairProxy
95 // --------------------------
96
97} // close package namespace
98
99// TYPE TRAITS
100namespace bslmf {
101
102template <class POINTER_TYPE, class ASSOCIATED_TYPE>
103struct IsBitwiseMoveable<bslma::ManagedPtr_PairProxy<POINTER_TYPE,
104 ASSOCIATED_TYPE> >
105 : IsBitwiseMoveable<ASSOCIATED_TYPE>::type
106{
107};
108
109} // close namespace bslmf
110
111
112#endif
113
114// ----------------------------------------------------------------------------
115// Copyright 2016 Bloomberg Finance L.P.
116//
117// Licensed under the Apache License, Version 2.0 (the "License");
118// you may not use this file except in compliance with the License.
119// You may obtain a copy of the License at
120//
121// http://www.apache.org/licenses/LICENSE-2.0
122//
123// Unless required by applicable law or agreed to in writing, software
124// distributed under the License is distributed on an "AS IS" BASIS,
125// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126// See the License for the specific language governing permissions and
127// limitations under the License.
128// ----------------------------- END-OF-FILE ----------------------------------
129
130/** @} */
131/** @} */
132/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition baljsn_encoder_testtypes.h:76
Definition bdlbb_blob.h:579
Definition bslma_managedptr_pairproxy.h:83
POINTER_TYPE * first
Definition bslma_managedptr_pairproxy.h:85
ASSOCIATED_TYPE second
Definition bslma_managedptr_pairproxy.h:86
Definition bslmf_isbitwisemoveable.h:718