echelon  0.8.0
Classes | Public Types | Public Member Functions | List of all members
echelon::type_layout Class Reference

Description of a compound type's internal structure. More...

#include <type.hpp>

Classes

struct  element
 Tuple containing a name, a type and an offset, which are used to describe a single element of a compound type. More...
 

Public Types

typedef std::vector< element >::const_iterator iterator
 

Public Member Functions

 type_layout (std::size_t size_)
 Constructs an empty layout for a compound type with a given total size. More...
 
void add_element (std::string name, const type &element_type, std::size_t offset)
 Adds a new member to the compound type. More...
 
iterator begin () const
 
iterator end () const
 
std::size_t size () const
 

Detailed Description

Description of a compound type's internal structure.

Member Typedef Documentation

typedef std::vector<element>::const_iterator echelon::type_layout::iterator

Type of an iterator over all members of the compound type.

Constructor & Destructor Documentation

echelon::type_layout::type_layout ( std::size_t  size_)
inlineexplicit

Constructs an empty layout for a compound type with a given total size.

Parameters
size_total size of the compound type in bytes

Member Function Documentation

void echelon::type_layout::add_element ( std::string  name,
const type element_type,
std::size_t  offset 
)
inline

Adds a new member to the compound type.

Parameters
namename of the member
element_typetype of the member
offsetoffset of the member within the compound type in bytes
iterator echelon::type_layout::begin ( ) const
inline

Returns an iterator, which points to the first member within the compound type.

iterator echelon::type_layout::end ( ) const
inline

Returns an iterator, which points beyond the last member within the compound type.

std::size_t echelon::type_layout::size ( ) const
inline

Total size of the compound type in bytes.


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