AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Types | Public Member Functions | List of all members
drama::sds::ArrayContainer< T > Class Template Reference

Detailed Description

template<typename T>
class drama::sds::ArrayContainer< T >

A container for simple arrays for use with SDS templates.

Some of the drama::sds::Id methods require a container to access simple arrays. In some cases, you may want to access memory created elsewhere and hence can't use a STL container directly.

This template class can be used to wrap access to a C style array so that the drama::sds::Id methods can use it.

Template Parameters
TThe type of the item we are referring to. Must be a POD types, if not, compile will fail with a static assertion.

#include "sds.hh"

Public Types

typedef value_typereference
 The type for a reference to the value.
 
typedef std::size_t size_type
 The type used for sizes.
 
typedefvalue_type
 The value type.
 

Public Member Functions

 ArrayContainer (T *address, size_type size)
 Create a container to access the array.
 
 ~ArrayContainer ()
 Destroy the container, not the underlying array item.
 
bool empty () const
 Returns true if the container is empty.
 
reference operator[] (size_type n)
 Returns an item at a particular address.
 
size_type size () const
 Returns the size of the container in items.
 

The documentation for this class was generated from the following file: