Visual Computing Library
Loading...
Searching...
No Matches
vcl::comp::HasReferencesOfType Concept Reference

The HasReferencesOfType concept checks whether a component T stores references (pointers or indices) of a type (element) R. More...

Concept definition

template<typename T, typename R>
std::is_base_of<ReferencesComponentTriggerer<RemoveRef<R>>, RemoveRef<T>>::
value
The ComponentConcept is evaluated to true whenever the type T is a valid component,...
Definition component.h:44
The HasReferencesOfType concept checks whether a component T stores references (pointers or indices) ...
Definition component.h:152

Detailed Description

The HasReferencesOfType concept checks whether a component T stores references (pointers or indices) of a type (element) R.

Each component that store pointers/indices of a type R, must:

  • inherit from ReferencesComponentTriggerer<R> (automatically inherited by inheriting from Component class)
  • provide the following protected member functions:
    • void updateReferences(const R* oldBase, std::size_t offset = 0);

      the function updates the stored R pointers/indices having the old base of the container (needed to update pointers) and the possible non-zero offset (used for append operations).

    • void updateReferences(const std::vector<uint>& newIndices);

      the function updates the stored R pointers/indices having, for each old element index, its new index in the container.

Template Parameters
Tthe type to be evaluated.
Rthe type of the references.