Jamba C++ API  4.3.0
BooleanParamSerializer Class Reference

This parameter handles serializing a bool parameter. More...

#include <ParamSerializers.h>

Inherits IParamSerializer< bool >, and IDiscreteConverter< bool >.

Public Member Functions

 BooleanParamSerializer (std::string iFalseString="Off", std::string iTrueString="On")
 
tresult readFromStream (IBStreamer &iStreamer, ParamType &oValue) const override
 
tresult writeToStream (const ParamType &iValue, IBStreamer &oStreamer) const override
 
void writeToStream (ParamType const &iValue, std::ostream &oStream) const override
 By default, this implementation simply writes the value to the stream IF it is possible (determined at compilation time). More...
 
- Public Member Functions inherited from IParamSerializer< bool >
virtual std::string toString (ParamType const &iValue, int32 iPrecision) const
 

Protected Attributes

std::string fFalseString
 
std::string fTrueString
 

Private Member Functions

tresult convertFromDiscreteValue (int32 iDiscreteValue, bool &oValue) const override
 
tresult convertToDiscreteValue (const bool &iValue, int32 &oDiscreteValue) const override
 
int32 getStepCount () const override
 

Additional Inherited Members

- Public Types inherited from IParamSerializer< bool >
using ParamType = bool
 

Detailed Description

This parameter handles serializing a bool parameter.

Constructor & Destructor Documentation

◆ BooleanParamSerializer()

BooleanParamSerializer ( std::string  iFalseString = "Off",
std::string  iTrueString = "On" 
)
inlineexplicit

Member Function Documentation

◆ convertFromDiscreteValue()

tresult convertFromDiscreteValue ( int32  iDiscreteValue,
bool &  oValue 
) const
inlineoverrideprivatevirtual

◆ convertToDiscreteValue()

tresult convertToDiscreteValue ( const bool &  iValue,
int32 &  oDiscreteValue 
) const
inlineoverrideprivatevirtual

◆ getStepCount()

int32 getStepCount ( ) const
inlineoverrideprivatevirtual

◆ readFromStream()

tresult readFromStream ( IBStreamer &  iStreamer,
ParamType oValue 
) const
inlineoverridevirtual

◆ writeToStream() [1/2]

tresult writeToStream ( const ParamType iValue,
IBStreamer &  oStreamer 
) const
inlineoverridevirtual

◆ writeToStream() [2/2]

void writeToStream ( ParamType const &  iValue,
std::ostream &  oStream 
) const
inlineoverridevirtual

By default, this implementation simply writes the value to the stream IF it is possible (determined at compilation time).

Doesn't do anything if not. Subclasses can redefine this behavior.

Reimplemented from IParamSerializer< bool >.

Member Data Documentation

◆ fFalseString

std::string fFalseString
protected

◆ fTrueString

std::string fTrueString
protected

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