Base class for tubes defined over a sliced temporal domain.
More...
#include <codac2_SlicedTubeBase.h>
|
|
const std::shared_ptr< TDomain > | _tdomain |
| | Shared temporal domain of this tube.
|
Base class for tubes defined over a sliced temporal domain.
A SlicedTubeBase is a tube whose temporal domain is represented by a TDomain made of TSlice objects.
This class provides common services for all sliced tubes:
- access to the number of temporal elements,
- access to the first and last codomain slices,
- cleanup of the links stored in the temporal partition when the tube is destroyed.
Each TSlice of the associated TDomain stores a map from SlicedTubeBase* to SliceBase. The destructor of this class removes the entries associated with the current tube.
◆ SlicedTubeBase()
| codac2::SlicedTubeBase::SlicedTubeBase |
( |
const std::shared_ptr< TDomain > & | tdomain | ) |
|
|
inline |
Creates a sliced tube over a given temporal domain.
- Parameters
-
| tdomain | shared temporal domain of this tube |
45 { }
TubeBase(const std::shared_ptr< TDomain > &tdomain)
Creates a tube over a given temporal domain.
Definition codac2_TubeBase.h:38
const std::shared_ptr< TDomain > & tdomain() const
Returns the temporal domain of this tube.
Definition codac2_TubeBase.h:49
◆ ~SlicedTubeBase()
| codac2::SlicedTubeBase::~SlicedTubeBase |
( |
| ) |
|
|
inline |
Destroys this sliced tube.
All references to this tube stored in the TSlice objects of the associated TDomain are removed.
54 {
56 s._slices.erase(this);
57 }
const std::shared_ptr< TDomain > _tdomain
Shared temporal domain of this tube.
Definition codac2_TubeBase.h:71
◆ nb_slices()
| size_t codac2::SlicedTubeBase::nb_slices |
( |
| ) |
const |
|
inline |
Returns the number of temporal elements of this tube.
The count includes all elements stored in the temporal partition, including explicit gates if they exist.
- Returns
- number of temporal slices of the associated TDomain
◆ first_slice()
| std::shared_ptr< const SliceBase > codac2::SlicedTubeBase::first_slice |
( |
| ) |
const |
|
inline |
Returns the first slice of this tube.
- Note
- This method assumes that the associated temporal domain is not empty and that its first TSlice contains a slice attached to this tube.
- Returns
- shared pointer to the first slice
82 {
83 const auto& slices =
_tdomain->front().slices();
84 assert(slices.find(this) != slices.end());
85 return slices.at(this);
86 }
◆ last_slice()
| std::shared_ptr< const SliceBase > codac2::SlicedTubeBase::last_slice |
( |
| ) |
const |
|
inline |
Returns the last slice of this tube.
- Note
- This method assumes that the associated temporal domain is not empty and that its last TSlice contains a slice attached to this tube.
- Returns
- shared pointer to the last slice
98 {
99 const auto& slices =
_tdomain->back().slices();
100 assert(slices.find(this) != slices.end());
101 return slices.at(this);
102 }
The documentation for this class was generated from the following file: