Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::modifiers::Clamp< Type > Class Template Referencefinal

Clamp value between min and max. More...

#include <Modifiers.hpp>

Public Member Functions

 Clamp (Type min, Type max)
 Construct the modifier storing min and max values.
 
MaybeError modify (boost::json::value &value, std::string_view key) const
 Clamp the value to stored min and max values.
 

Detailed Description

template<typename Type>
class rpc::modifiers::Clamp< Type >

Clamp value between min and max.

Constructor & Destructor Documentation

◆ Clamp()

template<typename Type >
rpc::modifiers::Clamp< Type >::Clamp ( Type min,
Type max )
inlineexplicit

Construct the modifier storing min and max values.

Parameters
min
max

Member Function Documentation

◆ modify()

template<typename Type >
MaybeError rpc::modifiers::Clamp< Type >::modify ( boost::json::value & value,
std::string_view key ) const
inlinenodiscard

Clamp the value to stored min and max values.

Parameters
valueThe JSON value representing the outer object
keyThe key used to retrieve the modified value from the outer object
Returns
Possibly an error

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