1 #ifndef color__internal_utility_container_empty 2 #define color__internal_utility_container_empty 3 4 // ::color::_internal::utility::container::empty<value_name, length> 5 6 #include "../type/index.hpp" 7 #include "../type/size.hpp" 8 #include "../../../generic/type/nothing.hpp" 9 10 11 12 namespace color 13 { 14 namespace _internal 15 { 16 namespace utility 17 { 18 namespace container 19 { 20 21 template< typename index_name > 22 struct empty 23 { 24 public: 25 typedef index_name index_type; 26 27 typedef ::color::_internal::utility::container::empty< index_name > this_type; 28 29 typedef ::color::type::nothing_type value_type; 30 typedef ::color::type::nothing_type instance_type; 31 32 typedef instance_type const const_type; 33 typedef instance_type const& return_image_type; 34 typedef instance_type & return_type; 35 typedef instance_type & return_original_type; 36 typedef instance_type const& model_type; 37 typedef instance_type & input_type; 38 typedef instance_type & output_type; 39 40 typedef ::color::_internal::utility::type::index< index_name > index_trait_type; 41 42 typedef typename index_trait_type::instance_type index_instance_type; 43 typedef typename index_trait_type::const_type index_const_type; 44 typedef typename index_trait_type::model_type index_input_const_type; 45 typedef typename index_trait_type::return_image_type index_return_image_type; 46 47 typedef ::color::_internal::utility::component::blank<index_type> component_trait_type; 48 49 typedef typename component_trait_type::instance_type component_type; 50 typedef typename component_trait_type::const_type component_const_type; 51 typedef typename component_trait_type::return_image_type component_return_const_type; 52 typedef typename component_trait_type::model_type component_input_const_type; 53 54 typedef ::color::_internal::utility::type::size< std::size_t > size_trait_type; 55 56 typedef typename size_trait_type::return_image_type size_return_image_type; 57 typedef typename size_trait_type::instance_type size_instance_type; 58 59 typedef void set_return_type; 60 61 enum { size_entity = length }; 62 63 initcolor::_internal::utility::container::empty64 static set_return_type init( input_type container, index_input_const_type index, component_input_const_type value ) 65 { 66 this_type::set( container, index, value ); 67 } 68 69 template< index_instance_type index > initcolor::_internal::utility::container::empty70 static set_return_type init( input_type container, component_input_const_type value ) 71 { 72 this_type:: template set<index>( container, value ); 73 } 74 getcolor::_internal::utility::container::empty75 static component_return_const_type get( model_type container, index_input_const_type index ) 76 { 77 static const instance_type s_instance; 78 return s_instance; 79 } 80 81 template< index_instance_type index > getcolor::_internal::utility::container::empty82 static component_return_const_type get( model_type container ) 83 { 84 static const instance_type s_instance; 85 return s_instance; 86 } 87 setcolor::_internal::utility::container::empty88 static set_return_type set( input_type container, index_input_const_type index, component_input_const_type value ) 89 { 90 } 91 92 template< index_instance_type index > setcolor::_internal::utility::container::empty93 static set_return_type set( input_type container, component_input_const_type value ) 94 { 95 } 96 sizecolor::_internal::utility::container::empty97 static /*constexpr*/ size_return_image_type size() 98 { 99 static const size_instance_type local_length = size_entity; 100 return local_length; 101 } 102 }; 103 } 104 } 105 } 106 } 107 108 #endif 109