Storage
Storage<T> is a storage template class which can handle any type T of values. It wraps around the std::vector for consistency of interface with other storages.
Constructors
cppStorage();Default constructor. Creates empty storage.
cppStorage(const Storage<T>& rhs);Copy constructor. Initializes current storage with the copy of the
rhs.
cppvoid Allocate(const size_t size_in);Allocates storage to the given
size_in.
cppvoid Reallocate(const size_t new_size);Reallocates storage to the
new_size. Erases old data.
Data access and manipulation
cppStorage<T>& operator=(const Storage<T>& rhs);Assignment operator. Assigns the content of the
rhsto the current Storage.
cppT& operator[](const size_t idx);Random access operator. Returns the reference to the value pointed to by the
idx.
cppT const& operator[](const size_t idx) const;Random access operator. Returns const reference to the value pointed to by the
idx.
Container properties
cppsize_t size() const;Returns storage size.
cppbool IsAllocated() const;Returns true if storage is allocated.
cppbool IsNotAllocated() const;Returns true if storage is not allocated.