22 return dynamic_cast<T*
>(
this);
30 return dynamic_cast<const T*
>(
this);
38 template<
typename T> T*
as() {
39 T* ptr =
dynamic_cast<T*
>(
this);
40 if ( ptr ==
nullptr ) {
41 throw std::runtime_error(
"Element: Illegal cast of element");
51 template<
typename T>
const T*
as()
const {
52 const T* ptr =
dynamic_cast<const T*
>(
this);
53 if ( ptr ==
nullptr ) {
54 throw std::runtime_error(
"Element: Illegal cast of element");
Abstract base class for all elements in a BPMN model.
const T * represents() const
Attempts to cast the element to the specified type T.
const T * as() const
Casts the element to the specified type T.
T * as()
Casts the element to the specified type T.
virtual ~Element()=default
T * represents()
Attempts to cast the element to the specified type T.
The BPMN namespace contains linked classes representing a BPMN model.