ROOT logo
ROOT » GRAF3D » EVE » TEveChunkManager

class TEveChunkManager

 TEveChunkManager

 Vector-like container with chunked memory allocation.

 Allocation chunk can accommodate fN atoms of byte-size fS each.
 The chunks themselves are TArrayCs and are stored in a std::vector<TArrayC*>.
 Holes in the structure are not supported, neither is removal of atoms.
 The structure can be Refit() to occupy a single contiguous array.

Function Members (Methods)

public:
TEveChunkManager()
TEveChunkManager(Int_t atom_size, Int_t chunk_size)
virtual~TEveChunkManager()
Char_t*Atom(Int_t idx) const
Int_tCapacity() const
Char_t*Chunk(Int_t chk) const
static TClass*Class()
virtual TClass*IsA() const
Int_tN() const
Int_tNAtoms(Int_t chk) const
Char_t*NewAtom()
Char_t*NewChunk()
voidRefit()
voidReset(Int_t atom_size, Int_t chunk_size)
Int_tS() const
virtual voidShowMembers(TMemberInspector& insp, char* parent)
Int_tSize() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
Int_tVecSize() const
protected:
voidReleaseChunks()

Data Members

protected:
Int_tfCapacityAvailable capacity within the chunks
vector<TArrayC*>fChunksMemory blocks
Int_tfNNumber of atoms in a chunk
Int_tfSSize of atom
Int_tfSizeSize of container, number of atoms
Int_tfVecSizeNumber of allocated chunks

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

void ReleaseChunks()
 Release all memory chunks.
TEveChunkManager()
 Default constructor.
 Call reset for initialization.
TEveChunkManager(Int_t atom_size, Int_t chunk_size)
 Constructor.
~TEveChunkManager()
 Destructor.
void Reset(Int_t atom_size, Int_t chunk_size)
 Empty the container and reset it with given atom and chunk sizes.
void Refit()
 Refit the container so that all current data fits into a single
 chunk.
Char_t* NewChunk()
 Allocate a new memory chunk and register it.
Char_t* NewAtom()
TEveChunkManager(const TEveChunkManager& )
TEveChunkManager& operator=(const TEveChunkManager& )
Int_t S() const
{ return fS; }
Int_t N() const
{ return fN; }
Int_t Size() const
{ return fSize; }
Int_t VecSize() const
{ return fVecSize; }
Int_t Capacity() const
{ return fCapacity; }
Char_t* Atom(Int_t idx) const
{ return fChunks[idx/fN]->fArray + idx%fN*fS; }
Char_t* Chunk(Int_t chk) const
{ return fChunks[chk]->fArray; }
Int_t NAtoms(Int_t chk) const
{ return (chk < fVecSize-1) ? fN : (fSize-1)%fN + 1; }