BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlar_vtableutil.h
Go to the documentation of this file.
1/// @file bdlar_vtableutil.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlar_vtableutil.h -*-C++-*-
8#ifndef INCLUDED_BDLAR_VTABLEUTIL
9#define INCLUDED_BDLAR_VTABLEUTIL
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bdlar_vtableutil bdlar_vtableutil
15/// @brief Provide ...
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlar
19/// @{
20/// @addtogroup bdlar_vtableutil
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlar_vtableutil-purpose"> Purpose</a>
25/// * <a href="#bdlar_vtableutil-classes"> Classes </a>
26/// * <a href="#bdlar_vtableutil-description"> Description </a>
27///
28/// # Purpose {#bdlar_vtableutil-purpose}
29/// Provide ...
30///
31/// # Classes {#bdlar_vtableutil-classes}
32///
33/// - bdlar::VtableUtil: ...
34///
35/// # Description {#bdlar_vtableutil-description}
36/// This component provides ...
37///
38/// @}
39/** @} */
40/** @} */
41
42/** @addtogroup bdl
43 * @{
44 */
45/** @addtogroup bdlar
46 * @{
47 */
48/** @addtogroup bdlar_vtableutil
49 * @{
50 */
51
52#include <bdlar_typecategory.h>
53
54
55namespace bdlar {
56
57// Forward
58class SimpleTypeVtableUtil;
59class EnumVtableUtil;
60class NullableValueVtableUtil;
61class ArrayVtableUtil;
62class SequenceVtableUtil;
63class ChoiceVtableUtil;
64class CustomizedTypeVtableUtil;
65class DynamicTypeVtableUtil;
66
67 // ============================
68 // struct VtableUtil_ByCategory
69 // ============================
70
71template <class t_CATEGORY>
72struct VtableUtil_ByCategory; // must be specialized
73
74// Category -> VtableUtil mappings:
75
76template <>
80
81template <>
85
86template <>
90
91template <>
95
96template <>
100
101template <>
105
106template <>
110
111template <>
115
116 // ================
117 // class VtableUtil
118 // ================
119
120/// Functions returning vtables by type category.
121///
122/// See @ref bdlar_vtableutil
124
125 // PRIVATE TYPES
126 template <class t_TYPE>
127 struct ForType {
128 // TYPES
129 typedef typename SelectCategory<t_TYPE>::Type Category;
130 typedef typename VtableUtil_ByCategory<Category>::Type Util;
131
132 typedef typename Util::VtableType Vtable;
133 typedef typename Util::ConstVtableType ConstVtable;
134 };
135
136 public:
137 // CLASS METHODS
138 template <class t_TYPE>
139 static const typename ForType<t_TYPE>::ConstVtable *getConstVtable();
140
141 template <class t_TYPE>
142 static const typename ForType<t_TYPE>::Vtable *getVtable();
143};
144
145// ============================================================================
146// INLINE DEFINITIONS
147// ============================================================================
148
149 // ----------------
150 // class VtableUtil
151 // ----------------
152
153// CLASS METHODS
154template <class t_TYPE>
155inline
156const typename VtableUtil::ForType<t_TYPE>::ConstVtable *
158{
159 typedef typename ForType<t_TYPE>::Util Util;
160 return Util::template getConstVtable<t_TYPE>();
161}
162
163template <class t_TYPE>
164inline
165const typename VtableUtil::ForType<t_TYPE>::Vtable *
167{
168 typedef typename ForType<t_TYPE>::Util Util;
169 return Util::template getVtable<t_TYPE>();
170}
171
172} // close package namespace
173
174
175#endif
176
177// ----------------------------------------------------------------------------
178// Copyright 2024 Bloomberg Finance L.P.
179//
180// Licensed under the Apache License, Version 2.0 (the "License");
181// you may not use this file except in compliance with the License.
182// You may obtain a copy of the License at
183//
184// http://www.apache.org/licenses/LICENSE-2.0
185//
186// Unless required by applicable law or agreed to in writing, software
187// distributed under the License is distributed on an "AS IS" BASIS,
188// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189// See the License for the specific language governing permissions and
190// limitations under the License.
191// ----------------------------- END-OF-FILE ----------------------------------
192
193/** @} */
194/** @} */
195/** @} */
Definition bdlar_arrayvtableutil.h:66
Definition bdlar_choicevtableutil.h:65
Definition bdlar_customizedtypevtableutil.h:66
Definition bdlar_dynamictypevtableutil.h:66
Definition bdlar_enumvtableutil.h:65
Definition bdlar_nullablevaluevtableutil.h:66
Definition bdlar_sequencevtableutil.h:65
Definition bdlar_simpletypevtableutil.h:65
Definition bdlar_vtableutil.h:123
static const ForType< t_TYPE >::Vtable * getVtable()
Definition bdlar_vtableutil.h:166
static const ForType< t_TYPE >::ConstVtable * getConstVtable()
Definition bdlar_vtableutil.h:157
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlar_accessorref.h:59
ArrayVtableUtil Type
Definition bdlar_vtableutil.h:93
ChoiceVtableUtil Type
Definition bdlar_vtableutil.h:103
CustomizedTypeVtableUtil Type
Definition bdlar_vtableutil.h:108
DynamicTypeVtableUtil Type
Definition bdlar_vtableutil.h:113
EnumVtableUtil Type
Definition bdlar_vtableutil.h:78
NullableValueVtableUtil Type
Definition bdlar_vtableutil.h:83
SequenceVtableUtil Type
Definition bdlar_vtableutil.h:98
SimpleTypeVtableUtil Type
Definition bdlar_vtableutil.h:88
Definition bdlar_vtableutil.h:72
Definition bdlat_typecategory.h:1033
Definition bslmf_nil.h:133