KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
Classes | List of all members
Kratos::RegistryItem Class Reference

The registry item to be stored by Registry class. It is the base class for some more specific ones. More...

#include <registry_item.h>

Collaboration diagram for Kratos::RegistryItem:

Classes

class  KeyReturnConstIterator
 Custom iterator with key as return type to be used in the Python export. More...
 

Public Member Functions

Life Cycle
 RegistryItem ()=delete
 Default constructor deleted. More...
 
 RegistryItem (const std::string &rName)
 Constructor with the name. More...
 
template<typename TItemType , typename... TArgs>
 RegistryItem (const std::string &rName, const std::function< std::shared_ptr< TItemType >(TArgs...)> &rValue)
 Constructor with the name and lambda. More...
 
template<class TItemType >
 RegistryItem (const std::string &rName, const TItemType &rValue)
 Constructor with the name and value. More...
 
template<class TItemType >
 RegistryItem (const std::string &rName, const shared_ptr< TItemType > &pValue)
 Constructor with the name and shared ptr. More...
 
 RegistryItem (RegistryItem const &rOther)=delete
 
 ~RegistryItem ()=default
 Destructor. More...
 
RegistryItemoperator= (RegistryItem &rOther)=delete
 Assignment operator deleted. More...
 
Items
template<typename TItemType , class... TArgumentsList>
RegistryItemAddItem (std::string const &ItemName, TArgumentsList &&... Arguments)
 
Access
SubRegistryItemType::iterator begin ()
 
SubRegistryItemType::const_iterator cbegin () const
 
SubRegistryItemType::iterator end ()
 
SubRegistryItemType::const_iterator cend () const
 
KeyReturnConstIterator KeyConstBegin () const
 
KeyReturnConstIterator KeyConstEnd () const
 
const std::string & Name () const
 
RegistryItem const & GetItem (std::string const &rItemName) const
 
RegistryItemGetItem (std::string const &rItemName)
 
template<typename TDataType >
TDataType const & GetValue () const
 
template<typename TDataType , typename TCastType >
TCastType const & GetValueAs () const
 
void RemoveItem (std::string const &rItemName)
 
Inquiry
std::size_t size ()
 
bool HasValue () const
 
bool HasItems () const
 
bool HasItem (std::string const &rItemName) const
 
Input and output
std::string Info () const
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 
std::string ToJson (std::string const &rTabSpacing="", const std::size_t Level=0) const
 

Type Definitions

using SubRegistryItemType = std::unordered_map< std::string, Kratos::shared_ptr< RegistryItem > >
 Subregistry item type definition. More...
 
using SubRegistryItemPointerType = Kratos::shared_ptr< SubRegistryItemType >
 Pointer definition of SubRegistryItemType. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (RegistryItem)
 Pointer definition of RegistryItem. More...
 

Detailed Description

The registry item to be stored by Registry class. It is the base class for some more specific ones.

RegistryItem has a tree node structure and stores its name, an optional value, and an unorder_set of its sub data. This structure let us to have registry of the elements and then different registries for each elements inside it. Please note that RegistryItem stores a shared pointer to the value.

Member Typedef Documentation

◆ SubRegistryItemPointerType

Pointer definition of SubRegistryItemType.

◆ SubRegistryItemType

Subregistry item type definition.

Constructor & Destructor Documentation

◆ RegistryItem() [1/6]

Kratos::RegistryItem::RegistryItem ( )
delete

Default constructor deleted.

◆ RegistryItem() [2/6]

Kratos::RegistryItem::RegistryItem ( const std::string &  rName)
inline

Constructor with the name.

◆ RegistryItem() [3/6]

template<typename TItemType , typename... TArgs>
Kratos::RegistryItem::RegistryItem ( const std::string &  rName,
const std::function< std::shared_ptr< TItemType >(TArgs...)> &  rValue 
)
inline

Constructor with the name and lambda.

◆ RegistryItem() [4/6]

template<class TItemType >
Kratos::RegistryItem::RegistryItem ( const std::string &  rName,
const TItemType &  rValue 
)
inline

Constructor with the name and value.

◆ RegistryItem() [5/6]

template<class TItemType >
Kratos::RegistryItem::RegistryItem ( const std::string &  rName,
const shared_ptr< TItemType > &  pValue 
)
inline

Constructor with the name and shared ptr.

◆ RegistryItem() [6/6]

Kratos::RegistryItem::RegistryItem ( RegistryItem const &  rOther)
delete

◆ ~RegistryItem()

Kratos::RegistryItem::~RegistryItem ( )
default

Destructor.

Member Function Documentation

◆ AddItem()

template<typename TItemType , class... TArgumentsList>
RegistryItem& Kratos::RegistryItem::AddItem ( std::string const &  ItemName,
TArgumentsList &&...  Arguments 
)
inline

◆ begin()

RegistryItem::SubRegistryItemType::iterator Kratos::RegistryItem::begin ( )

◆ cbegin()

RegistryItem::SubRegistryItemType::const_iterator Kratos::RegistryItem::cbegin ( ) const

◆ cend()

RegistryItem::SubRegistryItemType::const_iterator Kratos::RegistryItem::cend ( ) const

◆ end()

RegistryItem::SubRegistryItemType::iterator Kratos::RegistryItem::end ( )

◆ GetItem() [1/2]

RegistryItem & Kratos::RegistryItem::GetItem ( std::string const &  rItemName)

◆ GetItem() [2/2]

RegistryItem const & Kratos::RegistryItem::GetItem ( std::string const &  rItemName) const

◆ GetValue()

template<typename TDataType >
TDataType const& Kratos::RegistryItem::GetValue ( ) const
inline

◆ GetValueAs()

template<typename TDataType , typename TCastType >
TCastType const& Kratos::RegistryItem::GetValueAs ( ) const
inline

◆ HasItem()

bool Kratos::RegistryItem::HasItem ( std::string const &  rItemName) const

◆ HasItems()

bool Kratos::RegistryItem::HasItems ( ) const

◆ HasValue()

bool Kratos::RegistryItem::HasValue ( ) const

◆ Info()

std::string Kratos::RegistryItem::Info ( ) const

Turn back information as a string.

◆ KeyConstBegin()

RegistryItem::KeyReturnConstIterator Kratos::RegistryItem::KeyConstBegin ( ) const

◆ KeyConstEnd()

RegistryItem::KeyReturnConstIterator Kratos::RegistryItem::KeyConstEnd ( ) const

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::RegistryItem::KRATOS_CLASS_POINTER_DEFINITION ( RegistryItem  )

Pointer definition of RegistryItem.

◆ Name()

const std::string& Kratos::RegistryItem::Name ( ) const
inline

◆ operator=()

RegistryItem& Kratos::RegistryItem::operator= ( RegistryItem rOther)
delete

Assignment operator deleted.

◆ PrintData()

void Kratos::RegistryItem::PrintData ( std::ostream &  rOStream) const

Print object's data.

◆ PrintInfo()

void Kratos::RegistryItem::PrintInfo ( std::ostream &  rOStream) const

Print information about this object.

◆ RemoveItem()

void Kratos::RegistryItem::RemoveItem ( std::string const &  rItemName)

◆ size()

std::size_t Kratos::RegistryItem::size ( )

◆ ToJson()

std::string Kratos::RegistryItem::ToJson ( std::string const &  rTabSpacing = "",
const std::size_t  Level = 0 
) const

The documentation for this class was generated from the following files: