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 | |
|---|---|
| auto | gates() const |
| auto | basic_events() const |
| auto | house_events() const |
| auto | parameters() const |
| auto | ccf_groups() const |
| auto | components() const |
| void | Add(Gate * element)<br>Adds MEF constructs into this component container. |
| void | Add(BasicEvent * element) |
| void | Add(HouseEvent * element) |
| void | Add(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 | |
|---|---|
| void | GatherGates(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_view | name_view() const |
| const std::string & | label() const |
| void | label(std::string label)<br>Sets the element label. |
| const AttributeMap & | attributes() const |
| void | AddAttribute(Attribute attr)<br>Adds an attribute to the attribute map of this element. |
| void | SetAttribute(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 | |
| void | name(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. | |
| RoleSpecifier | role() const |
| const std::string & | base_path() const |
Protected Functions inherited from scram::mef::Role
| Name | |
|---|---|
| ~Role() =default |
| Name | |
|---|---|
| template <class T > <br>auto | table() const |
| template <class T > <br>auto | table() |
| 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 | |
|---|---|
| class | Container |
Public Functions Documentation
function gates
inline auto gates() constReturn: The table ranges of component elements of specific kind with element original names as keys.
function basic_events
inline auto basic_events() constfunction house_events
inline auto house_events() constfunction parameters
inline auto parameters() constfunction ccf_groups
inline auto ccf_groups() constfunction components
inline auto components() constfunction Add
inline void Add(
Gate * element
)Adds MEF constructs into this component container.
Parameters:
- element The element to be added to the container.
Exceptions:
- DuplicateElementError The element is already in this container.
function Add
inline void Add(
BasicEvent * element
)function Add
inline void Add(
HouseEvent * element
)function Add
void Add(
CcfGroup * element
)function Component
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:
- LogicError The name is empty.
- ValidityError The name or reference paths are malformed.
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
virtual ~Component() =defaultProtected Functions Documentation
function GatherGates
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
static constexpr const char * kTypeString = "component/fault tree";Type identifier string for error messages.
Updated on 2025-11-11 at 16:51:08 +0000
