1 #ifndef guard_bounded_reference_allocation_traits_hpp
2 #define guard_bounded_reference_allocation_traits_hpp
6 * @brief Details can be found in the documentation for
7 * TAO::details::generic_sequence
9 * @author Carlos O'Ryan
12 #include "tao/Basic_Types.h"
14 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
21 template<typename T
, class ref_traits
, CORBA::ULong MAX
, bool dummy
>
22 struct bounded_reference_allocation_traits
25 typedef ref_traits reference_traits
;
27 inline static CORBA::ULong
default_maximum()
32 inline static value_type
* default_buffer_allocation()
37 inline static value_type
* allocbuf(CORBA::ULong
/* maximum */)
39 value_type
* buffer
= new value_type
[MAX
];
41 reference_traits::initialize_range(buffer
, buffer
+ MAX
);
46 inline static value_type
* allocbuf_noinit(CORBA::ULong
/* maximum */)
48 value_type
* buffer
= new value_type
[MAX
];
50 reference_traits::zero_range(buffer
, buffer
+ MAX
);
55 inline static void freebuf(value_type
* buffer
)
57 reference_traits::release_range(buffer
, buffer
+ MAX
);
61 inline static CORBA::ULong
maximum()
67 } // namespace details
70 TAO_END_VERSIONED_NAMESPACE_DECL
72 #endif // guard_bounded_reference_allocation_traits_hpp