Celeritas  0.5.0-56+6b053cd
Classes | Typedefs
Collection.hh File Reference
#include "corecel/Assert.hh"
#include "corecel/OpaqueId.hh"
#include "corecel/Types.hh"
#include "corecel/cont/Range.hh"
#include "corecel/sys/ThreadId.hh"
#include "ObserverPtr.hh"
#include "detail/CollectionImpl.hh"

Classes

class  celeritas::ItemMap< T1, T2 >
 Access data in a Range<T2> with an index of type T1. More...
 
struct  celeritas::AllItems< T, M >
 Sentinel class for obtaining a view to all items of a collection. More...
 
class  celeritas::Collection< T, W, M, I >
 Manage generic array-like data ownership and transfer from host to device. More...
 

Typedefs

template<class T >
using celeritas::ItemId = OpaqueId< T, size_type >
 Opaque ID representing a single element of a container.
 
template<class T , class Size = size_type>
using celeritas::ItemRange = Range< OpaqueId< T, Size > >
 Reference a contiguous range of IDs corresponding to a slice of items. More...
 
template<class T , Ownership W, MemSpace M>
using celeritas::StateCollection = Collection< T, W, M, TrackSlotId >
 Collection for data of type T but indexed by TrackSlotId for use in States.
 

Typedef Documentation

◆ ItemRange

template<class T , class Size = size_type>
using celeritas::ItemRange = typedef Range<OpaqueId<T, Size> >

Reference a contiguous range of IDs corresponding to a slice of items.

Template Parameters
TThe value type of items to represent.

An ItemRange is a range of OpaqueId<T> that reference a range of values of type T in a Collection . The ItemRange acts like a slice object in Python when used on a Collection, returning a Span<T> of the underlying data.

An ItemRange is only meaningful in connection with a particular Collection of type T. It doesn't have any persistent connection to its associated collection and thus must be used carefully.

struct MyMaterial
{
real_type number_density;
ItemRange<ElementComponents> components;
};
template<Ownership W, MemSpace M>
struct MyData
{
Collection<ElementComponents, W, M> components;
Collection<MyMaterial, W, M> materials;
};
double real_type
Numerical type for real numbers.
Definition: corecel/Types.hh:35