Loading...
Searching...
No Matches
bitpit::adaption::InfoCollection Class Reference

The InfoCollection class is a container that holds one or more adaption info items. More...

Public Types

typedef std::vector< Info >::const_iterator const_iterator
 
typedef std::vector< Info >::iterator iterator
 

Public Member Functions

 InfoCollection ()
 
Infoat (std::size_t id)
 
const Infoat (std::size_t id) const
 
const_iterator begin () const noexcept
 
iterator begin () noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const std::vector< Info > & data () const noexcept
 
std::vector< Info > & data () noexcept
 
std::vector< Infodump ()
 
const_iterator end () const noexcept
 
iterator end () noexcept
 
bool erase (std::size_t id)
 
std::size_t erase (Type type)
 
std::size_t insert ()
 
std::size_t insert (const Info &other)
 
std::size_t insert (Info &&other)
 
std::size_t insert (Type type, Entity entity, int rank=-1)
 
Infooperator[] (std::size_t id)
 
const Infooperator[] (std::size_t id) const
 
std::size_t size () const
 

Static Public Member Functions

static void appendIds (std::vector< long > src, bool unique, std::vector< long > *dst)
 
static std::size_t removeIds (std::unordered_set< long > src, std::vector< long > *dst)
 

Detailed Description

The InfoCollection class is a container that holds one or more adaption info items.

Definition at line 81 of file adaption.hpp.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<Info>::const_iterator bitpit::adaption::InfoCollection::const_iterator

Definition at line 86 of file adaption.hpp.

◆ iterator

typedef std::vector<Info>::iterator bitpit::adaption::InfoCollection::iterator

Definition at line 85 of file adaption.hpp.

Constructor & Destructor Documentation

◆ InfoCollection()

bitpit::adaption::InfoCollection::InfoCollection ( )

Default constructor.

Definition at line 78 of file adaption.cpp.

Member Function Documentation

◆ appendIds()

void bitpit::adaption::InfoCollection::appendIds ( std::vector< long > src,
bool unique,
std::vector< long > * dst )
static

Append the ids contained in the source list into the destination list.

Optionally, it is possible to append only the ids of the source list that are not already contained in the destination list.

Parameters
srcis the list that contains the ids to be appended
uniqueif set to true, only the ids of the source list that are not already contained in the destination list will be appended
dstis the list where the ids will be copied to

Definition at line 419 of file adaption.cpp.

◆ at() [1/2]

Info & bitpit::adaption::InfoCollection::at ( std::size_t id)

Returns a reference to the adaption info at the specified position in the collection.

Parameters
idis the index of the adaption info
Returns
Returns a reference to requested adaption info.

Definition at line 343 of file adaption.cpp.

◆ at() [2/2]

const Info & bitpit::adaption::InfoCollection::at ( std::size_t id) const

Returns a constant reference to the adaption info at the specified position in the collection.

Parameters
idis the index of the adaption info
Returns
Returns a constant reference to requested adaption info.

Definition at line 359 of file adaption.cpp.

◆ begin() [1/2]

InfoCollection::const_iterator bitpit::adaption::InfoCollection::begin ( ) const
noexcept

Get a read-only iterator to the first enty of the collection.

Returns
the const iterator pointing to the first entry of the collection.

Definition at line 123 of file adaption.cpp.

◆ begin() [2/2]

InfoCollection::iterator bitpit::adaption::InfoCollection::begin ( )
noexcept

Get a read/write iterator to the first entry of the collection.

Returns
The iterator pointing to the first entry of the collection.

Definition at line 103 of file adaption.cpp.

◆ cbegin()

InfoCollection::const_iterator bitpit::adaption::InfoCollection::cbegin ( ) const
noexcept

Get a read-only iterator to the first enty of the collection.

Returns
the const iterator pointing to the first entry of the collection.

Definition at line 143 of file adaption.cpp.

◆ cend()

InfoCollection::const_iterator bitpit::adaption::InfoCollection::cend ( ) const
noexcept

Get a read-only iterator that points one past the last enty of the collection.

Returns
the const iterator pointing to one past the last entry of the collection.

Definition at line 153 of file adaption.cpp.

◆ data() [1/2]

const std::vector< Info > & bitpit::adaption::InfoCollection::data ( ) const
noexcept

Returns a constant reference to the vector used internally by the collection to store its owned adaption info.

Returns
A constant reference to the vector used internally by the collection to store its owned adaption info.

Definition at line 165 of file adaption.cpp.

◆ data() [2/2]

std::vector< Info > & bitpit::adaption::InfoCollection::data ( )
noexcept

Returns a reference to the vector used internally by the collection to store its owned adaption info.

Returns
A reference to the vector used internally by the collection to store its owned adaption info.

Definition at line 177 of file adaption.cpp.

◆ dump()

std::vector< Info > bitpit::adaption::InfoCollection::dump ( )

Dumps the collection of adaption info.

Once the collection is dumped, the internal list of adaption info and the internal cache are deleted.

Returns
The collection of adaption info.

Definition at line 398 of file adaption.cpp.

◆ end() [1/2]

InfoCollection::const_iterator bitpit::adaption::InfoCollection::end ( ) const
noexcept

Get a read-only iterator that points one past the last enty of the collection.

Returns
the const iterator pointing to one past the last entry of the collection.

Definition at line 133 of file adaption.cpp.

◆ end() [2/2]

InfoCollection::iterator bitpit::adaption::InfoCollection::end ( )
noexcept

Get a read/write iterator that points one past the last enty of the collection.

Returns
The iterator pointing to one past the last entry of the collection.

Definition at line 113 of file adaption.cpp.

◆ erase() [1/2]

bool bitpit::adaption::InfoCollection::erase ( std::size_t id)

Erase the adaption info at the specified position in the collection.

If the provided position is not valid, no actions will be performed.

Parameters
idis the index of the adaption info
Returns
Returns true if the adaption info was deleted, otherwise it return false.

Definition at line 291 of file adaption.cpp.

◆ erase() [2/2]

std::size_t bitpit::adaption::InfoCollection::erase ( Type type)

Erase all the adaption info of the specified type.

Parameters
typeis the type of adaption info that wil be deleted
Returns
Returns the number of adaption info that have been deleted

Definition at line 317 of file adaption.cpp.

◆ insert() [1/4]

std::size_t bitpit::adaption::InfoCollection::insert ( )

Insert an empty adaption info.

Returns
The index of the newly added adaption info.

Definition at line 187 of file adaption.cpp.

◆ insert() [2/4]

std::size_t bitpit::adaption::InfoCollection::insert ( const Info & other)

Copy the specified adaption in the collection.

If the requested type is among the types that are cached and an adaption info with the requested data already exists, the existing value will be returned, otherwise a new adaption info will be created. If the requested type is not among the types that are cached a new adaption info will be created even if the collection already contains adaption info with the same data.

Parameters
infois the adaption info that will be moved in the collection
Returns
The index of the newly added (or already existing) adaption info

Definition at line 243 of file adaption.cpp.

◆ insert() [3/4]

std::size_t bitpit::adaption::InfoCollection::insert ( Info && other)

Move the specified adaption in the collection.

If the requested type is among the types that are cached and an adaption info with the requested data already exists, the existing value will be returned, otherwise a new adaption info will be created. If the requested type is not among the types that are cached a new adaption info will be created even if the collection already contains adaption info with the same data.

Parameters
infois the adaption info that will be moved in the collection
Returns
The index of the newly added (or already existing) adaption info

Definition at line 262 of file adaption.cpp.

◆ insert() [4/4]

std::size_t bitpit::adaption::InfoCollection::insert ( Type type,
Entity entity,
int rank = -1 )

Insert an adaption info with the requested data.

If the requested type is among the types that are cached and an adaption info with the requested data already exists, the existing value will be returned, otherwise a new adaption info will be created. If the requested type is not among the types that are cached a new adaption info will be created even if the collection already contains adaption info with the requested data.

Parameters
typeis the type of adaption info
entityis the entity associated to the adaption info
rankis the rank associated to the adaption info
Returns
The position inside the collection of the adaption info.

Definition at line 209 of file adaption.cpp.

◆ operator[]() [1/2]

Info & bitpit::adaption::InfoCollection::operator[] ( std::size_t id)

Get a reference to the specified adaption info

Parameters
idis the index of the requested adaption info
Returns
Returns a reference to requested adaption info.

Definition at line 374 of file adaption.cpp.

◆ operator[]() [2/2]

const Info & bitpit::adaption::InfoCollection::operator[] ( std::size_t id) const

Get a constant reference to the specified adaption info

Parameters
idis the index of the requested adaption info
Returns
Returns a constant reference to requested adaption info

Definition at line 385 of file adaption.cpp.

◆ removeIds()

std::size_t bitpit::adaption::InfoCollection::removeIds ( std::unordered_set< long > src,
std::vector< long > * dst )
static

Remove the ids contained in the source list from the destination list.

Parameters
srcis the list that contains the ids to be removed
dstis the list where the ids will be copied to
Returns
The number of ids that have been deleted.

Definition at line 452 of file adaption.cpp.

◆ size()

std::size_t bitpit::adaption::InfoCollection::size ( ) const

Get the size of the collection

Returns
The number of entries in the collection.

Definition at line 93 of file adaption.cpp.


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