template struct mrpt::containers::ContainerReadOnlyProxyAccessor

A generic proxy accessor template that only allows read-only access to the original binded STL container object.

#include <mrpt/containers/ContainerReadOnlyProxyAccessor.h>

template <typename STLCONTAINER>
struct ContainerReadOnlyProxyAccessor
{
    // construction

    ContainerReadOnlyProxyAccessor(STLCONTAINER& source);
    ContainerReadOnlyProxyAccessor(const ContainerReadOnlyProxyAccessor<STLCONTAINER>&);

    //
methods

    ContainerReadOnlyProxyAccessor<STLCONTAINER>& operator = (const ContainerReadOnlyProxyAccessor<STLCONTAINER>& o);
    operator const STLCONTAINER & () const;
    size_t size() const;
    const STLCONTAINER::value_type& operator [] (const int i) const;
    STLCONTAINER::const_iterator begin() const;
    STLCONTAINER::const_iterator end() const;
    STLCONTAINER::const_reverse_iterator rbegin() const;
    STLCONTAINER::const_reverse_iterator rend() const;
};

Construction

ContainerReadOnlyProxyAccessor(STLCONTAINER& source)

ctor: binds to source object

ContainerReadOnlyProxyAccessor(const ContainerReadOnlyProxyAccessor<STLCONTAINER>&)

(Deleted ctor) ignore copies (keep reference to original object)

Methods

ContainerReadOnlyProxyAccessor<STLCONTAINER>& operator = (const ContainerReadOnlyProxyAccessor<STLCONTAINER>& o)

Don’t copy the reference to the source object, but copy the contained data.

This is only allowed if the size of the buffers coincide.

operator const STLCONTAINER & () const

Transparent conversion to const ref to original source object.