Skip to content

scram::mef::FaultTree

Fault tree representation as a container of gates, basic and house events, and other information. More...

#include <fault_tree.h>

Inherits from scram::mef::Component, 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

Public Functions

Name
FaultTree(const std::string & name)<br>The main constructor of the Fault Tree.
const std::vector< const Gate * > &top_events() const
voidCollectTopEvents()<br>Collects top event gates in this fault tree with components.

Public Attributes

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

Additional inherited members

Public Functions inherited from scram::mef::Component

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 inherited from scram::mef::Component

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

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

Detailed Description

cpp
class scram::mef::FaultTree;

Fault tree representation as a container of gates, basic and house events, and other information.

Additional functionality of a fault tree includes detection of top events.

Public Functions Documentation

function FaultTree

cpp
explicit FaultTree(
    const std::string & name
)

The main constructor of the Fault Tree.

Parameters:

  • name The name identifier of this fault tree.

Fault trees are assumed to be public and belong to the root model.

function top_events

cpp
inline const std::vector< const Gate * > & top_events() const

Return: The collected top events of this fault tree.

function CollectTopEvents

cpp
void CollectTopEvents()

Collects top event gates in this fault tree with components.

Precondition: Gate marks are clear.

This function is essential to guess the analysis targets if the user does not supply any. If the structure of the fault tree changes, this function must be called again to update the top events.

Public Attributes Documentation

variable kTypeString

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

Type identifier string for error messages.


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