Skip to content

scram::mef::Component

Component is for logical grouping of events, gates, and other components.

#include <fault_tree.h>

Inherits from scram::mef::Element, scram::mef::Role, scram::mef::Composite< Container< Component, Component, true, false >, Container< Component, BasicEvent, false, false >, Container< Component, HouseEvent, false, false >, Container< Component, Gate, false, false >, Container< Component, Parameter, false, false >, Container< Component, CcfGroup, false, false > >, scram::mef::ContainerElement, boost::noncopyable

Inherited by scram::mef::FaultTree

Public Functions

Name
autogates() const
autobasic_events() const
autohouse_events() const
autoparameters() const
autoccf_groups() const
autocomponents() const
voidAdd(Gate * element)<br>Adds MEF constructs into this component container.
voidAdd(BasicEvent * element)
voidAdd(HouseEvent * element)
voidAdd(CcfGroup * element)
Component(std::string name, std::string base_path ="", RoleSpecifier role =RoleSpecifier::kPublic)<br>Constructs a component assuming that it exists within some fault tree.
virtual~Component() =default

Protected Functions

Name
voidGatherGates(std::unordered_set< Gate * > * gates)<br>Recursively traverses components to gather gates relevant to the whole component.

Public Attributes

Name
constexpr const char *kTypeString <br>Type identifier 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
Element(std::string name)<br>Constructs an element with an original 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::Role

Name
Role(RoleSpecifier role =RoleSpecifier::kPublic, std::string base_path ="")<br>Sets the role of an element upon creation.
RoleSpecifierrole() const
const std::string &base_path() const

Protected Functions inherited from scram::mef::Role

Name
~Role() =default

Public Functions inherited from scram::mef::Composite< Container< Component, Component, true, false >, Container< Component, BasicEvent, false, false >, Container< Component, HouseEvent, false, false >, Container< Component, Gate, false, false >, Container< Component, Parameter, false, false >, Container< Component, CcfGroup, false, false > >

Name
template <class T > <br>autotable() const
template <class T > <br>autotable()
template <class T ,class ContainerType =typename detail::container_of<T, Ts...>::type> <br>const T &Get(const typename ContainerType::key_type & id) const<br>Retrieves an element from the container.
template <class T ,class ContainerType =typename detail::container_of<T, Ts...>::type> <br>T &Get(const typename ContainerType::key_type & id)

Protected Functions inherited from scram::mef::Composite< Container< Component, Component, true, false >, Container< Component, BasicEvent, false, false >, Container< Component, HouseEvent, false, false >, Container< Component, Gate, false, false >, Container< Component, Parameter, false, false >, Container< Component, CcfGroup, false, false > >

Name
template <class T > <br>decltype(auto)data() const

Protected Functions inherited from scram::mef::ContainerElement

Name
const Element *container() const

Friends inherited from scram::mef::ContainerElement

Name
classContainer

Public Functions Documentation

function gates

cpp
inline auto gates() const

Return: The table ranges of component elements of specific kind with element original names as keys.

function basic_events

cpp
inline auto basic_events() const

function house_events

cpp
inline auto house_events() const

function parameters

cpp
inline auto parameters() const

function ccf_groups

cpp
inline auto ccf_groups() const

function components

cpp
inline auto components() const

function Add

cpp
inline void Add(
    Gate * element
)

Adds MEF constructs into this component container.

Parameters:

  • element The element to be added to the container.

Exceptions:

function Add

cpp
inline void Add(
    BasicEvent * element
)

function Add

cpp
inline void Add(
    HouseEvent * element
)

function Add

cpp
void Add(
    CcfGroup * element
)

function Component

cpp
explicit Component(
    std::string name,
    std::string base_path ="",
    RoleSpecifier role =RoleSpecifier::kPublic
)

Constructs a component assuming that it exists within some fault tree.

Parameters:

  • name The name identifier for the component.
  • base_path The series of containers to get this container.
  • role The default role for container members.

Exceptions:

The public or private role of a component is not for the components itself, but for the events and parameters of the component. Component name is not meant to be public; however, it must be unique within the parent fault tree or component.

function ~Component

cpp
virtual ~Component() =default

Protected Functions Documentation

function GatherGates

cpp
void GatherGates(
    std::unordered_set< Gate * > * gates
)

Recursively traverses components to gather gates relevant to the whole component.

Parameters:

  • gates Gates belonging to this component and its subcomponents.

Public Attributes Documentation

variable kTypeString

cpp
static constexpr const char * kTypeString = "component/fault tree";

Type identifier string for error messages.


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