HOPS
HOPS class reference
|
Class MHO_ExtensibleElement. More...
#include <MHO_ExtensibleElement.hh>
Public Member Functions | |
MHO_ExtensibleElement () | |
virtual | ~MHO_ExtensibleElement () |
void | Accept (MHO_Visitor *aVisitor) override |
Visits all extensions of MHO_ExtensibleElement using given visitor. More... | |
template<class XExtensionType > | |
MHO_ExtendedElement< XExtensionType > * | AsExtension () |
Returns an extension of type XExtensionType if found in the list of extensions. More... | |
template<class XExtensionType > | |
bool | HasExtension () const |
Checks if an extensible element has a specific extension type. More... | |
template<class XExtensionType > | |
MHO_ExtendedElement< XExtensionType > * | MakeExtension () |
Creates and adds a new extension of type XExtensionType to the list of extensions. More... | |
![]() | |
MHO_Element () | |
virtual | ~MHO_Element () |
Protected Attributes | |
std::vector< MHO_Element * > | fExtensions |
Class MHO_ExtensibleElement.
Implements an interface by which a class that inherits from MHO_ExtensibleElement can have arbitrarily extended functionality added to it without modifying the original class Pointers to the extensions are stored internally, and access proceeds through the visitor pattern. This interface should be used VERY sparingly, as dynamic_casts are expensive and the number of dynamic_casts needed for a single call to the 'Accept' method scales like N*M (where N is the number of visitors, and M the number of extensions).
|
inline |
|
inlinevirtual |
|
inlineoverridevirtual |
Visits all extensions of MHO_ExtensibleElement using given visitor.
aVisitor | MHO_Visitor to traverse and operate on extensions |
Implements hops::MHO_Element.
|
inline |
Returns an extension of type XExtensionType if found in the list of extensions.
Returns a dynamically casted extension of type XExtensionType if found among stored extensions.
XExtensionType | Template parameter XExtensionType |
|
inline |
Checks if an extensible element has a specific extension type.
|
inline |
Creates and adds a new extension of type XExtensionType to the list of extensions.
Creates and adds a new extension of type XExtensionType to the extensible element.
XExtensionType | Template parameter XExtensionType |
|
protected |