Skip to content

scram::mef::ExternFunction< void >

Abstract base class for ExternFunction concrete types. More...

#include <extern.h>

Inherits from scram::mef::Element, scram::mef::Usage, scram::mef::ContainerElement, boost::noncopyable

Inherited by scram::mef::ExternFunction< R, Args... >, scram::mef::ExternFunction< R, Args >

Public Functions

Name
virtual~ExternFunction() =default
virtual std::unique_ptr< Expression >apply(std::vector< Expression * > args) const =0<br>Applies the function to arguments.
Element(std::string name)<br>Constructs an element with an original name.

Public Attributes

Name
constexpr const char *kTypeString <br>Type string for error messages.

Additional inherited members

Public Types inherited from scram::mef::Element

Name
using ext::linear_set< Attribute, AttributeKey >AttributeMap <br>Unique attribute map keyed with the attribute names.

Public Functions inherited from scram::mef::Element

Name
const std::string &name() const
std::string_viewname_view() const
const std::string &label() const
voidlabel(std::string label)<br>Sets the element label.
const AttributeMap &attributes() const
voidAddAttribute(Attribute attr)<br>Adds an attribute to the attribute map of this element.
voidSetAttribute(Attribute attr)<br>Sets an attribute to the attribute map.
const Attribute *GetAttribute(std::string_view name) const
std::optional< Attribute >RemoveAttribute(std::string_view name)<br>Removes an attribute of this element.

Protected Functions inherited from scram::mef::Element

Name
~Element() =default
voidname(std::string name)<br>Resets the element name.

Public Functions inherited from scram::mef::Usage

Name
boolusage() const
voidusage(bool usage)

Protected Functions inherited from scram::mef::Usage

Name
~Usage() =default

Protected Functions inherited from scram::mef::ContainerElement

Name
const Element *container() const

Friends inherited from scram::mef::ContainerElement

Name
classContainer

Detailed Description

cpp
class scram::mef::ExternFunction< void >;

Abstract base class for ExternFunction concrete types.

This interface hides the return and argument types of generic extern functions and expressions.

The base acts as a factory for generating expressions with given arguments.

Public Functions Documentation

function ~ExternFunction

cpp
virtual ~ExternFunction() =default

function apply

cpp
virtual std::unique_ptr< Expression > apply(
    std::vector< Expression * > args
) const =0

Applies the function to arguments.

Parameters:

  • args The argument expressions.

Exceptions:

Return: Newly constructed expression as a result of function application.

Reimplemented by: scram::mef::ExternFunction::apply, scram::mef::ExternFunction::apply

This interface hides the complexity of concrete types of the function.

function Element

cpp
explicit Element(
    std::string name
)

Constructs an element with an original name.

Parameters:

  • name The local identifier name.

Exceptions:

The name is expected to conform to identifier requirements described in the MEF documentation and additions.

Public Attributes Documentation

variable kTypeString

cpp
static constexpr const char * kTypeString = "extern function";

Type string for error messages.


Updated on 2025-11-11 at 16:51:08 +0000