BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
SniperJSON Class Reference

#include <SniperJSON.h>

Public Types

typedef std::vector< SniperJSON >::const_iterator vec_iterator
typedef std::map< std::string, SniperJSON >::const_iterator map_iterator
typedef std::vector< SniperJSON >::const_iterator vec_iterator
typedef std::map< std::string, SniperJSON >::const_iterator map_iterator
typedef std::vector< SniperJSON >::const_iterator vec_iterator
typedef std::map< std::string, SniperJSON >::const_iterator map_iterator

Public Member Functions

 SniperJSON ()
 SniperJSON (const std::string &jstr)
bool isScalar () const
bool isVector () const
bool isMap () const
template<typename T>
get () const
bool push_back (const SniperJSON &var)
bool insert (const std::string &key, const SniperJSON &val)
void reset ()
int size () const
vec_iterator vec_begin () const
vec_iterator vec_end () const
SniperJSONoperator[] (int index)
const SniperJSONoperator[] (int index) const
map_iterator map_begin () const
map_iterator map_end () const
map_iterator find (const std::string &key) const
SniperJSONoperator[] (const std::string &key)
const SniperJSONoperator[] (const std::string &key) const
 SniperJSON ()
 SniperJSON (const std::string &jstr)
bool isScalar () const
bool isVector () const
bool isMap () const
template<typename T>
get () const
bool push_back (const SniperJSON &var)
bool insert (const std::string &key, const SniperJSON &val)
void reset ()
int size () const
vec_iterator vec_begin () const
vec_iterator vec_end () const
SniperJSONoperator[] (int index)
const SniperJSONoperator[] (int index) const
map_iterator map_begin () const
map_iterator map_end () const
map_iterator find (const std::string &key) const
SniperJSONoperator[] (const std::string &key)
const SniperJSONoperator[] (const std::string &key) const
 SniperJSON ()
 SniperJSON (const std::string &jstr)
bool isScalar () const
bool isVector () const
bool isMap () const
template<typename T>
get () const
bool push_back (const SniperJSON &var)
bool insert (const std::string &key, const SniperJSON &val)
void reset ()
int size () const
vec_iterator vec_begin () const
vec_iterator vec_end () const
SniperJSONoperator[] (int index)
const SniperJSONoperator[] (int index) const
map_iterator map_begin () const
map_iterator map_end () const
map_iterator find (const std::string &key) const
SniperJSONoperator[] (const std::string &key)
const SniperJSONoperator[] (const std::string &key) const

Static Public Member Functions

static SniperJSON load (std::istream &is)
static SniperJSON loads (const std::string &jstr)
static SniperJSON load (std::istream &is)
static SniperJSON loads (const std::string &jstr)
static SniperJSON load (std::istream &is)
static SniperJSON loads (const std::string &jstr)

Detailed Description

Member Typedef Documentation

◆ map_iterator [1/3]

typedef std::map<std::string,SniperJSON>::const_iterator SniperJSON::map_iterator

◆ map_iterator [2/3]

typedef std::map<std::string,SniperJSON>::const_iterator SniperJSON::map_iterator

◆ map_iterator [3/3]

typedef std::map<std::string,SniperJSON>::const_iterator SniperJSON::map_iterator

◆ vec_iterator [1/3]

typedef std::vector<SniperJSON>::const_iterator SniperJSON::vec_iterator

◆ vec_iterator [2/3]

typedef std::vector<SniperJSON>::const_iterator SniperJSON::vec_iterator

◆ vec_iterator [3/3]

typedef std::vector<SniperJSON>::const_iterator SniperJSON::vec_iterator

Constructor & Destructor Documentation

◆ SniperJSON() [1/6]

SniperJSON::SniperJSON ( )

Definition at line 9 of file SniperJSON.cxx.

9: m_type( 0 ) {}

Referenced by get(), insert(), load(), loads(), operator[](), operator[](), operator[](), operator[](), and push_back().

◆ SniperJSON() [2/6]

SniperJSON::SniperJSON ( const std::string & jstr)

Definition at line 11 of file SniperJSON.cxx.

11 : m_type( 0 ) {
12 StrCursor cursor = 0;
13 init( jstr, cursor );
14
15 cursor = jstr.find_first_not_of( SniperJSON::SPACES, cursor );
16 if ( cursor != std::string::npos ) { throw Exception( jstr, cursor ); }
17}

◆ SniperJSON() [3/6]

SniperJSON::SniperJSON ( )

◆ SniperJSON() [4/6]

SniperJSON::SniperJSON ( const std::string & jstr)

◆ SniperJSON() [5/6]

SniperJSON::SniperJSON ( )

◆ SniperJSON() [6/6]

SniperJSON::SniperJSON ( const std::string & jstr)

Member Function Documentation

◆ find() [1/3]

map_iterator SniperJSON::find ( const std::string & key) const
inline

Definition at line 62 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

62{ return m_jmap.find( key ); }
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition Taupair.h:42

◆ find() [2/3]

map_iterator SniperJSON::find ( const std::string & key) const
inline

Definition at line 62 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

62{ return m_jmap.find( key ); }

◆ find() [3/3]

map_iterator SniperJSON::find ( const std::string & key) const
inline

Definition at line 62 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

62{ return m_jmap.find( key ); }

◆ get() [1/3]

template<typename T>
T SniperJSON::get ( ) const

Definition at line 135 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

135 {
136 T v;
137 toCppVar( v );
138 return v;
139}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35

Referenced by get(), loads(), and OfflineRevise::OfflineRevise().

◆ get() [2/3]

template<typename T>
T SniperJSON::get ( ) const

◆ get() [3/3]

template<typename T>
T SniperJSON::get ( ) const

◆ insert() [1/3]

bool SniperJSON::insert ( const std::string & key,
const SniperJSON & val )

Definition at line 33 of file SniperJSON.cxx.

33 {
34 if ( m_type == 1 || m_type == 0 )
35 {
36 std::string _key = '"' + key + '"';
37 m_jmap.insert( std::make_pair( _key, val ) );
38 m_type = 1;
39 return true;
40 }
41 return false;
42}

◆ insert() [2/3]

bool SniperJSON::insert ( const std::string & key,
const SniperJSON & val )

◆ insert() [3/3]

bool SniperJSON::insert ( const std::string & key,
const SniperJSON & val )

◆ isMap() [1/3]

bool SniperJSON::isMap ( ) const
inline

Definition at line 26 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

26{ return m_type == 1; }

◆ isMap() [2/3]

bool SniperJSON::isMap ( ) const
inline

Definition at line 26 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

26{ return m_type == 1; }

◆ isMap() [3/3]

bool SniperJSON::isMap ( ) const
inline

Definition at line 26 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

26{ return m_type == 1; }

◆ isScalar() [1/3]

bool SniperJSON::isScalar ( ) const
inline

Definition at line 20 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

20{ return m_type > 2; }

◆ isScalar() [2/3]

bool SniperJSON::isScalar ( ) const
inline

Definition at line 20 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

20{ return m_type > 2; }

◆ isScalar() [3/3]

bool SniperJSON::isScalar ( ) const
inline

Definition at line 20 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

20{ return m_type > 2; }

◆ isVector() [1/3]

bool SniperJSON::isVector ( ) const
inline

Definition at line 23 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

23{ return m_type == 2; }

◆ isVector() [2/3]

bool SniperJSON::isVector ( ) const
inline

Definition at line 23 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

23{ return m_type == 2; }

◆ isVector() [3/3]

bool SniperJSON::isVector ( ) const
inline

Definition at line 23 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

23{ return m_type == 2; }

◆ load() [1/3]

SniperJSON SniperJSON::load ( std::istream & is)
static

Definition at line 66 of file SniperJSON.cxx.

66 {
67 std::ostringstream oss;
68 oss << is.rdbuf();
69
70 return loads( oss.str() );
71}
static SniperJSON loads(const std::string &jstr)

Referenced by MixerAlg::initialize(), RawDataInputSvc::initialize(), and RawEventReader::initialize().

◆ load() [2/3]

SniperJSON SniperJSON::load ( std::istream & is)
static

◆ load() [3/3]

SniperJSON SniperJSON::load ( std::istream & is)
static

◆ loads() [1/3]

SniperJSON SniperJSON::loads ( const std::string & jstr)
static

Definition at line 73 of file SniperJSON.cxx.

73{ return SniperJSON( jstr ); }

Referenced by load().

◆ loads() [2/3]

SniperJSON SniperJSON::loads ( const std::string & jstr)
static

◆ loads() [3/3]

SniperJSON SniperJSON::loads ( const std::string & jstr)
static

◆ map_begin() [1/3]

map_iterator SniperJSON::map_begin ( ) const
inline

Definition at line 58 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

58{ return m_jmap.begin(); }

◆ map_begin() [2/3]

map_iterator SniperJSON::map_begin ( ) const
inline

Definition at line 58 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

58{ return m_jmap.begin(); }

◆ map_begin() [3/3]

map_iterator SniperJSON::map_begin ( ) const
inline

Definition at line 58 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

58{ return m_jmap.begin(); }

◆ map_end() [1/3]

map_iterator SniperJSON::map_end ( ) const
inline

Definition at line 60 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

60{ return m_jmap.end(); }

◆ map_end() [2/3]

map_iterator SniperJSON::map_end ( ) const
inline

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

60{ return m_jmap.end(); }

◆ map_end() [3/3]

map_iterator SniperJSON::map_end ( ) const
inline

Definition at line 60 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

60{ return m_jmap.end(); }

◆ operator[]() [1/12]

SniperJSON & SniperJSON::operator[] ( const std::string & key)

Definition at line 58 of file SniperJSON.cxx.

58 {
59 return m_jmap.at( '"' + key + '"' );
60}

◆ operator[]() [2/12]

SniperJSON & SniperJSON::operator[] ( const std::string & key)

◆ operator[]() [3/12]

SniperJSON & SniperJSON::operator[] ( const std::string & key)

◆ operator[]() [4/12]

const SniperJSON & SniperJSON::operator[] ( const std::string & key) const

Definition at line 62 of file SniperJSON.cxx.

62 {
63 return m_jmap.at( '"' + key + '"' );
64}

◆ operator[]() [5/12]

const SniperJSON & SniperJSON::operator[] ( const std::string & key) const

◆ operator[]() [6/12]

const SniperJSON & SniperJSON::operator[] ( const std::string & key) const

◆ operator[]() [7/12]

SniperJSON & SniperJSON::operator[] ( int index)
inline

Definition at line 53 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

53{ return m_jvec.at( index ); }

◆ operator[]() [8/12]

SniperJSON & SniperJSON::operator[] ( int index)
inline

Definition at line 53 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

53{ return m_jvec.at( index ); }

◆ operator[]() [9/12]

SniperJSON & SniperJSON::operator[] ( int index)
inline

Definition at line 53 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

53{ return m_jvec.at( index ); }

◆ operator[]() [10/12]

const SniperJSON & SniperJSON::operator[] ( int index) const
inline

Definition at line 55 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

55{ return m_jvec.at( index ); }

◆ operator[]() [11/12]

const SniperJSON & SniperJSON::operator[] ( int index) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

55{ return m_jvec.at( index ); }

◆ operator[]() [12/12]

const SniperJSON & SniperJSON::operator[] ( int index) const
inline

Definition at line 55 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

55{ return m_jvec.at( index ); }

◆ push_back() [1/3]

bool SniperJSON::push_back ( const SniperJSON & var)

Definition at line 23 of file SniperJSON.cxx.

23 {
24 if ( m_type == 2 || m_type == 0 )
25 {
26 m_jvec.push_back( var );
27 m_type = 2;
28 return true;
29 }
30 return false;
31}

◆ push_back() [2/3]

bool SniperJSON::push_back ( const SniperJSON & var)

◆ push_back() [3/3]

bool SniperJSON::push_back ( const SniperJSON & var)

◆ reset() [1/3]

void SniperJSON::reset ( )

Definition at line 44 of file SniperJSON.cxx.

44 {
45 m_type = 0;
46 m_jvar.clear();
47 m_jvec.clear();
48 m_jmap.clear();
49}

◆ reset() [2/3]

void SniperJSON::reset ( )

◆ reset() [3/3]

void SniperJSON::reset ( )

◆ size() [1/3]

int SniperJSON::size ( ) const

Definition at line 51 of file SniperJSON.cxx.

51 {
52 if ( m_type == 1 ) { return m_jmap.size(); }
53 else if ( m_type == 2 ) { return m_jvec.size(); }
54
55 return -1;
56}

◆ size() [2/3]

int SniperJSON::size ( ) const

◆ size() [3/3]

int SniperJSON::size ( ) const

◆ vec_begin() [1/3]

vec_iterator SniperJSON::vec_begin ( ) const
inline

Definition at line 48 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

48{ return m_jvec.begin(); }

Referenced by MdcConverter::init().

◆ vec_begin() [2/3]

vec_iterator SniperJSON::vec_begin ( ) const
inline

Definition at line 48 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

48{ return m_jvec.begin(); }

◆ vec_begin() [3/3]

vec_iterator SniperJSON::vec_begin ( ) const
inline

Definition at line 48 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

48{ return m_jvec.begin(); }

◆ vec_end() [1/3]

vec_iterator SniperJSON::vec_end ( ) const
inline

Definition at line 50 of file Event/RawDataCnv/include/RawDataCnv/SniperJSON.h.

50{ return m_jvec.end(); }

Referenced by MdcConverter::init(), and OfflineRevise::OfflineRevise().

◆ vec_end() [2/3]

vec_iterator SniperJSON::vec_end ( ) const
inline

Definition at line 50 of file InstallArea/x86_64-el9-gcc13-dbg/include/RawDataCnv/SniperJSON.h.

50{ return m_jvec.end(); }

◆ vec_end() [3/3]

vec_iterator SniperJSON::vec_end ( ) const
inline

Definition at line 50 of file InstallArea/x86_64-el9-gcc13-opt/include/RawDataCnv/SniperJSON.h.

50{ return m_jvec.end(); }

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