Template Class ImplContainer

Inheritance Relationships

Derived Type

Class Documentation

template<typename T>
class ImplContainer

Subclassed by nix::base::Entity< T >

Public Functions

inline ImplContainer()
inline ImplContainer(T *p_impl)
inline ImplContainer(const std::shared_ptr<T> &p_impl)
inline ImplContainer(std::shared_ptr<T> &&ptr)
inline ImplContainer(const ImplContainer<T> &other)
inline bool isNone() const
inline explicit operator bool() const
inline virtual ImplContainer<T> &operator=(const ImplContainer<T> &other)
inline virtual ImplContainer<T> &operator=(none_t t)
inline virtual bool operator==(const ImplContainer<T> &other) const
inline virtual bool operator!=(const ImplContainer<T> &other) const
inline virtual bool operator==(none_t t) const
inline virtual bool operator==(bool b) const
inline virtual bool operator!=(none_t t) const
inline virtual bool operator!=(bool b) const
inline virtual void swap(ImplContainer<T> &second)
inline virtual ~ImplContainer()
inline const std::shared_ptr<T> &impl() const
inline std::shared_ptr<T> &impl()

Protected Functions

template<typename TENT, typename TFUNC>
inline std::vector<TENT> getEntities(TFUNC const &getEntity, ndsize_t n, std::function<bool(TENT)> filter) const

Low level helper to get multiple entities via a getter function that has to be provided.

Get multiple entities of given type and return them as vector. The template param specifies which type. The parameter “getEnt” is the function used to get the entities of given type T_ENT and has to be of return type T_ENT with parameter “size_t” specifying the index of the entity to get. The parameter “nT” should give the number of entities to get and should be =>0 & <= the total number of existing entities. The parameter “filter” is defaulted to return all entities of given type. To use your own filter pass a lambda that accepts an entity of given type as parameter and returns a bool telling whether to get it or not. NOTE: there is no need to specify 2nd template param TFUNC as it should be automatically deduced.

Parameters
  • getEntity – Function of return type TENT.

  • n – Number of entities to get.

  • filter – Filter function.

Returns

A vector with all filtered entities.

inline T *backend()
inline const T *backend() const
inline void nullify()