Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
bitpit::PiercedStorageSyncSlave< id_t > Class Template Reference

Base class for defining storages that acts like a slave in pierced synchronization. More...

#include <piercedStorage.hpp>

Inheritance diagram for bitpit::PiercedStorageSyncSlave< id_t >:
Inheritance graph
[legend]
Collaboration diagram for bitpit::PiercedStorageSyncSlave< id_t >:
Collaboration graph
[legend]

Public Types

typedef Kernel< id_t >::id_type id_type
 
template<typename PK_id_t >
using Kernel = PiercedKernel<PK_id_t>
 
typedef Kernel< id_t > kernel_t
 
enum  KernelType { KERNEL_NONE = -1 , KERNEL_STATIC = 0 , KERNEL_DYNAMIC = 1 }
 

Public Member Functions

virtual ~PiercedStorageSyncSlave ()
 
const PiercedKernel< id_t > * getKernel () const
 
KernelType getKernelType () const
 
PiercedSyncMaster::SyncMode getSyncMode () const
 
void setDynamicKernel (const PiercedKernel< id_t > *kernel, PiercedSyncMaster::SyncMode syncMode)
 
void setStaticKernel (const PiercedKernel< id_t > *kernel)
 
void swap (PiercedStorageSyncSlave< id_t > &other) noexcept
 
void unsetKernel (bool release=true)
 

Protected Member Functions

 PiercedStorageSyncSlave ()
 
 PiercedStorageSyncSlave (const PiercedKernel< id_t > *kernel)
 
 PiercedStorageSyncSlave (const PiercedKernel< id_t > *kernel, PiercedSyncMaster::SyncMode syncMode)
 
 PiercedStorageSyncSlave (const PiercedStorageSyncSlave< id_t > &other)
 
 PiercedStorageSyncSlave (const PiercedStorageSyncSlave< id_t > &other, const PiercedKernel< id_t > *kernel)
 
 PiercedStorageSyncSlave (const PiercedStorageSyncSlave< id_t > &other, const PiercedKernel< id_t > *kernel, PiercedSyncMaster::SyncMode syncMode)
 
 PiercedStorageSyncSlave (PiercedStorageSyncSlave< id_t > &&other)
 
 PiercedStorageSyncSlave (PiercedStorageSyncSlave< id_t > &&other, const PiercedKernel< id_t > *kernel)
 
 PiercedStorageSyncSlave (PiercedStorageSyncSlave< id_t > &&other, const PiercedKernel< id_t > *kernel, PiercedSyncMaster::SyncMode syncMode)
 
virtual void _postSetDynamicKernel ()
 
virtual void _postSetStaticKernel ()
 
virtual void _postUnsetKernel (bool release=true)
 
void detachKernel ()
 
- Protected Member Functions inherited from bitpit::PiercedSyncSlave
 PiercedSyncSlave ()
 
virtual void commitSyncAction (const PiercedSyncAction &action)=0
 
void swap (PiercedSyncSlave &other) noexcept
 

Protected Attributes

const PiercedKernel< id_t > * m_kernel
 
KernelType m_kernelType
 

Detailed Description

template<typename id_t = long>
class bitpit::PiercedStorageSyncSlave< id_t >

Base class for defining storages that acts like a slave in pierced synchronization.

Definition at line 66 of file piercedStorage.hpp.

Member Typedef Documentation

◆ id_type

template<typename id_t = long>
typedef Kernel<id_t>::id_type bitpit::PiercedStorageSyncSlave< id_t >::id_type

Type of ids stored in the container

Definition at line 82 of file piercedStorage.hpp.

◆ Kernel

template<typename id_t = long>
template<typename PK_id_t >
using bitpit::PiercedStorageSyncSlave< id_t >::Kernel = PiercedKernel<PK_id_t>

Kernel template

Definition at line 75 of file piercedStorage.hpp.

◆ kernel_t

template<typename id_t = long>
typedef Kernel<id_t> bitpit::PiercedStorageSyncSlave< id_t >::kernel_t

Kernel

Definition at line 87 of file piercedStorage.hpp.

Member Enumeration Documentation

◆ KernelType

template<typename id_t = long>
enum bitpit::PiercedStorageSyncSlave::KernelType

Definition at line 90 of file piercedStorage.hpp.

Constructor & Destructor Documentation

◆ ~PiercedStorageSyncSlave()

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::~PiercedStorageSyncSlave ( )
virtual

Destructor

Definition at line 220 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [1/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( )
protected

Constructor.

Definition at line 34 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [2/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( const PiercedKernel< id_t > * kernel)
protected

Constructor.

Parameters
kernelis the kernel that will be set

Definition at line 45 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [3/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( const PiercedKernel< id_t > * kernel,
PiercedSyncMaster::SyncMode syncMode )
protected

Constructor.

Parameters
kernelis the kernel that will be set
syncModeis the synchronization mode that will be used for the storage

Definition at line 58 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [4/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( const PiercedStorageSyncSlave< id_t > & other)
protected

Constructor.

Parameters
otheris another container of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container

Definition at line 71 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [5/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( const PiercedStorageSyncSlave< id_t > & other,
const PiercedKernel< id_t > * kernel )
protected

Constructor.

The newly created pierced sync slave will be associated with the given static kernel.

Parameters
otheris another container of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container
kernelis the kernel that will be set

Definition at line 108 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [6/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( const PiercedStorageSyncSlave< id_t > & other,
const PiercedKernel< id_t > * kernel,
PiercedSyncMaster::SyncMode syncMode )
protected

Constructor.

The newly created pierced sync slave will be associated with the given dynamic kernel and will use the specified synchronization mode.

Parameters
otheris another container of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container
kernelis the kernel that will be set
syncModeis the synchronization mode that will be used for the storage

Definition at line 128 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [7/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( PiercedStorageSyncSlave< id_t > && other)
protected

Constructor.

Parameters
otheris another container of the same type (i.e., instantiated with the same template parameters) whose content is moved in this container

Definition at line 143 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [8/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( PiercedStorageSyncSlave< id_t > && other,
const PiercedKernel< id_t > * kernel )
protected

Constructor.

The newly created pierced sync slave will be associated with the given static kernel.

Parameters
otheris another container of the same type (i.e., instantiated with the same template parameters) whose content is moved in this container
kernelis the kernel that will be set

Definition at line 184 of file piercedStorage.tpp.

◆ PiercedStorageSyncSlave() [9/9]

template<typename id_t >
bitpit::PiercedStorageSyncSlave< id_t >::PiercedStorageSyncSlave ( PiercedStorageSyncSlave< id_t > && other,
const PiercedKernel< id_t > * kernel,
PiercedSyncMaster::SyncMode syncMode )
protected

Constructor.

The newly created pierced sync slave will be associated with the given dynamic kernel and will use the given synchronization mode.

Parameters
otheris another container of the same type (i.e., instantiated with the same template parameters) whose content is moved in this container
kernelis the kernel that will be set
syncModeis the synchronization mode that will be used for the storage

Definition at line 206 of file piercedStorage.tpp.

Member Function Documentation

◆ _postSetDynamicKernel()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::_postSetDynamicKernel ( )
protectedvirtual

◆ _postSetStaticKernel()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::_postSetStaticKernel ( )
protectedvirtual

◆ _postUnsetKernel()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::_postUnsetKernel ( bool release = true)
protectedvirtual

◆ detachKernel()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::detachKernel ( )
protected

Detach the kernel without clearing the container.

Definition at line 338 of file piercedStorage.tpp.

◆ getKernel()

template<typename id_t >
const PiercedKernel< id_t > * bitpit::PiercedStorageSyncSlave< id_t >::getKernel ( ) const

Gets a constant reference to the kernel of the storage

Returns
A constant reference to the kernel of the storage.

Definition at line 360 of file piercedStorage.tpp.

◆ getKernelType()

template<typename id_t >
PiercedStorageSyncSlave< id_t >::KernelType bitpit::PiercedStorageSyncSlave< id_t >::getKernelType ( ) const

Get the type of kernel set for the storage.

Returns
The type of kernel set for the storage.

Definition at line 371 of file piercedStorage.tpp.

◆ getSyncMode()

template<typename id_t >
PiercedSyncMaster::SyncMode bitpit::PiercedStorageSyncSlave< id_t >::getSyncMode ( ) const

Gets the syncronization mode of the storage.

Returns
The synchronization mode of the storage.

Definition at line 382 of file piercedStorage.tpp.

◆ setDynamicKernel()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::setDynamicKernel ( const PiercedKernel< id_t > * kernel,
PiercedSyncMaster::SyncMode syncMode )

Sets the kernel that will be used by the storage.

The storage will dynamically synchronized with the kernel.

If a kernel has already been set for the storage, it is mandatory to unset it before setting a new one. Calling this function when the kernel is already associated with a kernel will lead to an exception being thrown.

Parameters
kernelis the kernel that will be set
syncModeis the synchronization mode that will be used for the storage
Examples
voloctree_adaptation_example_00001.cpp.

Definition at line 278 of file piercedStorage.tpp.

◆ setStaticKernel()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::setStaticKernel ( const PiercedKernel< id_t > * kernel)

Sets the kernel that will be used by the storage

The storage will NOT be synchronized with the kernel. Every change to the kernel can potentially invalidate the link between kernel and storage.

If a kernel has already been set for the storage, it is mandatory to unset it before setting a new one. Calling this function when the kernel is already associated with a kernel will lead to an exception being thrown.

Parameters
kernelis the kernel that will be set

Definition at line 238 of file piercedStorage.tpp.

◆ swap()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::swap ( PiercedStorageSyncSlave< id_t > & other)
noexcept

Exchanges the content of the storage by the content of x, which is another storage object of the same type. Sizes may differ but the number of fields has to be the same.

After the call to this member function, the elements in this storage are those which were in x before the call, and the elements of x are those which were in this. All iterators, references and pointers remain valid for the swapped objects.

Parameters
otheris another storage of the same type (i.e., instantiated with the same template parameters) whose content is swapped with that of this storage.

Definition at line 406 of file piercedStorage.tpp.

◆ unsetKernel()

template<typename id_t >
void bitpit::PiercedStorageSyncSlave< id_t >::unsetKernel ( bool release = true)

Unsets the kernel.

Parameters
releaseif it's true the memory hold by the container will be released, otherwise the container will be cleared but its memory will not be released

Definition at line 310 of file piercedStorage.tpp.

Member Data Documentation

◆ m_kernel

template<typename id_t = long>
const PiercedKernel<id_t>* bitpit::PiercedStorageSyncSlave< id_t >::m_kernel
protected

Definition at line 111 of file piercedStorage.hpp.

◆ m_kernelType

template<typename id_t = long>
KernelType bitpit::PiercedStorageSyncSlave< id_t >::m_kernelType
protected

Definition at line 112 of file piercedStorage.hpp.


The documentation for this class was generated from the following files:
--- layout: doxygen_footer ---