casting operations for DataVector/List
, dynamic_cast
version.
More...
#include <DVLCast.h>
|
typedef DVL::base_value_type | T |
|
template<class DVL>
struct DataModel_detail::DVLCast< DVL, true >
casting operations for DataVector/List
, dynamic_cast
version.
Definition at line 88 of file DVLCast.h.
◆ cast() [1/2]
template<class DVL >
template<class U >
Cast b to a const
T*.
- Parameters
-
Definition at line 132 of file DVLCast.h.
137 if (
typeid(*
b) ==
typeid(
T)) {
138 static ptrdiff_t offs = LONG_MAX;
139 if (offs == LONG_MAX) {
140 T*
ret =
dynamic_cast<const T*
> (
b);
141 offs =
reinterpret_cast<char*
>(
ret) -
reinterpret_cast<char*
>(
b);
144 return reinterpret_cast<const T*
> (
reinterpret_cast<char*
>(
b) + offs);
147 return dynamic_cast<const T*
> (
b);
◆ cast() [2/2]
template<class DVL >
template<class U >
Cast b to a T*
.
- Parameters
-
Definition at line 110 of file DVLCast.h.
118 if (
typeid(*
b) ==
typeid(
T)) {
120 return reinterpret_cast<T*
> (
reinterpret_cast<char*
>(
b) + offs);
123 return dynamic_cast<T*
> (
b);
◆ find_offset()
template<class DVL >
template<class U >
Find the offset of T
within U
.
Definition at line 97 of file DVLCast.h.
99 T*
ret =
dynamic_cast<T*
> (
b);
100 int offs =
reinterpret_cast<char*
>(
ret) -
reinterpret_cast<char*
>(
b);
The documentation for this struct was generated from the following file: