Handle for a Block object.
- Author
- Klaus Iglberger
The BlockHandle class is a simple wrapper for a pointer to a Block object that facilitates the handling of a Block pointer. The class is used transparently in the Blocks container type.
#include <Config.h>
|
| const Block * | block_ |
| | Pointer to a const parameter block.
|
| void | listParameters () const |
| | Output function for the contained parameters.
|
◆ BlockHandle() [1/2]
| walberla::config::Config::BlockHandle::BlockHandle |
( |
| ) |
|
|
inline |
Default constructor for a block handle.
Note: The BlockHandle object is uninitialized. Any access to the bound block will result in an error until the BlockHandle object is bound to a block.
◆ BlockHandle() [2/2]
| walberla::config::Config::BlockHandle::BlockHandle |
( |
const Block * | block | ) |
|
|
inline |
◆ begin()
Returns an iterator to the first parameter of the block.
- Returns
- Iterator to the first parameter of the block.
◆ cloneBlock()
| Config::Block walberla::config::Config::BlockHandle::cloneBlock |
( |
| ) |
const |
|
inline |
Creates a copy of the bound block.
- Returns
- The copy of the bound block.
◆ end()
Returns an iterator one past the last parameter of the block.
- Returns
- Iterator one past the last parameter of the block.
◆ getBlock()
| BlockHandle walberla::config::Config::BlockHandle::getBlock |
( |
const std::string & | key | ) |
const |
|
inline |
◆ getBlocks() [1/2]
| void walberla::config::Config::BlockHandle::getBlocks |
( |
Blocks & | blocks | ) |
const |
|
inline |
Adds to the given blocks all blocks inside the handles block.
- Parameters
-
| [out] | blocks | Reference to the vector of blocks |
- Returns
- void.
◆ getBlocks() [2/2]
| void walberla::config::Config::BlockHandle::getBlocks |
( |
const std::string & | key, |
|
|
Blocks & | blocks, |
|
|
size_t | min = 0, |
|
|
size_t | max = std::numeric_limits< size_t >::max() ) const |
|
inline |
Adds to the given blocks all extracted blocks with key key.
- Parameters
-
| key | The key of the extracted blocks. |
| [out] | blocks | Reference to the vector of blocks |
| min | minimum number of blocks the caller expects |
| max | maximum number of blocks the caller can handle |
- Returns
- void.
◆ getKey()
| const std::string & walberla::config::Config::BlockHandle::getKey |
( |
| ) |
const |
|
inline |
Returns the key of the block.
- Returns
- The block key.
◆ getNumBlocks() [1/2]
Returns the number of contained parameter blocks.
- Returns
- The number of contained parameter blocks.
◆ getNumBlocks() [2/2]
| Config::size_type walberla::config::Config::BlockHandle::getNumBlocks |
( |
const std::string & | key | ) |
const |
|
inline |
Returns the number of contained parameter blocks corresponding to given key.
- Parameters
-
| key | The key of the blocks to count. |
- Returns
- The number of contained parameter blocks corresponding to given key.
◆ getOneBlock()
| BlockHandle walberla::config::Config::BlockHandle::getOneBlock |
( |
const std::string & | key | ) |
const |
|
inline |
◆ getParameter() [1/4]
template<typename Type>
| Config::Parameter< Type > walberla::config::Config::BlockHandle::getParameter |
( |
const std::string & | key | ) |
const |
|
inline |
◆ getParameter() [2/4]
template<typename T>
| Parameter< T > walberla::config::Config::BlockHandle::getParameter |
( |
const std::string & | key | ) |
const |
|
inline |
Returns an extracted parameter.
- Parameters
-
| key | The key of the extracted parameter. |
- Returns
- The extracted parameter.
◆ getParameter() [3/4]
template<typename T>
| Config::Parameter< T > walberla::config::Config::BlockHandle::getParameter |
( |
const std::string & | key, |
|
|
const T & | def ) const |
|
inline |
◆ getParameter() [4/4]
template<typename T>
| Parameter< T > walberla::config::Config::BlockHandle::getParameter |
( |
const std::string & | key, |
|
|
const T & | def ) const |
|
inline |
Returns an extracted parameter.
- Parameters
-
| key | The key of the extracted parameter. |
| def | default value, used if key is not defined |
- Returns
- The extracted parameter if key is defined, default value otherwise
◆ isDefined()
| bool walberla::config::Config::BlockHandle::isDefined |
( |
std::string | key | ) |
const |
|
inline |
Checks if a parameter was defined in the parameter file.
- Parameters
-
| key | The parameter key to be checked. |
- Returns
- true if the parameter was defined, false if the parameter wasn't defined.
◆ isValid()
| bool walberla::config::Config::BlockHandle::isValid |
( |
| ) |
const |
|
inline |
◆ listParameters()
| void walberla::config::Config::BlockHandle::listParameters |
( |
| ) |
const |
|
inline |
Output function for the contained parameters.
- Returns
- void
◆ operator bool()
| walberla::config::Config::BlockHandle::operator bool |
( |
| ) |
const |
|
inline |
◆ block_
| const Block* walberla::config::Config::BlockHandle::block_ |
|
private |
Pointer to a const parameter block.
The documentation for this class was generated from the following file:
- /builds/administration/walberla-website/walberla/src/core/config/Config.h