https://mooseframework.inl.gov
Public Types | Public Member Functions | Private Attributes | List of all members
WebServerControl::ControlledValue< T > Class Template Reference

Class containing a value to be controlled. More...

#include <WebServerControl.h>

Inheritance diagram for WebServerControl::ControlledValue< T >:
[legend]

Public Types

using value_type = T
 The underlying type of the value. More...
 

Public Member Functions

 ControlledValue (const std::string &name, const std::string &type)
 
 ControlledValue (const std::string &name, const std::string &type, const T &value)
 
virtual void setControllableValue (WebServerControl &control) override final
 Sets the controllable value given the name and type via the controllable interface in control. More...
 
const std::string & name () const
 
const std::string & type () const
 

Private Attributes

_value
 The underlying value. More...
 

Detailed Description

template<class T>
class WebServerControl::ControlledValue< T >

Class containing a value to be controlled.

Is responsible for building the value from JSON input, broadcasting the value over all ranks, and setting the value on all ranks.

These objects are registered in Moose::WebServerControlTypeRegistration.

Definition at line 57 of file WebServerControl.h.

Member Typedef Documentation

◆ value_type

template<class T>
using WebServerControl::ControlledValue< T >::value_type = T

The underlying type of the value.

Definition at line 70 of file WebServerControl.h.

Constructor & Destructor Documentation

◆ ControlledValue() [1/2]

template<class T>
WebServerControl::ControlledValue< T >::ControlledValue ( const std::string &  name,
const std::string &  type 
)
inline

Definition at line 60 of file WebServerControl.h.

◆ ControlledValue() [2/2]

template<class T>
WebServerControl::ControlledValue< T >::ControlledValue ( const std::string &  name,
const std::string &  type,
const T &  value 
)
inline

Definition at line 64 of file WebServerControl.h.

Member Function Documentation

◆ name()

const std::string& Moose::WebServerControlTypeRegistry::ControlledValueBase::name ( ) const
inlineinherited
Returns
The name that the value is for

Definition at line 59 of file WebServerControlTypeRegistry.h.

Referenced by WebServerControl::ControlledValue< T >::setControllableValue().

59 { return _name; }
const std::string _name
The name that the value is for.

◆ setControllableValue()

template<class T>
virtual void WebServerControl::ControlledValue< T >::setControllableValue ( WebServerControl control)
inlinefinaloverridevirtual

Sets the controllable value given the name and type via the controllable interface in control.

Will broadcast the value and set it in the derived, type-aware class.

Implements Moose::WebServerControlTypeRegistry::ControlledValueBase.

Definition at line 72 of file WebServerControl.h.

73  {
74  control.comm().broadcast(_value);
75  control.setControllableValueByName<T>(name(), _value);
76  }
const Parallel::Communicator & comm() const
T _value
The underlying value.
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
void setControllableValueByName(const std::string &name, const T &value)
Definition: Control.h:251

◆ type()

const std::string& Moose::WebServerControlTypeRegistry::ControlledValueBase::type ( ) const
inlineinherited
Returns
The string representation of the type

Definition at line 63 of file WebServerControlTypeRegistry.h.

63 { return _type; }
const std::string _type
The string representation of the type.

Member Data Documentation

◆ _value

template<class T>
T WebServerControl::ControlledValue< T >::_value
private

The underlying value.

Definition at line 80 of file WebServerControl.h.

Referenced by WebServerControl::ControlledValue< T >::setControllableValue().


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