cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler > Class Reference

Special case of ArrayJsonHandler for handling arrays of double values. This will read every scalar value as a double, regardless of whether it's floating point or not. Attempting to read other values will cause a warning. More...

#include <CesiumJsonReader/ArrayJsonHandler.h>

Inheritance diagram for CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >:
CesiumJsonReader::JsonHandler CesiumJsonReader::IJsonHandler

Public Types

using ValueType = std::vector<double>
 The destination type.
 

Public Member Functions

void reset (IJsonHandler *pParent, std::vector< double > *pArray)
 Resets the parent and destination array of this ArrayJsonHandler.
 
virtual IJsonHandlerreadNull () override
 Called when the JSON parser encounters a null.
 
virtual IJsonHandlerreadBool (bool b) override
 Called when the JSON parser encounters a boolean value.
 
virtual IJsonHandlerreadInt32 (int32_t i) override
 Called when the JSON parser encounters an int32 value.
 
virtual IJsonHandlerreadUint32 (uint32_t i) override
 Called when the JSON parser encounters a uint32 value.
 
virtual IJsonHandlerreadInt64 (int64_t i) override
 Called when the JSON parser encounters an int64 value.
 
virtual IJsonHandlerreadUint64 (uint64_t i) override
 Called when the JSON parser encounters a uint64 value.
 
virtual IJsonHandlerreadDouble (double d) override
 Called when the JSON parser encounters a double value.
 
virtual IJsonHandlerreadString (const std::string_view &str) override
 Called when the JSON parser encounters a string value.
 
virtual IJsonHandlerreadObjectStart () override
 Called when the JSON parser encounters the beginning of an object.
 
virtual IJsonHandlerreadArrayStart () override
 Called when the JSON parser encounters the start of an array.
 
virtual IJsonHandlerreadArrayEnd () override
 Called when the JSON parser encounters the end of an array.
 
virtual void reportWarning (const std::string &warning, std::vector< std::string > &&context=std::vector< std::string >()) override
 Report a warning while reading JSON.
 
- Public Member Functions inherited from CesiumJsonReader::JsonHandler
virtual IJsonHandlerreadObjectKey (const std::string_view &str) override
 Called when the JSON parser encounters a key while reading an object.
 
virtual IJsonHandlerreadObjectEnd () override
 Called when the JSON parser encounters the end of an object.
 
- Public Member Functions inherited from CesiumJsonReader::IJsonHandler

Additional Inherited Members

- Protected Member Functions inherited from CesiumJsonReader::JsonHandler
void reset (IJsonHandler *pParent)
 Resets the parent IJsonHandler of this handler.
 
IJsonHandlerparent ()
 Obtains the parent IJsonHandler of this handler.
 
IJsonHandlerignoreAndReturnToParent ()
 Ignore a single value and then return to the parent handler.
 
IJsonHandlerignoreAndContinue ()
 Ignore a single value and the continue processing more tokens with this handler.
 

Detailed Description

Special case of ArrayJsonHandler for handling arrays of double values. This will read every scalar value as a double, regardless of whether it's floating point or not. Attempting to read other values will cause a warning.

Definition at line 154 of file ArrayJsonHandler.h.

Member Typedef Documentation

◆ ValueType

using CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::ValueType = std::vector<double>

The destination type.

Definition at line 158 of file ArrayJsonHandler.h.

Constructor & Destructor Documentation

◆ ArrayJsonHandler()

CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::ArrayJsonHandler ( )
inlinenoexcept

Definition at line 160 of file ArrayJsonHandler.h.

Member Function Documentation

◆ readArrayEnd()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readArrayEnd ( )
inlineoverridevirtual

Called when the JSON parser encounters the end of an array.

Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 248 of file ArrayJsonHandler.h.

◆ readArrayStart()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readArrayStart ( )
inlineoverridevirtual

Called when the JSON parser encounters the start of an array.

Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 238 of file ArrayJsonHandler.h.

◆ readBool()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readBool ( bool b)
inlineoverridevirtual

Called when the JSON parser encounters a boolean value.

Parameters
bThe boolean value.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 176 of file ArrayJsonHandler.h.

◆ readDouble()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readDouble ( double d)
inlineoverridevirtual

Called when the JSON parser encounters a double value.

Parameters
dThe double value.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 220 of file ArrayJsonHandler.h.

◆ readInt32()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readInt32 ( int32_t i)
inlineoverridevirtual

Called when the JSON parser encounters an int32 value.

Parameters
iThe int32 value.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 180 of file ArrayJsonHandler.h.

◆ readInt64()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readInt64 ( int64_t i)
inlineoverridevirtual

Called when the JSON parser encounters an int64 value.

Parameters
iThe int64 value.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 200 of file ArrayJsonHandler.h.

◆ readNull()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readNull ( )
inlineoverridevirtual

Called when the JSON parser encounters a null.

Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 172 of file ArrayJsonHandler.h.

◆ readObjectStart()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readObjectStart ( )
inlineoverridevirtual

Called when the JSON parser encounters the beginning of an object.

Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 234 of file ArrayJsonHandler.h.

◆ readString()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readString ( const std::string_view & str)
inlineoverridevirtual

Called when the JSON parser encounters a string value.

Parameters
strThe string value.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 230 of file ArrayJsonHandler.h.

◆ readUint32()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readUint32 ( uint32_t i)
inlineoverridevirtual

Called when the JSON parser encounters a uint32 value.

Parameters
iThe uint32 value.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 190 of file ArrayJsonHandler.h.

◆ readUint64()

virtual IJsonHandler * CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::readUint64 ( uint64_t i)
inlineoverridevirtual

Called when the JSON parser encounters a uint64 value.

Parameters
iThe uint64 value.
Returns
A IJsonHandler that will handle the next read... call. This can be the same handler as the current one.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 210 of file ArrayJsonHandler.h.

◆ reportWarning()

virtual void CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::reportWarning ( const std::string & warning,
std::vector< std::string > && context = std::vector< std::string >() )
inlineoverridevirtual

Report a warning while reading JSON.

Parameters
warningThe warning to report.
contextContext information to include with this warning to help debugging.

Reimplemented from CesiumJsonReader::JsonHandler.

Definition at line 250 of file ArrayJsonHandler.h.

◆ reset()

void CesiumJsonReader::ArrayJsonHandler< double, DoubleJsonHandler >::reset ( IJsonHandler * pParent,
std::vector< double > * pArray )
inline

Resets the parent and destination array of this ArrayJsonHandler.

Definition at line 166 of file ArrayJsonHandler.h.


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