bpmn++
A BPMN parser library, written in C++
Loading...
Searching...
No Matches
BPMN::BaseElement Class Reference

Base class for all core BPMN elements. More...

Detailed Description

The class allows to access the underlying XML element and may have associated extension elements.

Definition at line 15 of file BaseElement.h.

#include <BaseElement.h>

Inheritance diagram for BPMN::BaseElement:

Public Member Functions

 BaseElement (XML::bpmn::tBaseElement *element)
 Constructs a BaseElement object representing a BPMN element.
 ~BaseElement ()
 Destructor.
template<typename T>
T * is ()
 Attempts to return the element in the specified type T.
template<typename T>
const T * is () const
 Attempts to return the element in the specified type T.
template<typename T = XML::bpmn::tBaseElement>
T * get ()
 Casts the element to the specified type T.
template<typename T = XML::bpmn::tBaseElement>
const T * get () const
 Casts the element to the specified type T.
Public Member Functions inherited from BPMN::Element
virtual ~Element ()=default
template<typename T>
T * represents ()
 Attempts to cast the element to the specified type T.
template<typename T>
const T * represents () const
 Attempts to cast the element to the specified type T.
template<typename T>
T * as ()
 Casts the element to the specified type T.
template<typename T>
const T * as () const
 Casts the element to the specified type T.

Public Attributes

XML::bpmn::tBaseElementelement
std::string id
 Id of element.
std::unique_ptr< ExtensionElementsextensionElements

Constructor & Destructor Documentation

◆ BaseElement()

BaseElement::BaseElement ( XML::bpmn::tBaseElement * element)

Definition at line 6 of file BaseElement.cpp.

◆ ~BaseElement()

BaseElement::~BaseElement ( )
default
Note
Declared here and defined out-of-line (in BaseElement.cpp, where ExtensionElements is a complete type) so that the destructor of the std::unique_ptr<ExtensionElements> member is not instantiated against the forward-declared type. Clang requires the complete type at the point of instantiation, so an implicit destructor here fails to compile.

Member Function Documentation

◆ get() [1/2]

template<typename T = XML::bpmn::tBaseElement>
T * BPMN::BaseElement::get ( )
inline
Returns
A pointer to casted object
Exceptions
std::runtime_errorif the cast fails

Definition at line 55 of file BaseElement.h.

◆ get() [2/2]

template<typename T = XML::bpmn::tBaseElement>
const T * BPMN::BaseElement::get ( ) const
inline
Returns
A pointer to casted object
Exceptions
std::runtime_errorif the cast fails

Definition at line 68 of file BaseElement.h.

◆ is() [1/2]

template<typename T>
T * BPMN::BaseElement::is ( )
inline
Returns
A pointer to casted object or nullptr if the cast fails

Definition at line 38 of file BaseElement.h.

◆ is() [2/2]

template<typename T>
const T * BPMN::BaseElement::is ( ) const
inline
Returns
A pointer to casted object or nullptr if the cast fails

Definition at line 46 of file BaseElement.h.

Member Data Documentation

◆ element

XML::bpmn::tBaseElement* BPMN::BaseElement::element

Definition at line 28 of file BaseElement.h.

◆ extensionElements

std::unique_ptr<ExtensionElements> BPMN::BaseElement::extensionElements

Definition at line 32 of file BaseElement.h.

◆ id

std::string BPMN::BaseElement::id

Definition at line 31 of file BaseElement.h.


The documentation for this class was generated from the following files: