00001 // -*- c++ -*- 00002 //***************************************************************************** 00013 //***************************************************************************** 00014 00015 #ifndef polybori_orderings_order_traits_h_ 00016 #define polybori_orderings_order_traits_h_ 00017 00018 // include basic definitions 00019 #include <polybori/pbori_defs.h> 00020 00021 // include ordering tags 00022 #include "order_tags.h" 00023 00024 BEGIN_NAMESPACE_PBORI 00025 00026 template <class OrderTag> 00027 struct order_traits_code; 00028 00029 template <> 00030 struct order_traits_code<lex_tag> { enum {order_code = CTypes::lp}; }; 00031 template <> 00032 struct order_traits_code<dlex_tag> { enum {order_code = CTypes::dlex}; }; 00033 template <> 00034 struct order_traits_code<dp_asc_tag> { enum {order_code = CTypes::dp_asc}; }; 00035 template <> 00036 struct order_traits_code<block_dlex_tag> { enum {order_code = CTypes::block_dlex}; }; 00037 template <> 00038 struct order_traits_code<block_dp_asc_tag> { enum {order_code = CTypes::block_dp_asc}; }; 00039 00040 template <class OrderTag> 00041 class order_traits; 00042 00043 template <class BaseOrderTag> 00044 class order_traits<block_tag<BaseOrderTag> > { 00045 public: 00046 enum { order_code = order_traits_code<block_tag<BaseOrderTag> >::order_code, 00047 baseorder_code = order_traits_code<BaseOrderTag>::order_code }; 00048 }; 00049 00050 template <class OrderTag> 00051 class order_traits { 00052 public: 00053 enum { order_code = order_traits_code<OrderTag>::order_code, 00054 baseorder_code = order_code }; 00055 }; 00056 00057 END_NAMESPACE_PBORI 00058 00059 #endif // order_traits_h_