X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fprevious%2Fsrc%2FASN1%2Fasn%2Fvalue_traits.hpp;fp=e2sim%2Fprevious%2Fsrc%2FASN1%2Fasn%2Fvalue_traits.hpp;h=0000000000000000000000000000000000000000;hp=4b67374f78492703ee9a0a1a73a2c4955bcd1e2d;hb=f86662b5b6481f27e18313a36355871f3a947193;hpb=a9f02a2b5886990fd81e64f7c218c5d4844f18a3 diff --git a/e2sim/previous/src/ASN1/asn/value_traits.hpp b/e2sim/previous/src/ASN1/asn/value_traits.hpp deleted file mode 100755 index 4b67374..0000000 --- a/e2sim/previous/src/ASN1/asn/value_traits.hpp +++ /dev/null @@ -1,187 +0,0 @@ -#ifndef _STDEX_VALUE_TRAITS_HPP_INCLUDED_ -#define _STDEX_VALUE_TRAITS_HPP_INCLUDED_ - -/****************************************************************************** -* -* Copyright (c) 2019 AT&T Intellectual Property. -* Copyright (c) 2018-2019 Nokia. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -******************************************************************************/ - -#include -#include -#include -#include -#include - -#include "type_defs.h" - -namespace stdex { -namespace value { - -namespace mpl = boost::mpl; - -//NOTE! length is in bits -typedef mpl::int_<8> _8; -typedef mpl::int_<16> _16; -typedef mpl::int_<24> _24; -typedef mpl::int_<32> _32; -typedef mpl::int_<40> _40; -typedef mpl::int_<48> _48; -typedef mpl::int_<56> _56; -typedef mpl::int_<64> _64; - -template -struct bits_to_bytes : mpl::int_< (num_bits + 7) / 8 > {}; - -/****************************************************************************** -* Class: value::traits -* Description: select min integer type to fit LEN bits -* Notes: LEN is positive integer type (mpl::int_) = number of bits -******************************************************************************/ -template struct traits; - -template -struct traits - >::type -> -{ - typedef _8 value_length; - typedef u8 value_type; - typedef value_type param_type; -}; - -template -struct traits, mpl::less_equal > - >::type -> -{ - typedef _16 value_length; - typedef u16 value_type; - typedef value_type param_type; -}; - -template -struct traits, mpl::less_equal > - >::type -> -{ - typedef _24 value_length; - typedef u32 value_type; - typedef value_type param_type; -}; - -template -struct traits, mpl::less_equal > - >::type -> -{ - typedef _32 value_length; - typedef u32 value_type; - typedef value_type param_type; -}; - -template -struct traits, mpl::less_equal > - >::type -> -{ - typedef _40 value_length; - typedef u64 value_type; - typedef value_type param_type; -}; - -template -struct traits, mpl::less_equal > - >::type -> -{ - typedef _48 value_length; - typedef u64 value_type; - typedef value_type param_type; -}; - -template -struct traits, mpl::less_equal > - >::type -> -{ - typedef _56 value_length; - typedef u64 value_type; - typedef value_type param_type; -}; - -template -struct traits, mpl::less_equal > - >::type -> -{ - typedef _64 value_length; - typedef u64 value_type; - typedef value_type param_type; -}; - -template -struct traits - >::type -> -{ - typedef LEN value_length; - struct value_type {u8 value[bits_to_bytes::value];}; - typedef value_type const& param_type; -}; - - -//template -//struct traits -// >::type -//> -//{ -// typedef LEN value_length; -// struct value_type {unsigned char value[LEN::value/8];}; -// typedef value_type const& param_type; -// -//}; - -/****************************************************************************** -* Class: value::traits_c -* Description: select min integer type to fit BITS bits -* Notes: N is positive integer value = number of bits -******************************************************************************/ -template -struct traits_c : traits > -{ -}; - -} //end: namespace value - -} //end: namespace stdex - -#ifdef _MSC_VER -#pragma component( mintypeinfo, off ) -#endif - -#endif //_STDEX_VALUE_TRAITS_HPP_INCLUDED_