#include <G4SurfBits.hh>
Definition at line 59 of file G4SurfBits.hh.
◆ G4SurfBits() [1/2]
G4SurfBits::G4SurfBits |
( |
unsigned int |
nbits = 0 | ) |
|
◆ G4SurfBits() [2/2]
G4SurfBits::G4SurfBits |
( |
const G4SurfBits & |
original | ) |
|
◆ ~G4SurfBits()
G4SurfBits::~G4SurfBits |
( |
| ) |
|
◆ Clear()
void G4SurfBits::Clear |
( |
| ) |
|
◆ Compact()
void G4SurfBits::Compact |
( |
| ) |
|
Definition at line 103 of file G4SurfBits.cc.
110 needed > 0 &&
fAllBits[needed]==0; ) { needed--; };
114 unsigned char *old_location =
fAllBits;
115 fAllBits =
new unsigned char[needed];
117 std::memcpy(fAllBits,old_location,needed);
118 delete [] old_location;
◆ Get() [1/2]
void G4SurfBits::Get |
( |
char * |
array | ) |
const |
◆ Get() [2/2]
void G4SurfBits::Get |
( |
G4int * |
array | ) |
const |
◆ GetNbits()
unsigned int G4SurfBits::GetNbits |
( |
| ) |
const |
|
inline |
◆ GetNbytes()
unsigned int G4SurfBits::GetNbytes |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ operator[]()
G4bool G4SurfBits::operator[] |
( |
unsigned int |
bitnumber | ) |
const |
|
inline |
Definition at line 166 of file G4SurfBits.hh.
G4bool TestBitNumber(unsigned int bitnumber) const
◆ Output()
void G4SurfBits::Output |
( |
std::ostream & |
os | ) |
const |
Definition at line 126 of file G4SurfBits.cc.
129 for(
unsigned int i=0; i<
fNBytes; ++i) {
130 unsigned char val =
fAllBits[fNBytes - 1 - i];
131 for (
unsigned int j=0; j<8; ++j) {
◆ Print()
void G4SurfBits::Print |
( |
void |
| ) |
const |
Definition at line 139 of file G4SurfBits.cc.
143 for(
unsigned int i=0; i<
fNBytes; ++i) {
145 for (
unsigned int j=0; j<8; ++j) {
146 if (val & 1)
G4cout <<
" bit:" << count <<
" = 1" <<
G4endl;
G4GLOB_DLL std::ostream G4cout
◆ ReserveBytes()
void G4SurfBits::ReserveBytes |
( |
unsigned int |
nbytes | ) |
|
|
protected |
Definition at line 160 of file G4SurfBits.cc.
166 unsigned char *newBits=
new unsigned char[nbytes];
◆ ResetAllBits()
void G4SurfBits::ResetAllBits |
( |
G4bool |
value = false | ) |
|
◆ ResetBitNumber()
void G4SurfBits::ResetBitNumber |
( |
unsigned int |
bitnumber | ) |
|
|
inline |
Definition at line 161 of file G4SurfBits.hh.
void SetBitNumber(unsigned int bitnumber, G4bool value=true)
◆ set() [1/2]
void G4SurfBits::set |
( |
unsigned int |
nbits, |
|
|
const char * |
array |
|
) |
| |
Definition at line 174 of file G4SurfBits.cc.
177 unsigned int nbytes=(nBits+7)>>3;
182 std::memcpy(
fAllBits, array, nbytes);
void ReserveBytes(unsigned int nbytes)
◆ set() [2/2]
void G4SurfBits::set |
( |
unsigned int |
nbits, |
|
|
const G4int * |
array |
|
) |
| |
Definition at line 196 of file G4SurfBits.cc.
200 set(nBits, (
const char*)array);
◆ SetBitNumber()
void G4SurfBits::SetBitNumber |
( |
unsigned int |
bitnumber, |
|
|
G4bool |
value = true |
|
) |
| |
|
inline |
Definition at line 123 of file G4SurfBits.hh.
126 if (bitnumber >=
fNBits) {
127 unsigned int new_size = (bitnumber/8) + 1;
129 if (new_size < 100 * 1024 * 1024)
131 unsigned char *old_location =
fAllBits;
132 fAllBits =
new unsigned char[new_size];
136 delete [] old_location;
140 unsigned int loc = bitnumber/8;
141 unsigned char bit = bitnumber%8;
◆ TestBitNumber()
G4bool G4SurfBits::TestBitNumber |
( |
unsigned int |
bitnumber | ) |
const |
|
inline |
Definition at line 148 of file G4SurfBits.hh.
152 if (bitnumber >=
fNBits)
return false;
153 unsigned int loc = bitnumber/8;
154 unsigned char value =
fAllBits[loc];
155 unsigned char bit = bitnumber%8;
156 G4bool result = (value & (1<<bit)) != 0;
◆ fAllBits
unsigned char* G4SurfBits::fAllBits |
◆ fNBits
unsigned int G4SurfBits::fNBits |
|
protected |
◆ fNBytes
unsigned int G4SurfBits::fNBytes |
|
protected |
The documentation for this class was generated from the following files: