Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / Bounded_Array_Allocation_Traits_T.h
blob55ee5250321ffa7a15208e1a96028338c433f24b
1 #ifndef guard_bounded_array_allocation_traits_hpp
2 #define guard_bounded_array_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_array_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 } // namespace details
51 } // namespace TAO
54 TAO_END_VERSIONED_NAMESPACE_DECL
56 #endif // guard_unbounded_array_allocation_traits_hpp