Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
gap Struct Reference

Public Member Functions

 gap ()
void push (char_t *&s, size_t count)
char_t * flush (char_t *s)

Public Attributes

char_t * end
size_t size

Detailed Description

Definition at line 2421 of file pugixml.cc.

Constructor & Destructor Documentation

◆ gap()

gap::gap ( )
inline

Definition at line 2426 of file pugixml.cc.

2426 : end(0), size(0)
2427 {
2428 }
char_t * end
Definition pugixml.cc:2423
size_t size
Definition pugixml.cc:2424

Member Function Documentation

◆ flush()

char_t * gap::flush ( char_t * s)
inline

Definition at line 2449 of file pugixml.cc.

2450 {
2451 if (end)
2452 {
2453 // Move [old_gap_end, current_pos) to [old_gap_start, ...)
2454 assert(s >= end);
2455 memmove(end - size, end, reinterpret_cast<char*>(s) - reinterpret_cast<char*>(end));
2456
2457 return s - size;
2458 }
2459 else return s;
2460 }

◆ push()

void gap::push ( char_t *& s,
size_t count )
inline

Definition at line 2432 of file pugixml.cc.

2433 {
2434 if (end) // there was a gap already; collapse it
2435 {
2436 // Move [old_gap_end, new_gap_start) to [old_gap_start, ...)
2437 assert(s >= end);
2438 memmove(end - size, end, reinterpret_cast<char*>(s) - reinterpret_cast<char*>(end));
2439 }
2440
2441 s += count; // end of current gap
2442
2443 // "merge" two gaps
2444 end = s;
2445 size += count;
2446 }

Member Data Documentation

◆ end

char_t* gap::end

Definition at line 2423 of file pugixml.cc.

Referenced by flush(), gap(), and push().

◆ size

size_t gap::size

Definition at line 2424 of file pugixml.cc.

Referenced by flush(), gap(), and push().


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