NeoPZ
Public Member Functions | Private Attributes | List of all members
TPZAdmChunkVectorThreadSafe< T, EXP > Class Template Reference

#include <pzadmchunkthreadsafe.h>

Inheritance diagram for TPZAdmChunkVectorThreadSafe< T, EXP >:
[legend]
Collaboration diagram for TPZAdmChunkVectorThreadSafe< T, EXP >:
[legend]

Public Member Functions

TPZAdmChunkVectorThreadSafe< T, EXP > & operator= (const TPZAdmChunkVectorThreadSafe< T, EXP > &TPZAdmCh)
 
 TPZAdmChunkVectorThreadSafe (const TPZAdmChunkVectorThreadSafe< T, EXP > &AdmCh)
 
 TPZAdmChunkVectorThreadSafe (int numberofchunks=DEFAULTNUMBEROFCHUNKS)
 
virtual ~TPZAdmChunkVectorThreadSafe ()
 
int AllocateNewElement ()
 
void SetFree (int index)
 
int NFreeElements ()
 
int NElements () const
 
void CompactDataStructure (int type=2)
 
int PrintFree (int i)
 
void Resize (const int newsize)
 
T & operator[] (const int nelem) const
 
int FindObject (T *obj)
 
- Public Member Functions inherited from TPZAdmChunkVector< T, EXP >
TPZAdmChunkVector< T, EXP > & operator= (const TPZAdmChunkVector< T, EXP > &TPZAdmCh)
 Assignment operator. More...
 
 TPZAdmChunkVector (const TPZAdmChunkVector< T, EXP > &AdmCh)
 Copy constructor. More...
 
 TPZAdmChunkVector (int numberofchunks=DEFAULTNUMBEROFCHUNKS)
 Constructor. More...
 
virtual ~TPZAdmChunkVector ()
 Destructor. More...
 
int AllocateNewElement ()
 Makes more room for new elements. More...
 
void SetFree (int index)
 Indicate an element as free. More...
 
int64_t NFreeElements () const
 Access method to return the number of free elements. More...
 
void CompactDataStructure (CompactScheme type=CompactScheme::ALWAYS)
 Sets the method to compact the data structure based on the. More...
 
int PrintFree (int i)
 Print index i into the fFree vector. More...
 
void Resize (const int newsize)
 Increase the size of the chunk vector. More...
 
int ClassId () const override
 Define the class id associated with the class. More...
 
void Read (TPZStream &buf, void *context) override
 read objects from the stream More...
 
void Write (TPZStream &buf, int withclassid) const override
 Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More...
 
- Public Member Functions inherited from TPZChunkVector< T, EXP >
TPZChunkVector< T, EXP > & operator= (const TPZChunkVector< T, EXP > &TCh)
 Assignment operator, copies all elements from the object TCh. More...
 
 TPZChunkVector (const TPZChunkVector< T, EXP > &TCh)
 Copy constructor. More...
 
 TPZChunkVector (int64_t numberofchunks=DEFAULTNUMBEROFCHUNKS)
 Constructor with numberofchunks chunks. More...
 
virtual ~TPZChunkVector ()
 Destructor. More...
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
int64_t NElements () const
 Access method to query the number of elements of the vector. More...
 
void Resize (const int64_t newsize)
 Increase the size of the chunk vector. More...
 
T & operator[] (const int64_t nelem) const
 Returns a reference to the ith element of the vector. More...
 
int64_t FindObject (T *object)
 Finds the index of an object by its pointer. More...
 
int ClassId () const override
 Define the class id associated with the class. More...
 
void Read (TPZStream &buf, void *context) override
 read objects from the stream More...
 
void Write (TPZStream &buf, int withclassid) const override
 Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More...
 
- Public Member Functions inherited from TPZSavable
 TPZSavable ()
 
virtual ~TPZSavable ()
 
virtual std::list< std::map< std::string, uint64_t > > VersionHistory () const
 
virtual std::pair< std::string, uint64_t > Version () const
 
virtual bool Compare (TPZSavable *copy, bool override=false)
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) const
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
- Public Member Functions inherited from TPZRegisterClassId
template<typename T >
 TPZRegisterClassId (int(T::*)() const)
 
 TPZRegisterClassId ()=default
 

Private Attributes

pthread_mutex_t fAdmChunkVectorLock
 

Additional Inherited Members

- Public Types inherited from TPZAdmChunkVector< T, EXP >
enum  CompactScheme { NEVER, NOW, ALWAYS }
 
- Public Types inherited from TPZChunkVector< T, EXP >
typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef TPZChunkVectorIterator< false, value_type, EXP > iterator
 
typedef TPZChunkVectorIterator< true, value_type, EXP > const_iterator
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef int64_t size_type
 
- Static Public Member Functions inherited from TPZSavable
static std::set< TPZRestoreClassBase * > & RestoreClassSet ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::map< int, TPZRestore_t > & ClassIdMap ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::pair< std::string, uint64_t > NeoPZVersion ()
 
static void Register (TPZRestoreClassBase *restore)
 
static void RegisterClassId (int classid, TPZRestore_t fun)
 
static TPZSavableCreateInstance (const int &classId)
 
- Protected Attributes inherited from TPZChunkVector< T, EXP >
int64_t fNElements
 Number of elements of the chunk vector. More...
 
TPZManVector< T * > fVec
 Vector which points to each chunk of objects. More...
 

Detailed Description

template<class T, int EXP = 10>
class TPZAdmChunkVectorThreadSafe< T, EXP >

Definition at line 15 of file pzadmchunkthreadsafe.h.

Constructor & Destructor Documentation

◆ TPZAdmChunkVectorThreadSafe() [1/2]

template<class T , int EXP>
TPZAdmChunkVectorThreadSafe< T, EXP >::TPZAdmChunkVectorThreadSafe ( const TPZAdmChunkVectorThreadSafe< T, EXP > &  AdmCh)

◆ TPZAdmChunkVectorThreadSafe() [2/2]

template<class T , int EXP>
TPZAdmChunkVectorThreadSafe< T, EXP >::TPZAdmChunkVectorThreadSafe ( int  numberofchunks = DEFAULTNUMBEROFCHUNKS)

◆ ~TPZAdmChunkVectorThreadSafe()

template<class T , int EXP>
TPZAdmChunkVectorThreadSafe< T, EXP >::~TPZAdmChunkVectorThreadSafe ( )
virtual

Member Function Documentation

◆ AllocateNewElement()

template<class T , int EXP>
int TPZAdmChunkVectorThreadSafe< T, EXP >::AllocateNewElement ( )

◆ CompactDataStructure()

template<class T , int EXP>
void TPZAdmChunkVectorThreadSafe< T, EXP >::CompactDataStructure ( int  type = 2)

◆ FindObject()

template<class T , int EXP>
int TPZAdmChunkVectorThreadSafe< T, EXP >::FindObject ( T *  obj)

◆ NElements()

template<class T , int EXP>
int TPZAdmChunkVectorThreadSafe< T, EXP >::NElements ( ) const

◆ NFreeElements()

template<class T , int EXP>
int TPZAdmChunkVectorThreadSafe< T, EXP >::NFreeElements ( )

◆ operator=()

template<class T , int EXP>
TPZAdmChunkVectorThreadSafe< T, EXP > & TPZAdmChunkVectorThreadSafe< T, EXP >::operator= ( const TPZAdmChunkVectorThreadSafe< T, EXP > &  TPZAdmCh)

◆ operator[]()

template<class T , int EXP>
T & TPZAdmChunkVectorThreadSafe< T, EXP >::operator[] ( const int  nelem) const
inline

◆ PrintFree()

template<class T , int EXP>
int TPZAdmChunkVectorThreadSafe< T, EXP >::PrintFree ( int  i)

◆ Resize()

template<class T , int EXP>
void TPZAdmChunkVectorThreadSafe< T, EXP >::Resize ( const int  newsize)

◆ SetFree()

template<class T , int EXP>
void TPZAdmChunkVectorThreadSafe< T, EXP >::SetFree ( int  index)

Member Data Documentation

◆ fAdmChunkVectorLock

template<class T, int EXP = 10>
pthread_mutex_t TPZAdmChunkVectorThreadSafe< T, EXP >::fAdmChunkVectorLock
mutableprivate

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