Grid 0.7.0
Grid::JSONReader Class Reference

#include <JSON_IO.h>

Inheritance diagram for Grid::JSONReader:
Grid::Reader< JSONReader >

Public Member Functions

 JSONReader (const std::string &fileName)
virtual ~JSONReader (void)=default
bool push (const std::string &s)
void pop (void)
bool nextElement (const std::string &s)
template<typename U>
void readDefault (const std::string &s, U &output)
template<typename U>
void readDefault (const std::string &s, std::complex< U > &output)
template<typename U>
void readDefault (const std::string &s, std::vector< U > &output)
template<typename U, typename P>
void readDefault (const std::string &s, std::pair< U, P > &output)
template<>
void readDefault (const std::string &s, std::string &output)
template<>
void readDefault (const std::string &s, std::string &output)
std::enable_if< std::is_base_of< Serializable, U >::value, void >::type read (const std::string &s, U &output)
std::enable_if< EigenIO::is_tensor_fixed< ETensor >::value, void >::type Reshape (ETensor &t, const std::array< typename ETensor::Index, ETensor::NumDimensions > &dims)
std::enable_if< EigenIO::is_scalar< S >::value, void >::type copyScalars (S &Dest, const S *&pSource)

Protected Member Functions

void fromString (U &output, const std::string &s)

Private Attributes

json jobject_
json jcur_
std::vector< jsonjold_
std::string fileName_
std::vector< bool > do_pop
json::iterator it_
json::iterator it_end_
JSONReaderupcast

Detailed Description

Definition at line 88 of file JSON_IO.h.

Constructor & Destructor Documentation

◆ JSONReader()

JSONReader::JSONReader ( const std::string & fileName)

Definition at line 89 of file JSON_IO.cc.

References fileName_, jcur_, and jobject_.

◆ ~JSONReader()

virtual Grid::JSONReader::~JSONReader ( void )
virtualdefault

References U.

Member Function Documentation

◆ push()

bool JSONReader::push ( const std::string & s)

Definition at line 101 of file JSON_IO.cc.

References do_pop, jcur_, and jold_.

Referenced by readDefault().

◆ pop()

void JSONReader::pop ( void )

Definition at line 126 of file JSON_IO.cc.

References do_pop, jcur_, and jold_.

Referenced by readDefault().

◆ nextElement()

bool JSONReader::nextElement ( const std::string & s)

Definition at line 139 of file JSON_IO.cc.

References it_, and jcur_.

◆ readDefault() [1/6]

template<typename U>
void Grid::JSONReader::readDefault ( const std::string & s,
U & output )

Definition at line 205 of file JSON_IO.h.

References jcur_, and U.

◆ readDefault() [2/6]

template<typename U>
void Grid::JSONReader::readDefault ( const std::string & s,
std::complex< U > & output )

Definition at line 247 of file JSON_IO.h.

References jcur_, Grid::Reader< JSONReader >::read(), and U.

◆ readDefault() [3/6]

template<typename U>
void Grid::JSONReader::readDefault ( const std::string & s,
std::vector< U > & output )

Definition at line 266 of file JSON_IO.h.

References jcur_, pop(), push(), and Grid::Reader< JSONReader >::read().

◆ readDefault() [4/6]

template<typename U, typename P>
void Grid::JSONReader::readDefault ( const std::string & s,
std::pair< U, P > & output )

Definition at line 224 of file JSON_IO.h.

References jcur_, Grid::Reader< JSONReader >::read(), and U.

◆ readDefault() [5/6]

template<>
void Grid::JSONReader::readDefault ( const std::string & s,
std::string & output )

Definition at line 158 of file JSON_IO.cc.

References jcur_.

◆ readDefault() [6/6]

template<>
void Grid::JSONReader::readDefault ( const std::string & s,
std::string & output )

◆ read()

std::enable_if<!std::is_base_of< Serializable, U >::value &&!EigenIO::is_tensor< U >::value, void >::type Reader::read ( const std::string & s,
U & output )
inherited

◆ Reshape()

std::enable_if< EigenIO::is_tensor_variable< ETensor >::value, void >::type Reader::Reshape ( ETensor & t,
const std::array< typename ETensor::Index, ETensor::NumDimensions > & dims )
inherited

Definition at line 202 of file BaseIO.h.

◆ copyScalars()

std::enable_if< EigenIO::is_scalar< S >::value, void >::type Grid::Reader< JSONReader >::copyScalars ( S & Dest,
const S *& pSource )
inlineinherited

Definition at line 210 of file BaseIO.h.

◆ fromString()

void Reader::fromString ( U & output,
const std::string & s )
protectedinherited

Definition at line 225 of file BaseIO.h.

Field Documentation

◆ jobject_

json Grid::JSONReader::jobject_
private

Definition at line 120 of file JSON_IO.h.

Referenced by JSONReader().

◆ jcur_

json Grid::JSONReader::jcur_
private

◆ jold_

std::vector<json> Grid::JSONReader::jold_
private

Definition at line 122 of file JSON_IO.h.

Referenced by pop(), and push().

◆ fileName_

std::string Grid::JSONReader::fileName_
private

Definition at line 123 of file JSON_IO.h.

Referenced by JSONReader().

◆ do_pop

std::vector<bool> Grid::JSONReader::do_pop
private

Definition at line 124 of file JSON_IO.h.

Referenced by pop(), and push().

◆ it_

json::iterator Grid::JSONReader::it_
private

Definition at line 125 of file JSON_IO.h.

Referenced by nextElement().

◆ it_end_

json::iterator Grid::JSONReader::it_end_
private

Definition at line 126 of file JSON_IO.h.

◆ upcast

JSONReader* Grid::Reader< JSONReader >::upcast
privateinherited

Definition at line 227 of file BaseIO.h.


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