A specialization of ParameterSet for lazy loading of lua tables. More...

#include <LazyTable.h>

Detailed Description

A specialization of ParameterSet for lazy loading of lua tables.

This class is used to represent global tables that can be modified after the parsing of the configuration file (like the global parameters table). This means that each field of the table must have a delayed evaluation (see lua::LazyTableField).

Actual evaluation of the fields of the table happens during the freezing of this ParameterSet.

Definition at line 62 of file LazyTable.h.

Inheritance diagram for lua::LazyTable:

Public Member Functions

 LazyTable (std::shared_ptr< lua_State > L, const std::string &name)
 
virtual LazyTableclone () const override
 Clone this ParameterSet. More...
 
- Public Member Functions inherited from ParameterSet
template<typename T >
const T & get (const std::string &name) const
 
template<typename T >
T & get (const std::string &name)
 
template<typename T >
const T & get (const std::string &name, const T &defaultValue) const
 
const momemta::anyrawGet (const std::string &name) const
 
bool exists (const std::string &name) const
 
template<typename T >
bool existsAs (const std::string &name) const
 
template<typename T >
std::enable_if< std::is_same< T, bool >::value||std::is_same< T, InputTag >::value >::type set (const std::string &name, const T &value)
 Change the value of a given parameter. If the parameter does not exist, it's first created. More...
 
template<typename T >
void set (const std::string &name, const std::vector< T > &value)
 Change the value of a given parameter. If the parameter does not exist, it's first created. More...
 
template<typename T >
std::enable_if< is_string< T >::value >::type set (const std::string &name, const T &value)
 Change the value of a given parameter. If the parameter does not exist, it's first created. More...
 
template<typename T >
std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value >::type set (const std::string &name, const T &value)
 Change the value of a given parameter. If the parameter does not exist, it's first created. More...
 
template<typename T >
std::enable_if< std::is_floating_point< T >::value >::type set (const std::string &name, const T &value)
 Change the value of a given parameter. If the parameter does not exist, it's first created. More...
 
std::string getModuleName () const
 
std::string getModuleType () const
 
const ParameterSetglobalParameters () const
 
std::vector< std::string > getNames () const
 

Protected Member Functions

virtual void create (const std::string &name, const momemta::any &value) override
 Add a new element to the ParameterSet. More...
 
virtual void setInternal (const std::string &name, Element &element, const momemta::any &value) override
 
virtual bool lazy () const override
 A flag indicating if this ParameterSet lazy loads its fields or not. More...
 
virtual void freeze () override
 
- Protected Member Functions inherited from ParameterSet
 ParameterSet (const std::string &module_type, const std::string &module_name)
 

Friends

class ConfigurationReader
 

Additional Inherited Members

- Protected Attributes inherited from ParameterSet
std::map< std::string, Elementm_set
 

Member Function Documentation

◆ clone()

LazyTable * lua::LazyTable::clone ( ) const
overridevirtual

Clone this ParameterSet.

You must take ownership of the returned pointer.

Returns
A clone of this ParameterSet. You must take ownership of the returned value.

Reimplemented from ParameterSet.

Definition at line 131 of file LazyTable.cc.

◆ create()

void lua::LazyTable::create ( const std::string &  name,
const momemta::any value 
)
overrideprotectedvirtual

Add a new element to the ParameterSet.

Parameters
nameName of the new parameter
valueValue of the new parameter

Reimplemented from ParameterSet.

Definition at line 101 of file LazyTable.cc.

◆ lazy()

bool lua::LazyTable::lazy ( ) const
overrideprotectedvirtual

A flag indicating if this ParameterSet lazy loads its fields or not.

Returns
True if doing lazy loading, false otherwise

Reimplemented from ParameterSet.

Definition at line 97 of file LazyTable.cc.


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