Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Bounded_Value_Allocation_Traits_T.h
blobcb2e8168bddfcf620479a228873087b963fa9ffc
1 #ifndef guard_bounded_value_allocation_traits_hpp
2 #define guard_bounded_value_allocation_traits_hpp
3 /**
4 * @file
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
16 namespace TAO
18 namespace details
20 template<typename T, CORBA::ULong MAX, bool dummy>
21 struct bounded_value_allocation_traits
23 typedef T value_type;
25 inline static CORBA::ULong default_maximum()
27 return MAX;
30 inline static value_type * default_buffer_allocation()
32 return 0;
35 inline static value_type * allocbuf(CORBA::ULong /* maximum */)
37 return new value_type[MAX];
40 inline static value_type * allocbuf_noinit(CORBA::ULong /* maximum */)
42 return new value_type[MAX];
45 inline static void freebuf(value_type * buffer)
47 delete[] buffer;
50 inline static CORBA::ULong maximum()
52 return MAX;
54 /* static CORBA::ULong const MAXIMUM = MAX; */
56 } // namespace details
57 } // namespace TAO
59 TAO_END_VERSIONED_NAMESPACE_DECL
61 #endif // guard_bounded_value_allocation_traits_hpp