Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
cheprep::DeflateOutputStreamBuffer Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/geant4/v4_10_4_p02ba/source/geant4.10.04.p02/source/visualization/HepRep/include/cheprep/DeflateOutputStreamBuffer.h"

Inheritance diagram for cheprep::DeflateOutputStreamBuffer:
cheprep::GZIPOutputStreamBuffer cheprep::ZipOutputStreamBuffer

Public Member Functions

 DeflateOutputStreamBuffer (std::streambuf *buffer)
 
void init (bool compress)
 
void finish ()
 
virtual ~DeflateOutputStreamBuffer ()
 

Protected Member Functions

int overflow (int c=EOF)
 
bool flushOut ()
 
void putUI (unsigned int ui)
 
void putUS (unsigned short us)
 
void putUB (unsigned char ub)
 
void putS (const std::string s)
 
std::streampos pos ()
 
unsigned int getSize ()
 
unsigned int getCRC ()
 

Private Attributes

std::streambuf * buffer
 
unsigned int crc
 
unsigned int size
 
z_stream zStream
 
bool zStreamOpen
 
std::vector< char > in
 
std::vector< char > out
 

Static Private Attributes

static unsigned long crctable [256]
 
static const unsigned int inSize = 1000
 
static const unsigned int outSize = 1000
 

Detailed Description

Definition at line 20 of file DeflateOutputStreamBuffer.h.

Constructor & Destructor Documentation

cheprep::DeflateOutputStreamBuffer::DeflateOutputStreamBuffer ( std::streambuf *  buffer)
virtual cheprep::DeflateOutputStreamBuffer::~DeflateOutputStreamBuffer ( )
virtual

Member Function Documentation

void cheprep::DeflateOutputStreamBuffer::finish ( )
bool cheprep::DeflateOutputStreamBuffer::flushOut ( )
protected
unsigned int cheprep::DeflateOutputStreamBuffer::getCRC ( )
inlineprotected

Definition at line 72 of file DeflateOutputStreamBuffer.h.

References crc.

72  {
73  return crc;
74  }
unsigned int cheprep::DeflateOutputStreamBuffer::getSize ( )
inlineprotected

Definition at line 68 of file DeflateOutputStreamBuffer.h.

References size.

68  {
69  return size;
70  }
void cheprep::DeflateOutputStreamBuffer::init ( bool  compress)
int cheprep::DeflateOutputStreamBuffer::overflow ( int  c = EOF)
protected
std::streampos cheprep::DeflateOutputStreamBuffer::pos ( )
inlineprotected

Definition at line 63 of file DeflateOutputStreamBuffer.h.

63  {
64  std::ostream os(buffer);
65  return os.tellp();
66  }
void cheprep::DeflateOutputStreamBuffer::putS ( const std::string  s)
inlineprotected

Definition at line 59 of file DeflateOutputStreamBuffer.h.

59  {
60  buffer->sputn(s.c_str(), s.length());
61  }
const XML_Char * s
Definition: expat.h:262
void cheprep::DeflateOutputStreamBuffer::putUB ( unsigned char  ub)
inlineprotected

Definition at line 55 of file DeflateOutputStreamBuffer.h.

55  {
56  buffer->sputc(ub);
57  }
static const double ub
Definition: Units.h:88
void cheprep::DeflateOutputStreamBuffer::putUI ( unsigned int  ui)
inlineprotected

Definition at line 39 of file DeflateOutputStreamBuffer.h.

References MECModelEnuComparisons::i.

39  {
40  unsigned char* ucp = reinterpret_cast<unsigned char *>(&ui);
41  unsigned int i = (static_cast<unsigned int>(ucp[ 3 ]) << 24) +
42  (static_cast<unsigned int>(ucp[ 2 ]) << 16) +
43  (static_cast<unsigned int>(ucp[ 1 ]) << 8 ) +
44  (static_cast<unsigned int>(ucp[ 0 ]));
45  buffer->sputn(reinterpret_cast<char *>(&i), sizeof(unsigned int));
46  }
void cheprep::DeflateOutputStreamBuffer::putUS ( unsigned short  us)
inlineprotected

Definition at line 48 of file DeflateOutputStreamBuffer.h.

References CLHEP::us.

48  {
49  unsigned char* ucp = reinterpret_cast<unsigned char *>(&us);
50  unsigned short s = (static_cast<unsigned short>(ucp[ 1 ]) << 8 ) +
51  (static_cast<unsigned short>(ucp[ 0 ]));
52  buffer->sputn(reinterpret_cast<char *>(&s), sizeof(unsigned short));
53  }
const XML_Char * s
Definition: expat.h:262
static constexpr double us

Member Data Documentation

std::streambuf* cheprep::DeflateOutputStreamBuffer::buffer
private

Definition at line 78 of file DeflateOutputStreamBuffer.h.

unsigned int cheprep::DeflateOutputStreamBuffer::crc
private

Definition at line 80 of file DeflateOutputStreamBuffer.h.

Referenced by getCRC().

unsigned long cheprep::DeflateOutputStreamBuffer::crctable[256]
staticprivate

Definition at line 77 of file DeflateOutputStreamBuffer.h.

std::vector<char> cheprep::DeflateOutputStreamBuffer::in
private

Definition at line 89 of file DeflateOutputStreamBuffer.h.

const unsigned int cheprep::DeflateOutputStreamBuffer::inSize = 1000
staticprivate

Definition at line 84 of file DeflateOutputStreamBuffer.h.

std::vector<char> cheprep::DeflateOutputStreamBuffer::out
private

Definition at line 90 of file DeflateOutputStreamBuffer.h.

const unsigned int cheprep::DeflateOutputStreamBuffer::outSize = 1000
staticprivate

Definition at line 85 of file DeflateOutputStreamBuffer.h.

unsigned int cheprep::DeflateOutputStreamBuffer::size
private

Definition at line 81 of file DeflateOutputStreamBuffer.h.

Referenced by getSize().

z_stream cheprep::DeflateOutputStreamBuffer::zStream
private

Definition at line 86 of file DeflateOutputStreamBuffer.h.

bool cheprep::DeflateOutputStreamBuffer::zStreamOpen
private

Definition at line 87 of file DeflateOutputStreamBuffer.h.


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