#include <misc/pv/anyscalar.h>
|
|
std::ostream & | operator<< (std::ostream &strm, const AnyScalar &v) |
| |
A type-safe variant union capable of holding any of the PVD scalar types (POD or string)
assert(A.ref<
int32>()==5);
assert(A.as<
int32>()==5);
assert(A.as<double>()==5.0);
assert(A.ref<double>()==5.0);
Definition at line 51 of file anyscalar.h.
◆ AnyScalar() [1/3]
| epics::pvData::AnyScalar::AnyScalar |
( |
| ) |
|
|
inline |
Construct empty
- Postcondition
- empty()==true
Definition at line 100 of file anyscalar.h.
◆ AnyScalar() [2/3]
template<typename T >
| epics::pvData::AnyScalar::AnyScalar |
( |
T | v | ) |
|
|
inlineexplicit |
Construct from provided value.
Definition at line 104 of file anyscalar.h.
◆ AnyScalar() [3/3]
| epics::pvData::AnyScalar::AnyScalar |
( |
ScalarType | type, |
|
|
const void * | buf ) |
Construct from un-typed pointer. Caller is responsible to ensure that buf actually points to the provided type
- Version
- Added after 7.0.0
◆ ~AnyScalar()
| epics::pvData::AnyScalar::~AnyScalar |
( |
| ) |
|
|
inline |
◆ as()
template<typename T >
| T epics::pvData::AnyScalar::as |
( |
| ) |
const |
|
inline |
copy out wrapped value, with a value conversion.
- Exceptions
-
Definition at line 230 of file anyscalar.h.
◆ bufferUnsafe()
| const void * epics::pvData::AnyScalar::bufferUnsafe |
( |
| ) |
const |
Provide read-only access to underlying buffer. For a string this is std::string::c_str().
- Version
- Added after 7.0.0
◆ clear()
| void epics::pvData::AnyScalar::clear |
( |
| ) |
|
Reset internal state.
- Version
- Added after 7.0.0
- Postcondition
- empty()==true
◆ empty()
| bool epics::pvData::AnyScalar::empty |
( |
| ) |
const |
|
inline |
◆ operator bool_type()
| epics::pvData::AnyScalar::operator bool_type |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
template<typename T >
| AnyScalar & epics::pvData::AnyScalar::operator= |
( |
T | v | ) |
|
|
inline |
◆ ref() [1/2]
Return typed reference to wrapped value. Non-const reference allows value modification
- Exceptions
-
| bad_cast | when the requested type does not match the stored type
assert(v.ref< uint32>() == 43);
|
Definition at line 194 of file anyscalar.h.
◆ ref() [2/2]
Return typed reference to wrapped value. Const reference does not allow modification.
- Exceptions
-
| bad_cast | when the requested type does not match the stored type
assert(v.ref< uint32>() == 42);
|
Definition at line 215 of file anyscalar.h.
◆ type()
| ScalarType epics::pvData::AnyScalar::type |
( |
| ) |
const |
|
inline |
Type code of contained value. Or (ScalarType)-1 is empty.
Definition at line 158 of file anyscalar.h.
◆ unsafe() [1/2]
| void * epics::pvData::AnyScalar::unsafe |
( |
| ) |
|
|
inline |
◆ unsafe() [2/2]
| const void * epics::pvData::AnyScalar::unsafe |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: