8#ifndef INCLUDED_BDLAR_ACCESSORVTABLEUTIL
9#define INCLUDED_BDLAR_ACCESSORVTABLEUTIL
52#include <bdlar_accessorvtable.h>
66 template <
class t_ACCESSOR,
class t_REF>
67 static int access(
const void *accessorPtr,
const t_REF& ref);
70 template <
class t_ACCESSOR>
71 static int accessSimple(
const void *accessorPtr,
76 template <
class t_ACCESSOR>
77 static int accessSimpleWithInfo(
const void *accessorPtr,
83 template <
class t_ACCESSOR,
class t_REF>
84 static int accessWithInfo(
const void *accessorPtr,
93 template <
class t_ACCESSOR>
98 template <
class t_ACCESSOR>
111template <
class t_ACCESSOR,
class t_REF>
112int AccessorVtableUtil::access(
const void *accessorPtr,
const t_REF& ref)
114 t_ACCESSOR& accessor = *
reinterpret_cast<t_ACCESSOR *
>(
115 const_cast<void *
>(accessorPtr));
116 return accessor(ref);
119template <
class t_ACCESSOR>
120int AccessorVtableUtil::accessSimple(
const void *accessorPtr,
121 const SimpleTypeConstRef& ref)
123 return ref.access(*
reinterpret_cast<t_ACCESSOR *
>(
124 const_cast<void *
>(accessorPtr)));
127template <
class t_ACCESSOR>
128int AccessorVtableUtil::accessSimpleWithInfo(
129 const void *accessorPtr,
130 const SimpleTypeConstRef& ref,
131 const FieldInfoRef& info)
133 return ref.access(*
reinterpret_cast<t_ACCESSOR *
>(
134 const_cast<void *
>(accessorPtr)),
138template <
class t_ACCESSOR,
class t_REF>
139int AccessorVtableUtil::accessWithInfo(
const void *accessorPtr,
141 const FieldInfoRef& info)
143 t_ACCESSOR& accessor = *
reinterpret_cast<t_ACCESSOR *
>(
144 const_cast<void *
>(accessorPtr));
145 return accessor(ref, info);
149template <
class t_ACCESSOR>
153 &access<t_ACCESSOR, DynamicTypeConstRef>,
154 &access<t_ACCESSOR, ArrayConstRef>,
155 &access<t_ACCESSOR, ChoiceConstRef>,
156 &access<t_ACCESSOR, CustomizedTypeConstRef>,
157 &access<t_ACCESSOR, EnumConstRef>,
158 &access<t_ACCESSOR, NullableValueConstRef>,
159 &access<t_ACCESSOR, SequenceConstRef>,
160 &accessSimple<t_ACCESSOR>
165template <
class t_ACCESSOR>
169 &accessWithInfo<t_ACCESSOR, DynamicTypeConstRef>,
170 &accessWithInfo<t_ACCESSOR, ArrayConstRef>,
171 &accessWithInfo<t_ACCESSOR, ChoiceConstRef>,
172 &accessWithInfo<t_ACCESSOR, CustomizedTypeConstRef>,
173 &accessWithInfo<t_ACCESSOR, EnumConstRef>,
174 &accessWithInfo<t_ACCESSOR, NullableValueConstRef>,
175 &accessWithInfo<t_ACCESSOR, SequenceConstRef>,
176 &accessSimpleWithInfo<t_ACCESSOR>
Definition bdlar_accessorvtableutil.h:62
static const AccessorWithInfoVtable * getWithInfoVtable()
Definition bdlar_accessorvtableutil.h:166
static const AccessorVtable * getVtable()
Definition bdlar_accessorvtableutil.h:150
Definition bdlar_fieldinfo.h:102
Definition bdlar_simpletyperef.h:216
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlar_accessorref.h:59
reference_wrapper< T > ref(T &object)
Return a reference wrapper that represents the specified object.
Definition bdlar_accessorvtable.h:71
Definition bdlar_accessorvtable.h:102