4 #if __cplusplus>=201103L 5 # include <type_traits> 18 namespace epics{
namespace pvData{
30 #if __cplusplus>=201103L 32 constexpr
size_t cmax(
size_t A,
size_t B) {
54 #if __cplusplus>=201103L 57 virtual const char* what()
const noexcept
61 virtual const char*
what()
const throw()
63 {
return "bad_cast() type mis-match"; }
70 #if __cplusplus>=201103L 73 typename std::aligned_storage<detail::cmax(
sizeof(std::string),
sizeof(
double)),
74 detail::cmax(
alignof(std::string),
alignof(
double))
80 char data[
sizeof(std::string)];
87 typedef double _largest_blob;
91 return *
reinterpret_cast<T*
>(_wrap.blob);
94 inline const T& _as()
const {
95 return *
reinterpret_cast<const T*
>(_wrap.blob);
111 new (_wrap.blob) TT(v);
125 #if __cplusplus>=201103L 142 #if __cplusplus>=201103L 162 inline void*
unsafe() {
return _wrap.blob; }
163 inline const void*
unsafe()
const {
return _wrap.blob; }
167 #if __cplusplus>=201103L 168 explicit operator bool()
const {
return !
empty(); }
179 const void* bufferUnsafe()
const;
200 return reinterpret_cast<TT&
>(_wrap.blob);
251 #endif // PV_ANYSCALAR_H epics::pvData::BitSetPtr empty
EPICS_ALWAYS_INLINE T swap(T val)
An EPICS-specific replacement for ANSI C's assert.
virtual const char * what() const
TODO only here because of the Lockable.
std::ostream & operator<<(std::ostream &o, const Field &f)
AnyScalar(T v)
Construct from provided value.
ScalarType type() const
Type code of contained value. Or (ScalarType)-1 is empty.
#define STATIC_ASSERT(expr)
Declare a condition that should be true at compile-time.
const void * unsafe() const
AnyScalar & operator=(const AnyScalar &o)
meta::decorate_const< typename detail::any_storage_type< typename meta::strip_const< T >::type >::type >::type & ref() const
epicsShareExtern void castUnsafeV(size_t count, ScalarType to, void *dest, ScalarType from, const void *src)
detail::any_storage_type< typename meta::strip_const< T >::type >::type & ref()
AnyScalar & operator=(T v)