Utopia  2
Framework for studying models of complex & adaptive systems.
Public Types | Public Member Functions | Public Attributes | List of all members
Utopia::TestTools::BaseInfrastructure< RNGType > Struct Template Reference

A base class for an infrastructure fixture. More...

#include <fixtures.hh>

Inheritance diagram for Utopia::TestTools::BaseInfrastructure< RNGType >:
Inheritance graph
[legend]

Public Types

using RNG = RNGType
 The random number generator type to use. More...
 
using Config = DataIO::Config
 Make the config type more easily available. More...
 

Public Member Functions

 BaseInfrastructure (const std::string &config_file_path="")
 Construct the BaseInfrastructure fixture. More...
 
 ~BaseInfrastructure ()
 Destruct the BaseInfrastructure fixture, tearing down the test logger. More...
 

Public Attributes

const Config cfg
 The test configuration. More...
 
std::shared_ptr< spdlog::logger > log
 A logger to use during the test or to pass to entities that need it. More...
 
std::shared_ptr< RNGrng
 The shared random number generator instance, randomly seeded. More...
 

Detailed Description

template<class RNGType = Utopia::DefaultRNG>
struct Utopia::TestTools::BaseInfrastructure< RNGType >

A base class for an infrastructure fixture.

If a YAML configuration file is to be loaded, the fixture needs to be derived from and the path to the YAML file needs to be specified

Member Typedef Documentation

◆ Config

template<class RNGType = Utopia::DefaultRNG>
using Utopia::TestTools::BaseInfrastructure< RNGType >::Config = DataIO::Config

Make the config type more easily available.

◆ RNG

template<class RNGType = Utopia::DefaultRNG>
using Utopia::TestTools::BaseInfrastructure< RNGType >::RNG = RNGType

The random number generator type to use.

Constructor & Destructor Documentation

◆ BaseInfrastructure()

template<class RNGType = Utopia::DefaultRNG>
Utopia::TestTools::BaseInfrastructure< RNGType >::BaseInfrastructure ( const std::string &  config_file_path = "")
inline

Construct the BaseInfrastructure fixture.

◆ ~BaseInfrastructure()

template<class RNGType = Utopia::DefaultRNG>
Utopia::TestTools::BaseInfrastructure< RNGType >::~BaseInfrastructure ( )
inline

Destruct the BaseInfrastructure fixture, tearing down the test logger.

Member Data Documentation

◆ cfg

template<class RNGType = Utopia::DefaultRNG>
const Config Utopia::TestTools::BaseInfrastructure< RNGType >::cfg

The test configuration.

Note
It will only be loaded if a configuration file path is given during construction of this base class. To specify a file, derive from this fixture and pass the path to the base class constructor.

◆ log

template<class RNGType = Utopia::DefaultRNG>
std::shared_ptr<spdlog::logger> Utopia::TestTools::BaseInfrastructure< RNGType >::log

A logger to use during the test or to pass to entities that need it.

◆ rng

template<class RNGType = Utopia::DefaultRNG>
std::shared_ptr<RNG> Utopia::TestTools::BaseInfrastructure< RNGType >::rng

The shared random number generator instance, randomly seeded.


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