Geant4-11
Data Structures | Functions
G4Serialize.cc File Reference
#include "G4Serialize.hh"

Go to the source code of this file.

Data Structures

class  UReadBinaryString
 

Functions

template<>
void READ< G4String > (std::istream &in, G4String &name)
 
template<>
void WRITE< G4String > (std::ostream &out, const G4String &name)
 

Function Documentation

◆ READ< G4String >()

template<>
void READ< G4String > ( std::istream &  in,
G4String name 
)

Definition at line 67 of file G4Serialize.cc.

68{
69 size_t size;
70 in.read((char*)(&size), sizeof(size_t));
71 name = UReadBinaryString::read(in, size);
72}
static G4String read(std::istream &is, size_t size)
Definition: G4Serialize.cc:49
const char * name(G4int ptype)

References G4InuclParticleNames::name(), and UReadBinaryString::read().

◆ WRITE< G4String >()

template<>
void WRITE< G4String > ( std::ostream &  out,
const G4String name 
)

Definition at line 37 of file G4Serialize.cc.

38{
39 size_t size = name.size();
40 out.write((char*)(&size), sizeof(size_t));
41 out.write(name.c_str(), size);
42}

References G4InuclParticleNames::name().