.. index:: pair: class; EE::ObservableVector::SharedHandle .. _doxid-class_e_e_1_1_observable_vector_1_1_shared_handle: class EE::ObservableVector::SharedHandle ======================================== .. toctree:: :hidden: Overview ~~~~~~~~ Shared read and observation access for adapters that may outlive this wrapper. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class SharedHandle { public: // methods const std::vector& :ref:`get`() const; const T& :ref:`operator[]`(std::size_t index) const; std::size_t :ref:`size`() const; :ref:`operator bool`() const; :ref:`Connection` :ref:`observe`(:ref:`Callback` callback) const; }; .. _details-class_e_e_1_1_observable_vector_1_1_shared_handle: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Shared read and observation access for adapters that may outlive this wrapper. Retaining this handle keeps the collection storage alive. Mutations remain available only through :ref:`ObservableVector `, so the handle becomes a stable read-only snapshot once its owning wrapper is destroyed. Methods ------- .. index:: pair: function; get .. _doxid-class_e_e_1_1_observable_vector_1_1_shared_handle_1aa1a61625503863efb9c3006d6c35cea5: .. ref-code-block:: cpp :class: doxyrest-title-code-block const std::vector& get() const .. rubric:: Returns: Read-only access to the retained collection. .. index:: pair: function; operator[] .. _doxid-class_e_e_1_1_observable_vector_1_1_shared_handle_1af246e4c43e17244a3e44169b90cc20a0: .. ref-code-block:: cpp :class: doxyrest-title-code-block const T& operator[](std::size_t index) const .. rubric:: Returns: The retained value at ``index``. No bounds checking is performed. .. index:: pair: function; size .. _doxid-class_e_e_1_1_observable_vector_1_1_shared_handle_1a7fb1c877001ac3b99d367978b1981482: .. ref-code-block:: cpp :class: doxyrest-title-code-block std::size_t size() const .. rubric:: Returns: The number of retained values. .. index:: pair: function; operator bool .. _doxid-class_e_e_1_1_observable_vector_1_1_shared_handle_1abe56fd9b54bb86745c1d4f36ec6c9ab5: .. ref-code-block:: cpp :class: doxyrest-title-code-block operator bool() const .. rubric:: Returns: Whether this handle retains collection storage. .. index:: pair: function; observe .. _doxid-class_e_e_1_1_observable_vector_1_1_shared_handle_1a71f9f262b3e56f57fa094fa01188f4a5: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Connection` observe(:ref:`Callback` callback) const .. rubric:: Returns: A scoped connection observing later mutations of the owning :ref:`ObservableVector `.