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
20 template<typename T
, class ref_traits
, CORBA::ULong MAX
, bool dummy
>
21 struct bounded_reference_allocation_traits
24 typedef ref_traits reference_traits
;
26 inline static CORBA::ULong
default_maximum()
31 inline static value_type
* default_buffer_allocation()
36 inline static value_type
* allocbuf(CORBA::ULong
/* maximum */)
38 value_type
* buffer
= new value_type
[MAX
];
40 reference_traits::initialize_range(buffer
, buffer
+ MAX
);
45 inline static value_type
* allocbuf_noinit(CORBA::ULong
/* maximum */)
47 value_type
* buffer
= new value_type
[MAX
];
49 reference_traits::zero_range(buffer
, buffer
+ MAX
);
54 inline static void freebuf(value_type
* buffer
)
56 reference_traits::release_range(buffer
, buffer
+ MAX
);
60 inline static CORBA::ULong
maximum()
65 } // namespace details
68 TAO_END_VERSIONED_NAMESPACE_DECL
70 #endif // guard_bounded_reference_allocation_traits_hpp