Public Types | Static Public Member Functions

TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy > Struct Template Reference

#include <Unbounded_Valuetype_Allocation_Traits_T.h>

List of all members.

Public Types

typedef T value_type
typedef ref_traits valuetype_traits

Static Public Member Functions

static CORBA::ULong default_maximum ()
static value_type * default_buffer_allocation ()
static value_type * allocbuf (CORBA::ULong maximum)
static value_type * allocbuf_noinit (CORBA::ULong maximum)
static void freebuf (value_type *buffer)

Detailed Description

template<typename T, class ref_traits, bool dummy>
struct TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >

Definition at line 24 of file Unbounded_Valuetype_Allocation_Traits_T.h.


Member Typedef Documentation

template<typename T , class ref_traits , bool dummy>
typedef T TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >::value_type

Definition at line 26 of file Unbounded_Valuetype_Allocation_Traits_T.h.

template<typename T , class ref_traits , bool dummy>
typedef ref_traits TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >::valuetype_traits

Definition at line 27 of file Unbounded_Valuetype_Allocation_Traits_T.h.


Member Function Documentation

template<typename T , class ref_traits , bool dummy>
static value_type* TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >::allocbuf ( CORBA::ULong  maximum  )  [inline, static]

Definition at line 39 of file Unbounded_Valuetype_Allocation_Traits_T.h.

  {
    value_type * buffer = new value_type[maximum + 1];
    reinterpret_cast<value_type**>(buffer)[0] = buffer + maximum + 1;

    // no throw
    valuetype_traits::initialize_range(buffer + 1, buffer + maximum + 1);

    return buffer + 1;
  }

template<typename T , class ref_traits , bool dummy>
static value_type* TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >::allocbuf_noinit ( CORBA::ULong  maximum  )  [inline, static]

Definition at line 50 of file Unbounded_Valuetype_Allocation_Traits_T.h.

  {
    value_type * buffer = new value_type[maximum + 1];
    reinterpret_cast<value_type**>(buffer)[0] = buffer + maximum + 1;

    // no throw
    valuetype_traits::zero_range(buffer + 1, buffer + maximum + 1);

    return buffer + 1;
  }

template<typename T , class ref_traits , bool dummy>
static value_type* TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >::default_buffer_allocation (  )  [inline, static]

Definition at line 34 of file Unbounded_Valuetype_Allocation_Traits_T.h.

  {
    return 0;
  }

template<typename T , class ref_traits , bool dummy>
static CORBA::ULong TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >::default_maximum (  )  [inline, static]

Definition at line 29 of file Unbounded_Valuetype_Allocation_Traits_T.h.

  {
    return 0;
  }

template<typename T , class ref_traits , bool dummy>
static void TAO::details::unbounded_valuetype_allocation_traits< T, ref_traits, dummy >::freebuf ( value_type *  buffer  )  [inline, static]

Definition at line 61 of file Unbounded_Valuetype_Allocation_Traits_T.h.

  {
    if(buffer != 0)
    {
      value_type * begin = buffer - 1;
      value_type * end = reinterpret_cast<value_type*>(*begin);
      valuetype_traits::release_range(buffer, end);

      buffer = begin;
    }
    delete[] buffer;
  }


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines