Maze Builder Docs 6.7.5
Loading...
Searching...
No Matches
mazes::configurator Class Reference

Configuration class for arguments. More...

#include <configurator.h>

Public Member Functions

 configurator () noexcept
 Default constructor - initializes all values to safe defaults.
 
 configurator (const configurator &other) noexcept=default
 Copy constructor.
 
 configurator (configurator &&other) noexcept=default
 Move constructor

 
configuratoroperator= (const configurator &other) noexcept=default
 Copy assignment operator.
 
configuratoroperator= (configurator &&other) noexcept=default
 Move assignment operator.
 
 ~configurator () noexcept=default
 Destructor.
 
configuratorrows (unsigned int rows) noexcept
 Set the number of rows.
 
configuratorcolumns (unsigned int columns) noexcept
 Set the number of columns.
 
configuratorlevels (unsigned int levels) noexcept
 Set the number of levels.
 
configuratoralgo_id (algo algorithm) noexcept
 Set the maze generation algorithm.
 
configuratorblock_id (int block_id) noexcept
 Set the block ID.
 
configuratorseed (unsigned int seed) noexcept
 Set the random seed.
 
configuratordistances (bool distances) noexcept
 Set the distance calculation flag.
 
configuratoroutput_id (output output) noexcept
 Set the output ID.
 
configuratorhelp (std::string help) noexcept
 Set the help message.
 
configuratorversion (std::string version) noexcept
 Set the version string.
 
unsigned int rows () const noexcept
 Get the number of rows.
 
unsigned int columns () const noexcept
 Get the number of columns

 
unsigned int levels () const noexcept
 Get the number of levels.
 
algo algo_id () const noexcept
 Get the maze generation algorithm.
 
int block_id () const noexcept
 Get the block ID.
 
unsigned int seed () const noexcept
 Get the random seed.
 
bool distances () const noexcept
 Check if distances are calculated.
 
output output_id () const noexcept
 Get the output ID.
 
const std::string & help () const noexcept
 Get the help message.
 
const std::string & version () const noexcept
 Get the version string.
 
bool is_valid () const noexcept
 Validate all configuration values are within safe limits.
 
void reset_to_defaults () noexcept
 Reset all values to safe defaults.
 

Detailed Description

Configuration class for arguments.

This class stores maze generation parameters with safe default values

Warning
Always use the constructor or setter methods to ensure proper initialization

Constructor & Destructor Documentation

◆ configurator() [1/3]

mazes::configurator::configurator ( )
inlinenoexcept

Default constructor - initializes all values to safe defaults.

Provides reasonable default values to prevent uninitialized memory access

Note
Default values: rows=10, columns=10, levels=1, algo=BINARY_TREE, etc.

◆ configurator() [2/3]

mazes::configurator::configurator ( const configurator & other)
defaultnoexcept

Copy constructor.

Parameters
otherThe configurator object to copy from

◆ configurator() [3/3]

mazes::configurator::configurator ( configurator && other)
defaultnoexcept

Move constructor

Parameters
otherThe configurator object to move from

Member Function Documentation

◆ algo_id() [1/2]

algo mazes::configurator::algo_id ( ) const
inlinenoexcept

Get the maze generation algorithm.

Returns
The algorithm used for maze generation

◆ algo_id() [2/2]

configurator & mazes::configurator::algo_id ( algo algorithm)
inlinenoexcept

Set the maze generation algorithm.

Parameters
algorithmThe algorithm to use
Returns
A reference to this configurator

◆ block_id() [1/2]

int mazes::configurator::block_id ( ) const
inlinenoexcept

Get the block ID.

Returns
The block ID

◆ block_id() [2/2]

configurator & mazes::configurator::block_id ( int block_id)
inlinenoexcept

Set the block ID.

Parameters
block_idThe block ID
Returns
A reference to this configurator

◆ columns() [1/2]

unsigned int mazes::configurator::columns ( ) const
inlinenoexcept

Get the number of columns

Returns
The number of columns (guaranteed to be > 0)

◆ columns() [2/2]

configurator & mazes::configurator::columns ( unsigned int columns)
inlinenoexcept

Set the number of columns.

Parameters
columnsThe number of columns (must be > 0, will be clamped to reasonable limits)
Returns
A reference to this configurator
Warning
Values > 10000 will be clamped to prevent memory issues

◆ distances() [1/2]

bool mazes::configurator::distances ( ) const
inlinenoexcept

Check if distances are calculated.

Returns
True if distances are calculated, false otherwise

◆ distances() [2/2]

configurator & mazes::configurator::distances ( bool distances)
inlinenoexcept

Set the distance calculation flag.

Parameters
distancesThe distance calculation flag
Returns
A reference to this configurator

◆ help() [1/2]

const std::string & mazes::configurator::help ( ) const
inlinenoexcept

Get the help message.

Returns
The help message

◆ help() [2/2]

configurator & mazes::configurator::help ( std::string help)
inlinenoexcept

Set the help message.

Parameters
helpThe help message
Returns
A reference to this configurator

◆ is_valid()

bool mazes::configurator::is_valid ( ) const
inlinenoexcept

Validate all configuration values are within safe limits.

Returns
True if all values are valid, false if any are problematic

Checks for potential infinite loop conditions and memory issues

◆ levels() [1/2]

unsigned int mazes::configurator::levels ( ) const
inlinenoexcept

Get the number of levels.

Returns
The number of levels (guaranteed to be > 0)

◆ levels() [2/2]

configurator & mazes::configurator::levels ( unsigned int levels)
inlinenoexcept

Set the number of levels.

Parameters
levelsThe number of levels (must be > 0, will be clamped to reasonable limits)
Returns
A reference to this configurator
Warning
Values > 1000 will be clamped to prevent memory issues
Note
Most mazes are 2D (levels=1), 3D mazes should use moderate level counts

◆ operator=() [1/2]

configurator & mazes::configurator::operator= ( configurator && other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe configurator object to move from
Returns
Reference to this configurator

◆ operator=() [2/2]

configurator & mazes::configurator::operator= ( const configurator & other)
defaultnoexcept

Copy assignment operator.

Parameters
otherThe configurator object to copy from
Returns
Reference to this configurator

◆ output_id() [1/2]

output mazes::configurator::output_id ( ) const
inlinenoexcept

Get the output ID.

Returns
The output ID

◆ output_id() [2/2]

configurator & mazes::configurator::output_id ( output output)
inlinenoexcept

Set the output ID.

Parameters
outputThe output ID
Returns
A reference to this configurator

◆ reset_to_defaults()

void mazes::configurator::reset_to_defaults ( )
inlinenoexcept

Reset all values to safe defaults.

Useful for clearing potentially corrupted configuration

◆ rows() [1/2]

unsigned int mazes::configurator::rows ( ) const
inlinenoexcept

Get the number of rows.

Returns
The number of rows (guaranteed to be > 0)

◆ rows() [2/2]

configurator & mazes::configurator::rows ( unsigned int rows)
inlinenoexcept

Set the number of rows.

Parameters
rowsThe number of rows (must be > 0, will be clamped to reasonable limits)
Returns
A reference to this configurator
Warning
Values > 10000 will be clamped to prevent memory issues

◆ seed() [1/2]

unsigned int mazes::configurator::seed ( ) const
inlinenoexcept

Get the random seed.

Returns
The random seed

◆ seed() [2/2]

configurator & mazes::configurator::seed ( unsigned int seed)
inlinenoexcept

Set the random seed.

Parameters
seedThe random seed (0 = use random seed)
Returns
A reference to this configurator

◆ version() [1/2]

const std::string & mazes::configurator::version ( ) const
inlinenoexcept

Get the version string.

Returns
The version string

◆ version() [2/2]

configurator & mazes::configurator::version ( std::string version)
inlinenoexcept

Set the version string.

Parameters
versionThe version string
Returns
A reference to this configurator

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