Initial Commit

This commit is contained in:
Jordan Sherer
2018-02-08 21:28:33 -05:00
commit 678c1d3966
14352 changed files with 3176737 additions and 0 deletions
@@ -0,0 +1,27 @@
/*==============================================================================
Copyright (c) 2005-2010 Joel de Guzman
Copyright (c) 2010 Thomas Heller
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_PHOENIX_CORE_TERMINAL_FWD_HPP
#define BOOST_PHOENIX_CORE_TERMINAL_FWD_HPP
namespace boost { namespace phoenix
{
namespace rule
{
struct argument;
struct custom_terminal;
struct terminal;
}
template <typename T, typename Dummy = void>
struct is_custom_terminal;
template <typename T, typename Dummy = void>
struct custom_terminal;
}}
#endif
@@ -0,0 +1,829 @@
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/vector/vector10.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template< typename V >
struct v_at< V,0 >
{
typedef typename V::item0 type;
};
template<
typename T0
>
struct vector1
{
typedef aux::vector_tag<1> tag;
typedef vector1 type;
typedef T0 item0;
typedef void_ item1;
typedef T0 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,1 > end;
};
template<>
struct push_front_impl< aux::vector_tag<0> >
{
template< typename Vector, typename T > struct apply
{
typedef vector1<
T
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
{
typedef vector0<
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<0> >
{
template< typename Vector, typename T > struct apply
{
typedef vector1<
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<1> >
{
template< typename Vector > struct apply
{
typedef vector0<
> type;
};
};
template< typename V >
struct v_at< V,1 >
{
typedef typename V::item1 type;
};
template<
typename T0, typename T1
>
struct vector2
{
typedef aux::vector_tag<2> tag;
typedef vector2 type;
typedef T0 item0;
typedef T1 item1;
typedef void_ item2;
typedef T1 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,2 > end;
};
template<>
struct push_front_impl< aux::vector_tag<1> >
{
template< typename Vector, typename T > struct apply
{
typedef vector2<
T
,
typename Vector::item0
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
{
typedef vector1<
typename Vector::item1
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<1> >
{
template< typename Vector, typename T > struct apply
{
typedef vector2<
typename Vector::item0
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<2> >
{
template< typename Vector > struct apply
{
typedef vector1<
typename Vector::item0
> type;
};
};
template< typename V >
struct v_at< V,2 >
{
typedef typename V::item2 type;
};
template<
typename T0, typename T1, typename T2
>
struct vector3
{
typedef aux::vector_tag<3> tag;
typedef vector3 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef void_ item3;
typedef T2 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,3 > end;
};
template<>
struct push_front_impl< aux::vector_tag<2> >
{
template< typename Vector, typename T > struct apply
{
typedef vector3<
T
,
typename Vector::item0, typename Vector::item1
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
{
typedef vector2<
typename Vector::item1, typename Vector::item2
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<2> >
{
template< typename Vector, typename T > struct apply
{
typedef vector3<
typename Vector::item0, typename Vector::item1
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<3> >
{
template< typename Vector > struct apply
{
typedef vector2<
typename Vector::item0, typename Vector::item1
> type;
};
};
template< typename V >
struct v_at< V,3 >
{
typedef typename V::item3 type;
};
template<
typename T0, typename T1, typename T2, typename T3
>
struct vector4
{
typedef aux::vector_tag<4> tag;
typedef vector4 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef void_ item4;
typedef T3 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,4 > end;
};
template<>
struct push_front_impl< aux::vector_tag<3> >
{
template< typename Vector, typename T > struct apply
{
typedef vector4<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
{
typedef vector3<
typename Vector::item1, typename Vector::item2
, typename Vector::item3
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<3> >
{
template< typename Vector, typename T > struct apply
{
typedef vector4<
typename Vector::item0, typename Vector::item1
, typename Vector::item2
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<4> >
{
template< typename Vector > struct apply
{
typedef vector3<
typename Vector::item0, typename Vector::item1
, typename Vector::item2
> type;
};
};
template< typename V >
struct v_at< V,4 >
{
typedef typename V::item4 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
>
struct vector5
{
typedef aux::vector_tag<5> tag;
typedef vector5 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef void_ item5;
typedef T4 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,5 > end;
};
template<>
struct push_front_impl< aux::vector_tag<4> >
{
template< typename Vector, typename T > struct apply
{
typedef vector5<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
{
typedef vector4<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<4> >
{
template< typename Vector, typename T > struct apply
{
typedef vector5<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<5> >
{
template< typename Vector > struct apply
{
typedef vector4<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
> type;
};
};
template< typename V >
struct v_at< V,5 >
{
typedef typename V::item5 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5
>
struct vector6
{
typedef aux::vector_tag<6> tag;
typedef vector6 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef void_ item6;
typedef T5 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,6 > end;
};
template<>
struct push_front_impl< aux::vector_tag<5> >
{
template< typename Vector, typename T > struct apply
{
typedef vector6<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
{
typedef vector5<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<5> >
{
template< typename Vector, typename T > struct apply
{
typedef vector6<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<6> >
{
template< typename Vector > struct apply
{
typedef vector5<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4
> type;
};
};
template< typename V >
struct v_at< V,6 >
{
typedef typename V::item6 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6
>
struct vector7
{
typedef aux::vector_tag<7> tag;
typedef vector7 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef void_ item7;
typedef T6 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,7 > end;
};
template<>
struct push_front_impl< aux::vector_tag<6> >
{
template< typename Vector, typename T > struct apply
{
typedef vector7<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
{
typedef vector6<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<6> >
{
template< typename Vector, typename T > struct apply
{
typedef vector7<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<7> >
{
template< typename Vector > struct apply
{
typedef vector6<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
> type;
};
};
template< typename V >
struct v_at< V,7 >
{
typedef typename V::item7 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7
>
struct vector8
{
typedef aux::vector_tag<8> tag;
typedef vector8 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef T7 item7;
typedef void_ item8;
typedef T7 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,8 > end;
};
template<>
struct push_front_impl< aux::vector_tag<7> >
{
template< typename Vector, typename T > struct apply
{
typedef vector8<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
{
typedef vector7<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
, typename Vector::item7
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<7> >
{
template< typename Vector, typename T > struct apply
{
typedef vector8<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<8> >
{
template< typename Vector > struct apply
{
typedef vector7<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6
> type;
};
};
template< typename V >
struct v_at< V,8 >
{
typedef typename V::item8 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8
>
struct vector9
{
typedef aux::vector_tag<9> tag;
typedef vector9 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef T7 item7;
typedef T8 item8;
typedef void_ item9;
typedef T8 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,9 > end;
};
template<>
struct push_front_impl< aux::vector_tag<8> >
{
template< typename Vector, typename T > struct apply
{
typedef vector9<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
{
typedef vector8<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
, typename Vector::item7, typename Vector::item8
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<8> >
{
template< typename Vector, typename T > struct apply
{
typedef vector9<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<9> >
{
template< typename Vector > struct apply
{
typedef vector8<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
> type;
};
};
template< typename V >
struct v_at< V,9 >
{
typedef typename V::item9 type;
};
template<
typename T0, typename T1, typename T2, typename T3, typename T4
, typename T5, typename T6, typename T7, typename T8, typename T9
>
struct vector10
{
typedef aux::vector_tag<10> tag;
typedef vector10 type;
typedef T0 item0;
typedef T1 item1;
typedef T2 item2;
typedef T3 item3;
typedef T4 item4;
typedef T5 item5;
typedef T6 item6;
typedef T7 item7;
typedef T8 item8;
typedef T9 item9;
typedef void_ item10;
typedef T9 back;
typedef v_iter< type,0 > begin;
typedef v_iter< type,10 > end;
};
template<>
struct push_front_impl< aux::vector_tag<9> >
{
template< typename Vector, typename T > struct apply
{
typedef vector10<
T
,
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
, typename Vector::item8
> type;
};
};
template<>
struct pop_front_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
{
typedef vector9<
typename Vector::item1, typename Vector::item2
, typename Vector::item3, typename Vector::item4
, typename Vector::item5, typename Vector::item6
, typename Vector::item7, typename Vector::item8
, typename Vector::item9
> type;
};
};
template<>
struct push_back_impl< aux::vector_tag<9> >
{
template< typename Vector, typename T > struct apply
{
typedef vector10<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
, typename Vector::item8
,
T
> type;
};
};
template<>
struct pop_back_impl< aux::vector_tag<10> >
{
template< typename Vector > struct apply
{
typedef vector9<
typename Vector::item0, typename Vector::item1
, typename Vector::item2, typename Vector::item3
, typename Vector::item4, typename Vector::item5
, typename Vector::item6, typename Vector::item7
, typename Vector::item8
> type;
};
};
template< typename V >
struct v_at< V,10 >
{
typedef typename V::item10 type;
};
}}
@@ -0,0 +1,188 @@
#include "decodedtext.h"
#include <QStringList>
#include <QRegularExpression>
QString DecodedText::CQersCall()
{
// extract the CQer's call TODO: does this work with all call formats?
int s1 {0};
int position;
QString t=_string;
if ((position = _string.indexOf (" CQ DX ")) >= 0)
{
s1 = 7 + position;
}
else if ((position = _string.indexOf (" CQDX ")) >= 0)
{
s1 = 6 + position;
}
else if ((position = _string.indexOf (" CQ ")) >= 0)
{
s1 = 4 + position;
if(_string.mid(s1,3).toInt() > 0 and _string.mid(s1,3).toInt() <= 999) s1 += 4;
}
else if ((position = _string.indexOf (" DE ")) >= 0)
{
s1 = 4 + position;
}
else if ((position = _string.indexOf (" QRZ ")) >= 0)
{
s1 = 5 + position;
}
auto s2 = _string.indexOf (" ", s1);
return _string.mid (s1, s2 - s1);
}
bool DecodedText::isJT65()
{
return _string.indexOf("#") == column_mode;
}
bool DecodedText::isJT9()
{
return _string.indexOf("@") == column_mode;
}
bool DecodedText::isTX()
{
int i = _string.indexOf("Tx");
return (i >= 0 && i < 15); // TODO guessing those numbers. Does Tx ever move?
}
int DecodedText::frequencyOffset()
{
return _string.mid(column_freq,4).toInt();
}
int DecodedText::snr()
{
int i1=_string.indexOf(" ")+1;
return _string.mid(i1,3).toInt();
}
float DecodedText::dt()
{
return _string.mid(column_dt,5).toFloat();
}
/*
2343 -11 0.8 1259 # YV6BFE F6GUU R-08
2343 -19 0.3 718 # VE6WQ SQ2NIJ -14
2343 -7 0.3 815 # KK4DSD W7VP -16
2343 -13 0.1 3627 @ CT1FBK IK5YZT R+02
0605 Tx 1259 # CQ VK3ACF QF22
*/
// find and extract any report. Returns true if this is a standard message
bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, /*mod*/QString& report)
{
QString msg=_string.mid(column_qsoText).trimmed();
if(msg.length() < 1) return false;
msg = msg.remove (QRegularExpression {"[<>]"});
int i1=msg.indexOf('\r');
if (i1>0)
msg=msg.left (i1-1);
bool b = stdmsg_ ((msg + " ").toLatin1().constData(),22); // stdmsg is a fortran routine that packs the text, unpacks it and compares the result
QStringList w=msg.split(" ",QString::SkipEmptyParts);
if(w.size ()
&& b && (w[0] == myBaseCall
|| w[0].endsWith ("/" + myBaseCall)
|| w[0].startsWith (myBaseCall + "/")
|| (w.size () > 1 && !dxBaseCall.isEmpty ()
&& (w[1] == dxBaseCall
|| w[1].endsWith ("/" + dxBaseCall)
|| w[1].startsWith (dxBaseCall + "/")))))
{
QString tt="";
if(w.size() > 2) tt=w[2];
bool ok;
i1=tt.toInt(&ok);
if (ok and i1>=-50 and i1<50)
{
report = tt;
}
else
{
if (tt.mid(0,1)=="R")
{
i1=tt.mid(1).toInt(&ok);
if(ok and i1>=-50 and i1<50)
{
report = tt.mid(1);
}
}
}
}
return b;
}
// get the first text word, usually the call
QString DecodedText::call()
{
auto call = _string;
call = call.replace (QRegularExpression {" CQ ([A-Z]{2,2}|[0-9]{3,3}) "}, " CQ_\\1 ").mid (column_qsoText);
int i = call.indexOf(" ");
return call.mid(0,i);
}
// get the second word, most likely the de call and the third word, most likely grid
void DecodedText::deCallAndGrid(/*out*/QString& call, QString& grid)
{
auto msg = _string;
if(msg.mid(4,1)!=" ") msg=msg.mid(0,4)+msg.mid(6,-1); //Remove seconds from UTC
msg = msg.replace (QRegularExpression {" CQ ([A-Z]{2,2}|[0-9]{3,3}) "}, " CQ_\\1 ").mid (column_qsoText);
int i1 = msg.indexOf (" ");
call = msg.mid (i1 + 1);
int i2 = call.indexOf (" ");
if (" R " == call.mid (i2, 3)) // MSK144 contest mode report
{
grid = call.mid (i2 + 3, 4);
}
else
{
grid = call.mid (i2 + 1, 4);
}
call = call.left (i2).replace (">", "");
}
int DecodedText::timeInSeconds()
{
return 60*_string.mid(column_time,2).toInt() + _string.mid(2,2).toInt();
}
/*
2343 -11 0.8 1259 # YV6BFE F6GUU R-08
2343 -19 0.3 718 # VE6WQ SQ2NIJ -14
2343 -7 0.3 815 # KK4DSD W7VP -16
2343 -13 0.1 3627 @ CT1FBK IK5YZT R+02
0605 Tx 1259 # CQ VK3ACF QF22
*/
QString DecodedText::report() // returns a string of the SNR field with a leading + or - followed by two digits
{
int sr = snr();
if (sr<-50)
sr = -50;
else
if (sr > 49)
sr = 49;
QString rpt;
rpt.sprintf("%d",abs(sr));
if (sr > 9)
rpt = "+" + rpt;
else
if (sr >= 0)
rpt = "+0" + rpt;
else
if (sr >= -9)
rpt = "-0" + rpt;
else
rpt = "-" + rpt;
return rpt;
}
@@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_EQUAL_TO_IMPL_05052005_1215)
#define FUSION_EQUAL_TO_IMPL_05052005_1215
#include <boost/fusion/support/config.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/and.hpp>
namespace boost { namespace fusion
{
struct vector_iterator_tag;
namespace extension
{
template <typename Tag>
struct equal_to_impl;
template <>
struct equal_to_impl<vector_iterator_tag>
{
template <typename I1, typename I2>
struct apply
: is_same<
typename I1::identity
, typename I2::identity
>
{
};
};
}
}}
#endif
@@ -0,0 +1,49 @@
// Copyright (C) 2013 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// 2013/10 Vicente J. Botet Escriba
// Creation.
#ifndef BOOST_CSBL_TUPLE_HPP
#define BOOST_CSBL_TUPLE_HPP
#include <boost/config.hpp>
#if defined BOOST_THREAD_USES_BOOST_TUPLE || defined BOOST_NO_CXX11_HDR_TUPLE || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#include <boost/tuple/tuple.hpp>
#ifndef BOOST_THREAD_USES_BOOST_TUPLE
#define BOOST_THREAD_USES_BOOST_TUPLE
#endif
#else
#include <tuple>
#endif
namespace boost
{
namespace csbl
{
#if defined BOOST_THREAD_USES_BOOST_TUPLE
using ::boost::tuple;
using ::boost::get;
using ::boost::make_tuple;
//using ::boost::tuple_size;
#else
// 20.4.2, class template tuple:
using ::std::tuple;
using ::std::get;
using ::std::make_tuple;
using ::std::tuple_size;
// 20.4.2.4, tuple creation functions:
// 20.4.2.5, tuple helper classes:
// 20.4.2.6, element access:
// 20.4.2.7, relational operators:
// 20.4.2.8, allocator-related traits
// 20.4.2.9, specialized algorithms:
#endif
}
}
#endif // header
@@ -0,0 +1,73 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
#include <cstddef> // size_t
#include <boost/type_traits/intrinsics.hpp>
#include <boost/type_traits/integral_constant.hpp>
#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR
#if defined(BOOST_MSVC) || defined(BOOST_INTEL)
#include <boost/type_traits/has_trivial_constructor.hpp>
#endif
#if defined(__GNUC__ ) || defined(__SUNPRO_CC) || defined(__clang__)
#include <boost/type_traits/is_default_constructible.hpp>
#endif
namespace boost {
template <class T> struct has_nothrow_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_CONSTRUCTOR(T)>{};
#elif !defined(BOOST_NO_CXX11_NOEXCEPT)
#include <boost/type_traits/is_default_constructible.hpp>
#include <boost/type_traits/remove_all_extents.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4197) // top-level volatile in cast is ignored
#endif
namespace boost { namespace detail{
template <class T, bool b> struct has_nothrow_constructor_imp : public boost::integral_constant<bool, false>{};
template <class T> struct has_nothrow_constructor_imp<T, true> : public boost::integral_constant<bool, noexcept(T())>{};
template <class T, std::size_t N> struct has_nothrow_constructor_imp<T[N], true> : public has_nothrow_constructor_imp<T, true> {};
}
template <class T> struct has_nothrow_constructor : public detail::has_nothrow_constructor_imp<T, is_default_constructible<T>::value>{};
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
#else
#include <boost/type_traits/has_trivial_constructor.hpp>
namespace boost {
template <class T> struct has_nothrow_constructor : public ::boost::has_trivial_constructor<T> {};
#endif
template<> struct has_nothrow_constructor<void> : public false_type {};
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
template<> struct has_nothrow_constructor<void const> : public false_type{};
template<> struct has_nothrow_constructor<void const volatile> : public false_type{};
template<> struct has_nothrow_constructor<void volatile> : public false_type{};
#endif
template <class T> struct has_nothrow_default_constructor : public has_nothrow_constructor<T>{};
} // namespace boost
#endif // BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
@@ -0,0 +1,162 @@
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2012-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP
#define BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
#include <boost/container/allocator_traits.hpp> //allocator_traits
#include <boost/container/throw_exception.hpp>
#include <boost/container/detail/multiallocation_chain.hpp> //multiallocation_chain
#include <boost/container/detail/version_type.hpp> //version_type
#include <boost/container/detail/allocation_type.hpp> //allocation_type
#include <boost/container/detail/mpl.hpp> //integral_constant
#include <boost/intrusive/pointer_traits.hpp> //pointer_traits
#include <boost/core/no_exceptions_support.hpp> //BOOST_TRY
namespace boost {
namespace container {
namespace container_detail {
template<class Allocator, unsigned Version = boost::container::container_detail::version<Allocator>::value>
struct allocator_version_traits
{
typedef ::boost::container::container_detail::integral_constant
<unsigned, Version> alloc_version;
typedef typename Allocator::multiallocation_chain multiallocation_chain;
typedef typename boost::container::allocator_traits<Allocator>::pointer pointer;
typedef typename boost::container::allocator_traits<Allocator>::size_type size_type;
//Node allocation interface
static pointer allocate_one(Allocator &a)
{ return a.allocate_one(); }
static void deallocate_one(Allocator &a, const pointer &p)
{ a.deallocate_one(p); }
static void allocate_individual(Allocator &a, size_type n, multiallocation_chain &m)
{ return a.allocate_individual(n, m); }
static void deallocate_individual(Allocator &a, multiallocation_chain &holder)
{ a.deallocate_individual(holder); }
static pointer allocation_command(Allocator &a, allocation_type command,
size_type limit_size, size_type &prefer_in_recvd_out_size, pointer &reuse)
{ return a.allocation_command(command, limit_size, prefer_in_recvd_out_size, reuse); }
};
template<class Allocator>
struct allocator_version_traits<Allocator, 1>
{
typedef ::boost::container::container_detail::integral_constant
<unsigned, 1> alloc_version;
typedef typename boost::container::allocator_traits<Allocator>::pointer pointer;
typedef typename boost::container::allocator_traits<Allocator>::size_type size_type;
typedef typename boost::container::allocator_traits<Allocator>::value_type value_type;
typedef typename boost::intrusive::pointer_traits<pointer>::
template rebind_pointer<void>::type void_ptr;
typedef container_detail::basic_multiallocation_chain
<void_ptr> multialloc_cached_counted;
typedef boost::container::container_detail::
transform_multiallocation_chain
< multialloc_cached_counted, value_type> multiallocation_chain;
//Node allocation interface
static pointer allocate_one(Allocator &a)
{ return a.allocate(1); }
static void deallocate_one(Allocator &a, const pointer &p)
{ a.deallocate(p, 1); }
static void deallocate_individual(Allocator &a, multiallocation_chain &holder)
{
size_type n = holder.size();
typename multiallocation_chain::iterator it = holder.begin();
while(n--){
pointer p = boost::intrusive::pointer_traits<pointer>::pointer_to(*it);
++it;
a.deallocate(p, 1);
}
}
struct allocate_individual_rollback
{
allocate_individual_rollback(Allocator &a, multiallocation_chain &chain)
: mr_a(a), mp_chain(&chain)
{}
~allocate_individual_rollback()
{
if(mp_chain)
allocator_version_traits::deallocate_individual(mr_a, *mp_chain);
}
void release()
{
mp_chain = 0;
}
Allocator &mr_a;
multiallocation_chain * mp_chain;
};
static void allocate_individual(Allocator &a, size_type n, multiallocation_chain &m)
{
allocate_individual_rollback rollback(a, m);
while(n--){
m.push_front(a.allocate(1));
}
rollback.release();
}
static pointer allocation_command(Allocator &a, allocation_type command,
size_type, size_type &prefer_in_recvd_out_size, pointer &reuse)
{
pointer ret = pointer();
if(BOOST_UNLIKELY(!(command & allocate_new) && !(command & nothrow_allocation))){
throw_logic_error("version 1 allocator without allocate_new flag");
}
else{
BOOST_TRY{
ret = a.allocate(prefer_in_recvd_out_size);
}
BOOST_CATCH(...){
if(!(command & nothrow_allocation)){
BOOST_RETHROW
}
}
BOOST_CATCH_END
reuse = pointer();
}
return ret;
}
};
} //namespace container_detail {
} //namespace container {
} //namespace boost {
#include <boost/container/detail/config_end.hpp>
#endif // ! defined(BOOST_CONTAINER_DETAIL_ALLOCATOR_VERSION_TRAITS_HPP)
@@ -0,0 +1,67 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_REVERSE_VIEW_ITERATOR_07202005_0835)
#define FUSION_REVERSE_VIEW_ITERATOR_07202005_0835
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/iterator_base.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/iterator/mpl/convert_iterator.hpp>
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
#include <boost/fusion/view/reverse_view/detail/deref_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/next_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/prior_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/advance_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/distance_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/value_of_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/deref_data_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp>
#include <boost/fusion/view/reverse_view/detail/key_of_impl.hpp>
#include <boost/type_traits/is_base_of.hpp>
#include <boost/static_assert.hpp>
namespace boost { namespace fusion
{
struct reverse_view_iterator_tag;
template <typename First>
struct reverse_view_iterator
: iterator_base<reverse_view_iterator<First> >
{
typedef convert_iterator<First> converter;
typedef typename converter::type first_type;
typedef reverse_view_iterator_tag fusion_tag;
typedef typename traits::category_of<first_type>::type category;
BOOST_STATIC_ASSERT((
is_base_of<
bidirectional_traversal_tag
, category>::value));
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
reverse_view_iterator(First const& in_first)
: first(converter::call(in_first)) {}
first_type first;
private:
// silence MSVC warning C4512: assignment operator could not be generated
reverse_view_iterator& operator= (reverse_view_iterator const&);
};
}}
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
namespace std
{
template <typename First>
struct iterator_traits< ::boost::fusion::reverse_view_iterator<First> >
{ };
}
#endif
#endif
@@ -0,0 +1,59 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt
Copyright (c) 2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
#define BOOST_FUSION_ALGORITHM_ITERATION_FOLD_HPP
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/algorithm/iteration/fold_fwd.hpp>
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/support/is_segmented.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/type_traits/add_reference.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/fold.hpp")
#endif
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden
Copyright (c) 2009-2010 Christopher Schmidt
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#include <boost/fusion/algorithm/iteration/detail/fold.hpp>
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#include <boost/fusion/algorithm/iteration/detail/segmented_fold.hpp>
#endif
@@ -0,0 +1,33 @@
/*=============================================================================
Copyright (c) 2011 Eric Niebler
Copyright (c) 2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED)
#define BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename State, typename F>
struct accumulate;
}
template <typename Sequence, typename State, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::accumulate<Sequence, State const, F>::type
accumulate(Sequence& seq, State const& state, F f);
template <typename Sequence, typename State, typename F>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::accumulate<Sequence const, State const, F>::type
accumulate(Sequence const& seq, State const& state, F f);
}}
#endif
@@ -0,0 +1,138 @@
// (C) Copyright John Maddock 2007.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// This file is machine generated, do not edit by hand
// Polynomial evaluation using Horners rule
#ifndef BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
#define BOOST_MATH_TOOLS_POLY_EVAL_19_HPP
namespace boost{ namespace math{ namespace tools{ namespace detail{
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T*, const V&, const mpl::int_<0>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(0);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V&, const mpl::int_<1>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<2>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(a[1] * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<3>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((a[2] * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<4>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((a[3] * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<5>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((a[4] * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<6>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((((a[5] * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<7>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((((a[6] * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<8>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((((((a[7] * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<9>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((((((a[8] * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<10>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((((((((a[9] * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<11>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((((((((a[10] * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<12>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((((((((((a[11] * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<13>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((((((((((a[12] * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<14>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((((((((((((a[13] * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<15>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((((((((((((a[14] * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<16>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((((((((((((((a[15] * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<17>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((((((((((((((a[16] * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<18>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>(((((((((((((((((a[17] * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
template <class T, class V>
inline V evaluate_polynomial_c_imp(const T* a, const V& x, const mpl::int_<19>*) BOOST_MATH_NOEXCEPT(V)
{
return static_cast<V>((((((((((((((((((a[18] * x + a[17]) * x + a[16]) * x + a[15]) * x + a[14]) * x + a[13]) * x + a[12]) * x + a[11]) * x + a[10]) * x + a[9]) * x + a[8]) * x + a[7]) * x + a[6]) * x + a[5]) * x + a[4]) * x + a[3]) * x + a[2]) * x + a[1]) * x + a[0]);
}
}}}} // namespaces
#endif // include guard
@@ -0,0 +1,142 @@
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/bitor.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
>
struct bitor_impl
: if_c<
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
)
, aux::cast2nd_impl< bitor_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< bitor_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct bitor_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct bitor_impl< na,Tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename Tag > struct bitor_impl< Tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct bitor_tag
{
typedef typename T::tag type;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
, typename N3 = na, typename N4 = na, typename N5 = na
>
struct bitor_
: bitor_< bitor_< bitor_< bitor_< N1,N2 >, N3>, N4>, N5>
{
};
template<
typename N1, typename N2, typename N3, typename N4
>
struct bitor_< N1,N2,N3,N4,na >
: bitor_< bitor_< bitor_< N1,N2 >, N3>, N4>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, bitor_
, ( N1, N2, N3, N4, na )
)
};
template<
typename N1, typename N2, typename N3
>
struct bitor_< N1,N2,N3,na,na >
: bitor_< bitor_< N1,N2 >, N3>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, bitor_
, ( N1, N2, N3, na, na )
)
};
template<
typename N1, typename N2
>
struct bitor_< N1,N2,na,na,na >
: bitor_impl<
typename bitor_tag<N1>::type
, typename bitor_tag<N2>::type
>::template apply< N1,N2 >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
5
, bitor_
, ( N1, N2, na, na, na )
)
};
BOOST_MPL_AUX_NA_SPEC2(2, 5, bitor_)
}}
namespace boost { namespace mpl {
template<>
struct bitor_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
: integral_c<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
| BOOST_MPL_AUX_VALUE_WKND(N2)::value
)
>
{
};
};
}}
@@ -0,0 +1,76 @@
// Copyright Neil Groves 2010. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
//
// For more information, see http://www.boost.org/libs/range/
//
#ifndef BOOST_RANGE_COUNTING_RANGE_HPP_INCLUDED
#define BOOST_RANGE_COUNTING_RANGE_HPP_INCLUDED
#include <boost/config.hpp>
#if BOOST_MSVC >= 1400
#pragma warning(push)
#pragma warning(disable : 4244)
#endif
#include <boost/range/iterator_range_core.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/iterator.hpp>
#include <boost/iterator/counting_iterator.hpp>
namespace boost
{
template<class Value>
inline iterator_range<counting_iterator<Value> >
counting_range(Value first, Value last)
{
typedef counting_iterator<Value> counting_iterator_t;
typedef iterator_range<counting_iterator_t> result_t;
return result_t(counting_iterator_t(first),
counting_iterator_t(last));
}
template<class Range>
inline iterator_range<
counting_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<const Range>::type
>
>
counting_range(const Range& rng)
{
typedef counting_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<const Range>::type
> counting_iterator_t;
typedef iterator_range<counting_iterator_t> result_t;
return result_t(counting_iterator_t(boost::begin(rng)),
counting_iterator_t(boost::end(rng)));
}
template<class Range>
inline iterator_range<
counting_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<Range>::type
>
>
counting_range(Range& rng)
{
typedef counting_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<Range>::type
> counting_iterator_t;
typedef iterator_range<counting_iterator_t> result_t;
return result_t(counting_iterator_t(boost::begin(rng)),
counting_iterator_t(boost::end(rng)));
}
} // namespace boost
#if BOOST_MSVC >= 1400
#pragma warning(pop)
#endif
#endif // include guard
@@ -0,0 +1,213 @@
// Copyright (C) 2004-2006 The Trustees of Indiana University.
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Authors: Douglas Gregor
// Andrew Lumsdaine
//
// Distributed graph concepts and helpers
//
#ifndef BOOST_GRAPH_DISTRIBUTED_CONCEPTS_HPP
#define BOOST_GRAPH_DISTRIBUTED_CONCEPTS_HPP
#ifndef BOOST_GRAPH_USE_MPI
#error "Parallel BGL files should not be included unless <boost/graph/use_mpi.hpp> has been included"
#endif
#include <boost/version.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_concepts.hpp>
#include <boost/concept/assert.hpp>
#if BOOST_VERSION >= 103500
# include <boost/concept/detail/concept_def.hpp>
#endif
namespace boost {
#if BOOST_VERSION >= 103500
namespace concepts {
#endif
#if BOOST_VERSION < 103500
template <class G>
struct DistributedVertexListGraphConcept
{
typedef typename graph_traits<G>::vertex_iterator vertex_iterator;
typedef typename graph_traits<G>::vertices_size_type vertices_size_type;
typedef typename graph_traits<G>::traversal_category
traversal_category;
void constraints() {
BOOST_CONCEPT_ASSERT(( GraphConcept<G> ));
BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<vertex_iterator> ));
BOOST_CONCEPT_ASSERT(( ConvertibleConcept<traversal_category,
distributed_vertex_list_graph_tag> ));
#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
// dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
// you want to use vector_as_graph, it is! I'm sure the graph
// library leaves these out all over the place. Probably a
// redesign involving specializing a template with a static
// member function is in order :(
using boost::vertices;
#endif
p = vertices(g);
v = *p.first;
const_constraints(g);
}
void const_constraints(const G& cg) {
#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
// dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
// you want to use vector_as_graph, it is! I'm sure the graph
// library leaves these out all over the place. Probably a
// redesign involving specializing a template with a static
// member function is in order :(
using boost::vertices;
#endif
p = vertices(cg);
v = *p.first;
V = num_vertices(cg);
}
std::pair<vertex_iterator,vertex_iterator> p;
typename graph_traits<G>::vertex_descriptor v;
G g;
vertices_size_type V;
};
template <class G>
struct DistributedEdgeListGraphConcept
{
typedef typename graph_traits<G>::edge_descriptor edge_descriptor;
typedef typename graph_traits<G>::edge_iterator edge_iterator;
typedef typename graph_traits<G>::edges_size_type edges_size_type;
typedef typename graph_traits<G>::traversal_category
traversal_category;
void constraints() {
BOOST_CONCEPT_ASSERT(( GraphConcept<G> ));
BOOST_CONCEPT_ASSERT(( MultiPassInputIteratorConcept<edge_iterator> ));
BOOST_CONCEPT_ASSERT(( DefaultConstructibleConcept<edge_descriptor> ));
BOOST_CONCEPT_ASSERT(( EqualityComparableConcept<edge_descriptor> ));
BOOST_CONCEPT_ASSERT(( AssignableConcept<edge_descriptor> ));
BOOST_CONCEPT_ASSERT(( ConvertibleConcept<traversal_category,
distributed_edge_list_graph_tag> ));
p = edges(g);
e = *p.first;
u = source(e, g);
v = target(e, g);
const_constraints(g);
}
void const_constraints(const G& cg) {
p = edges(cg);
E = num_edges(cg);
e = *p.first;
u = source(e, cg);
v = target(e, cg);
}
std::pair<edge_iterator,edge_iterator> p;
typename graph_traits<G>::vertex_descriptor u, v;
typename graph_traits<G>::edge_descriptor e;
edges_size_type E;
G g;
};
#else
BOOST_concept(DistributedVertexListGraph,(G))
: Graph<G>
{
typedef typename graph_traits<G>::vertex_iterator vertex_iterator;
typedef typename graph_traits<G>::vertices_size_type vertices_size_type;
typedef typename graph_traits<G>::traversal_category
traversal_category;
~DistributedVertexListGraph() {
BOOST_CONCEPT_ASSERT((MultiPassInputIterator<vertex_iterator>));
BOOST_CONCEPT_ASSERT((Convertible<traversal_category,
distributed_vertex_list_graph_tag>));
#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
// dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
// you want to use vector_as_graph, it is! I'm sure the graph
// library leaves these out all over the place. Probably a
// redesign involving specializing a template with a static
// member function is in order :(
using boost::vertices;
#endif
p = vertices(g);
v = *p.first;
const_constraints(g);
}
void const_constraints(const G& cg) {
#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
// dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
// you want to use vector_as_graph, it is! I'm sure the graph
// library leaves these out all over the place. Probably a
// redesign involving specializing a template with a static
// member function is in order :(
using boost::vertices;
#endif
p = vertices(cg);
v = *p.first;
V = num_vertices(cg);
}
std::pair<vertex_iterator,vertex_iterator> p;
typename graph_traits<G>::vertex_descriptor v;
G g;
vertices_size_type V;
};
BOOST_concept(DistributedEdgeListGraph,(G))
: Graph<G>
{
typedef typename graph_traits<G>::edge_descriptor edge_descriptor;
typedef typename graph_traits<G>::edge_iterator edge_iterator;
typedef typename graph_traits<G>::edges_size_type edges_size_type;
typedef typename graph_traits<G>::traversal_category
traversal_category;
~DistributedEdgeListGraph() {
BOOST_CONCEPT_ASSERT((MultiPassInputIterator<edge_iterator>));
BOOST_CONCEPT_ASSERT((DefaultConstructible<edge_descriptor>));
BOOST_CONCEPT_ASSERT((EqualityComparable<edge_descriptor>));
BOOST_CONCEPT_ASSERT((Assignable<edge_descriptor>));
BOOST_CONCEPT_ASSERT((Convertible<traversal_category,
distributed_edge_list_graph_tag>));
p = edges(g);
e = *p.first;
u = source(e, g);
v = target(e, g);
const_constraints(g);
}
void const_constraints(const G& cg) {
p = edges(cg);
E = num_edges(cg);
e = *p.first;
u = source(e, cg);
v = target(e, cg);
}
std::pair<edge_iterator,edge_iterator> p;
typename graph_traits<G>::vertex_descriptor u, v;
typename graph_traits<G>::edge_descriptor e;
edges_size_type E;
G g;
};
#endif
#if BOOST_VERSION >= 103500
} // end namespace concepts
using concepts::DistributedVertexListGraphConcept;
using concepts::DistributedEdgeListGraphConcept;
#endif
} // end namespace boost
#if BOOST_VERSION >= 103500
# include <boost/concept/detail/concept_undef.hpp>
#endif
#endif // BOOST_GRAPH_DISTRIBUTED_CONCEPTS_HPP
@@ -0,0 +1,66 @@
subroutine wqencode(msg,ntype,data0)
! Parse and encode a WSPR message.
use packjt
parameter (MASK15=32767)
character*22 msg
character*12 call1,call2
character grid4*4
logical lbad1,lbad2
integer*1 data0(11)
integer nu(0:9)
data nu/0,-1,1,0,-1,2,1,0,-1,1/
! Standard WSPR message (types 0 3 7 10 13 17 ... 60)
i1=index(msg,' ')
i2=index(msg,'/')
i3=index(msg,'<')
call1=msg(:i1-1)
if(i1.lt.3 .or. i1.gt.7 .or. i2.gt.0 .or. i3.gt.0) go to 10
grid4=msg(i1+1:i1+4)
call packcall(call1,n1,lbad1)
call packgrid(grid4,ng,lbad2)
if(lbad1 .or. lbad2) go to 10
ndbm=0
read(msg(i1+5:),*) ndbm
if(ndbm.lt.0) ndbm=0
if(ndbm.gt.60) ndbm=60
ndbm=ndbm+nu(mod(ndbm,10))
n2=128*ng + (ndbm+64)
call pack50(n1,n2,data0)
ntype=ndbm
go to 900
10 if(i2.ge.2 .and. i3.lt.1) then
call packpfx(call1,n1,ng,nadd)
ndbm=0
read(msg(i1+1:),*) ndbm
if(ndbm.lt.0) ndbm=0
if(ndbm.gt.60) ndbm=60
ndbm=ndbm+nu(mod(ndbm,10))
ntype=ndbm + 1 + nadd
n2=128*ng + ntype + 64
call pack50(n1,n2,data0)
else if(i3.eq.1) then
i4=index(msg,'>')
call1=msg(2:i4-1)
call hash(call1,i4-2,ih)
i5=index(trim(msg(i1+1:)),' ')
! Convert grid to valid callsign format - first character moved to end
call2=msg(i1+2:i1+i5-1)//msg(i1+1:i1+1)//' '
call packcall(call2,n1,lbad1)
ndbm=0
read(msg(i1+i5+1:),*) ndbm
if(ndbm.lt.0) ndbm=0
if(ndbm.gt.60) ndbm=60
ndbm=ndbm+nu(mod(ndbm,10))
ntype=-(ndbm+1)
n2=128*ih + ntype + 64
call pack50(n1,n2,data0)
endif
go to 900
900 continue
return
end subroutine wqencode
@@ -0,0 +1,226 @@
/*
[auto_generated]
boost/numeric/odeint/external/viennacl_operations.hpp
[begin_description]
ViennaCL operations.
[end_description]
Copyright 2012 Denis Demidov
Copyright 2012 Karsten Ahnert
Copyright 2012 Mario Mulansky
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or
copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED
#define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED
#include <viennacl/vector.hpp>
#ifdef VIENNACL_WITH_OPENCL
# include <viennacl/generator/custom_operation.hpp>
#endif
namespace boost {
namespace numeric {
namespace odeint {
#ifdef VIENNACL_WITH_OPENCL
struct viennacl_operations
{
template< class Fac1 = double , class Fac2 = Fac1 >
struct scale_sum2
{
const Fac1 m_alpha1;
const Fac2 m_alpha2;
scale_sum2( Fac1 alpha1 , Fac2 alpha2 )
: m_alpha1( alpha1 ) , m_alpha2( alpha2 )
{ }
template< class T1 , class T2 , class T3 >
void operator()( viennacl::vector<T1> &v1 ,
const viennacl::vector<T2> &v2 ,
const viennacl::vector<T3> &v3
) const
{
using namespace viennacl;
static generator::symbolic_vector <0, T1> sym_v1;
static generator::symbolic_vector <1, T2> sym_v2;
static generator::symbolic_vector <2, T3> sym_v3;
static generator::cpu_symbolic_scalar<3, Fac1> sym_a1;
static generator::cpu_symbolic_scalar<4, Fac2> sym_a2;
static generator::custom_operation op(
sym_v1 = sym_a1 * sym_v2
+ sym_a2 * sym_v3,
"scale_sum2"
);
ocl::enqueue( op(v1, v2, v3, m_alpha1, m_alpha2) );
}
typedef void result_type;
};
template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 >
struct scale_sum3
{
const Fac1 m_alpha1;
const Fac2 m_alpha2;
const Fac3 m_alpha3;
scale_sum3( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 )
: m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 )
{ }
template< class T1 , class T2 , class T3 , class T4 >
void operator()( viennacl::vector<T1> &v1 ,
const viennacl::vector<T2> &v2 ,
const viennacl::vector<T3> &v3 ,
const viennacl::vector<T4> &v4
) const
{
using namespace viennacl;
static generator::symbolic_vector <0, T1> sym_v1;
static generator::symbolic_vector <1, T2> sym_v2;
static generator::symbolic_vector <2, T3> sym_v3;
static generator::symbolic_vector <3, T4> sym_v4;
static generator::cpu_symbolic_scalar<4, Fac1> sym_a1;
static generator::cpu_symbolic_scalar<5, Fac2> sym_a2;
static generator::cpu_symbolic_scalar<6, Fac3> sym_a3;
static generator::custom_operation op(
sym_v1 = sym_a1 * sym_v2
+ sym_a2 * sym_v3
+ sym_a3 * sym_v4,
"scale_sum3"
);
ocl::enqueue( op(v1, v2, v3, v4, m_alpha1, m_alpha2, m_alpha3) );
}
typedef void result_type;
};
template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 >
struct scale_sum4
{
const Fac1 m_alpha1;
const Fac2 m_alpha2;
const Fac3 m_alpha3;
const Fac4 m_alpha4;
scale_sum4( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 )
: m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { }
template< class T1 , class T2 , class T3 , class T4 , class T5 >
void operator()( viennacl::vector<T1> &v1 ,
const viennacl::vector<T2> &v2 ,
const viennacl::vector<T3> &v3 ,
const viennacl::vector<T4> &v4 ,
const viennacl::vector<T5> &v5
) const
{
using namespace viennacl;
static generator::symbolic_vector <0, T1> sym_v1;
static generator::symbolic_vector <1, T2> sym_v2;
static generator::symbolic_vector <2, T3> sym_v3;
static generator::symbolic_vector <3, T4> sym_v4;
static generator::symbolic_vector <4, T5> sym_v5;
static generator::cpu_symbolic_scalar<5, Fac1> sym_a1;
static generator::cpu_symbolic_scalar<6, Fac2> sym_a2;
static generator::cpu_symbolic_scalar<7, Fac3> sym_a3;
static generator::cpu_symbolic_scalar<8, Fac4> sym_a4;
static generator::custom_operation op(
sym_v1 = sym_a1 * sym_v2
+ sym_a2 * sym_v3
+ sym_a3 * sym_v4
+ sym_a4 * sym_v5,
"scale_sum4"
);
ocl::enqueue( op(v1, v2, v3, v4, v5,
m_alpha1, m_alpha2, m_alpha3, m_alpha4) );
}
typedef void result_type;
};
template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 >
struct scale_sum5
{
const Fac1 m_alpha1;
const Fac2 m_alpha2;
const Fac3 m_alpha3;
const Fac4 m_alpha4;
const Fac5 m_alpha5;
scale_sum5( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 )
: m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { }
template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 >
void operator()( viennacl::vector<T1> &v1 ,
const viennacl::vector<T2> &v2 ,
const viennacl::vector<T3> &v3 ,
const viennacl::vector<T4> &v4 ,
const viennacl::vector<T5> &v5 ,
const viennacl::vector<T6> &v6
) const
{
using namespace viennacl;
static generator::symbolic_vector < 0, T1> sym_v1;
static generator::symbolic_vector < 1, T2> sym_v2;
static generator::symbolic_vector < 2, T3> sym_v3;
static generator::symbolic_vector < 3, T4> sym_v4;
static generator::symbolic_vector < 4, T5> sym_v5;
static generator::symbolic_vector < 5, T6> sym_v6;
static generator::cpu_symbolic_scalar< 6, Fac1> sym_a1;
static generator::cpu_symbolic_scalar< 7, Fac2> sym_a2;
static generator::cpu_symbolic_scalar< 8, Fac3> sym_a3;
static generator::cpu_symbolic_scalar< 9, Fac4> sym_a4;
static generator::cpu_symbolic_scalar<10, Fac5> sym_a5;
static generator::custom_operation op(
sym_v1 = sym_a1 * sym_v2
+ sym_a2 * sym_v3
+ sym_a3 * sym_v4
+ sym_a4 * sym_v5
+ sym_a5 * sym_v6,
"scale_sum5"
);
ocl::enqueue( op(v1, v2, v3, v4, v5, v6,
m_alpha1, m_alpha2, m_alpha3, m_alpha4, m_alpha5) );
}
typedef void result_type;
};
};
#else
struct viennacl_operations : public default_operations {};
#endif
} // odeint
} // numeric
} // boost
#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED
@@ -0,0 +1,339 @@
// boost cast.hpp header file ----------------------------------------------//
// (C) Copyright Kevlin Henney and Dave Abrahams 1999.
// Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/conversion for Documentation.
// Revision History
// 23 JUN 05 Code extracted from /boost/cast.hpp into this new header.
// Keeps this legacy version of numeric_cast<> for old compilers
// wich can't compile the new version in /boost/numeric/conversion/cast.hpp
// (Fernando Cacciola)
// 02 Apr 01 Removed BOOST_NO_LIMITS workarounds and included
// <boost/limits.hpp> instead (the workaround did not
// actually compile when BOOST_NO_LIMITS was defined in
// any case, so we loose nothing). (John Maddock)
// 21 Jan 01 Undid a bug I introduced yesterday. numeric_cast<> never
// worked with stock GCC; trying to get it to do that broke
// vc-stlport.
// 20 Jan 01 Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
// Removed unused BOOST_EXPLICIT_TARGET macro. Moved
// boost::detail::type to boost/type.hpp. Made it compile with
// stock gcc again (Dave Abrahams)
// 29 Nov 00 Remove nested namespace cast, cleanup spacing before Formal
// Review (Beman Dawes)
// 19 Oct 00 Fix numeric_cast for floating-point types (Dave Abrahams)
// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC
// (Dave Abrahams)
// 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams)
// 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes)
// 27 Jun 00 More MSVC6 workarounds
// 15 Jun 00 Add workarounds for MSVC6
// 2 Feb 00 Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
// 26 Jan 00 Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
// 29 Dec 99 Change using declarations so usages in other namespaces work
// correctly (Dave Abrahams)
// 23 Sep 99 Change polymorphic_downcast assert to also detect M.I. errors
// as suggested Darin Adler and improved by Valentin Bonnard.
// 2 Sep 99 Remove controversial asserts, simplify, rename.
// 30 Aug 99 Move to cast.hpp, replace value_cast with numeric_cast,
// place in nested namespace.
// 3 Aug 99 Initial version
#ifndef BOOST_OLD_NUMERIC_CAST_HPP
#define BOOST_OLD_NUMERIC_CAST_HPP
# include <boost/config.hpp>
# include <cassert>
# include <typeinfo>
# include <boost/type.hpp>
# include <boost/limits.hpp>
# include <boost/numeric/conversion/converter_policies.hpp>
// It has been demonstrated numerous times that MSVC 6.0 fails silently at link
// time if you use a template function which has template parameters that don't
// appear in the function's argument list.
//
// TODO: Add this to config.hpp?
// FLC: This macro is repeated in boost/cast.hpp but only locally (is undefined at the bottom)
// so is OK to reproduce it here.
# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
# define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
# else
# define BOOST_EXPLICIT_DEFAULT_TARGET
# endif
namespace boost
{
using numeric::bad_numeric_cast;
// LEGACY numeric_cast [only for some old broken compilers] --------------------------------------//
// Contributed by Kevlin Henney
// numeric_cast ------------------------------------------------------------//
#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS)
namespace detail
{
template <class T>
struct signed_numeric_limits : std::numeric_limits<T>
{
static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return (std::numeric_limits<T>::min)() >= 0
// unary minus causes integral promotion, thus the static_cast<>
? static_cast<T>(-(std::numeric_limits<T>::max)())
: (std::numeric_limits<T>::min)();
};
};
// Move to namespace boost in utility.hpp?
template <class T, bool specialized>
struct fixed_numeric_limits_base
: public if_true< std::numeric_limits<T>::is_signed >
::BOOST_NESTED_TEMPLATE then< signed_numeric_limits<T>,
std::numeric_limits<T>
>::type
{};
template <class T>
struct fixed_numeric_limits
: fixed_numeric_limits_base<T,(std::numeric_limits<T>::is_specialized)>
{};
# ifdef BOOST_HAS_LONG_LONG
// cover implementations which supply no specialization for long
// long / unsigned long long. Not intended to be full
// numeric_limits replacements, but good enough for numeric_cast<>
template <>
struct fixed_numeric_limits_base< ::boost::long_long_type, false>
{
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
BOOST_STATIC_CONSTANT(bool, is_signed = true);
static ::boost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
# ifdef LONGLONG_MAX
return LONGLONG_MAX;
# else
return 9223372036854775807LL; // hope this is portable
# endif
}
static ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
# ifdef LONGLONG_MIN
return LONGLONG_MIN;
# else
return -( 9223372036854775807LL )-1; // hope this is portable
# endif
}
};
template <>
struct fixed_numeric_limits_base< ::boost::ulong_long_type, false>
{
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
BOOST_STATIC_CONSTANT(bool, is_signed = false);
static ::boost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
# ifdef ULONGLONG_MAX
return ULONGLONG_MAX;
# else
return 0xffffffffffffffffULL; // hope this is portable
# endif
}
static ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }
};
# endif
} // namespace detail
// less_than_type_min -
// x_is_signed should be numeric_limits<X>::is_signed
// y_is_signed should be numeric_limits<Y>::is_signed
// y_min should be numeric_limits<Y>::min()
//
// check(x, y_min) returns true iff x < y_min without invoking comparisons
// between signed and unsigned values.
//
// "poor man's partial specialization" is in use here.
template <bool x_is_signed, bool y_is_signed>
struct less_than_type_min
{
template <class X, class Y>
static bool check(X x, Y y_min)
{ return x < y_min; }
};
template <>
struct less_than_type_min<false, true>
{
template <class X, class Y>
static bool check(X, Y)
{ return false; }
};
template <>
struct less_than_type_min<true, false>
{
template <class X, class Y>
static bool check(X x, Y)
{ return x < 0; }
};
// greater_than_type_max -
// same_sign should be:
// numeric_limits<X>::is_signed == numeric_limits<Y>::is_signed
// y_max should be numeric_limits<Y>::max()
//
// check(x, y_max) returns true iff x > y_max without invoking comparisons
// between signed and unsigned values.
//
// "poor man's partial specialization" is in use here.
template <bool same_sign, bool x_is_signed>
struct greater_than_type_max;
template<>
struct greater_than_type_max<true, true>
{
template <class X, class Y>
static inline bool check(X x, Y y_max)
{ return x > y_max; }
};
template <>
struct greater_than_type_max<false, true>
{
// What does the standard say about this? I think it's right, and it
// will work with every compiler I know of.
template <class X, class Y>
static inline bool check(X x, Y)
{ return x >= 0 && static_cast<X>(static_cast<Y>(x)) != x; }
# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
// MSVC6 can't static_cast unsigned __int64 -> floating types
# define BOOST_UINT64_CAST(src_type) \
static inline bool check(src_type x, unsigned __int64) \
{ \
if (x < 0) return false; \
unsigned __int64 y = static_cast<unsigned __int64>(x); \
bool odd = y & 0x1; \
__int64 div2 = static_cast<__int64>(y >> 1); \
return ((static_cast<src_type>(div2) * 2.0) + odd) != x; \
}
BOOST_UINT64_CAST(long double);
BOOST_UINT64_CAST(double);
BOOST_UINT64_CAST(float);
# undef BOOST_UINT64_CAST
# endif
};
template<>
struct greater_than_type_max<true, false>
{
template <class X, class Y>
static inline bool check(X x, Y y_max)
{ return x > y_max; }
};
template <>
struct greater_than_type_max<false, false>
{
// What does the standard say about this? I think it's right, and it
// will work with every compiler I know of.
template <class X, class Y>
static inline bool check(X x, Y)
{ return static_cast<X>(static_cast<Y>(x)) != x; }
};
#else // use #pragma hacks if available
namespace detail
{
# if BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4018)
# pragma warning(disable : 4146)
#elif defined(__BORLANDC__)
# pragma option push -w-8041
# endif
// Move to namespace boost in utility.hpp?
template <class T>
struct fixed_numeric_limits : public std::numeric_limits<T>
{
static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
return std::numeric_limits<T>::is_signed && (std::numeric_limits<T>::min)() >= 0
? T(-(std::numeric_limits<T>::max)()) : (std::numeric_limits<T>::min)();
}
};
# if BOOST_MSVC
# pragma warning(pop)
#elif defined(__BORLANDC__)
# pragma option pop
# endif
} // namespace detail
#endif
template<typename Target, typename Source>
inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)
{
// typedefs abbreviating respective trait classes
typedef detail::fixed_numeric_limits<Source> arg_traits;
typedef detail::fixed_numeric_limits<Target> result_traits;
#if defined(BOOST_STRICT_CONFIG) \
|| (!defined(__HP_aCC) || __HP_aCC > 33900) \
&& (!defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) \
|| defined(BOOST_SGI_CPP_LIMITS))
// typedefs that act as compile time assertions
// (to be replaced by boost compile time assertions
// as and when they become available and are stable)
typedef bool argument_must_be_numeric[arg_traits::is_specialized];
typedef bool result_must_be_numeric[result_traits::is_specialized];
const bool arg_is_signed = arg_traits::is_signed;
const bool result_is_signed = result_traits::is_signed;
const bool same_sign = arg_is_signed == result_is_signed;
if (less_than_type_min<arg_is_signed, result_is_signed>::check(arg, (result_traits::min)())
|| greater_than_type_max<same_sign, arg_is_signed>::check(arg, (result_traits::max)())
)
#else // We need to use #pragma hacks if available
# if BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4018)
#elif defined(__BORLANDC__)
#pragma option push -w-8012
# endif
if ((arg < 0 && !result_traits::is_signed) // loss of negative range
|| (arg_traits::is_signed && arg < (result_traits::min)()) // underflow
|| arg > (result_traits::max)()) // overflow
# if BOOST_MSVC
# pragma warning(pop)
#elif defined(__BORLANDC__)
#pragma option pop
# endif
#endif
{
throw bad_numeric_cast();
}
return static_cast<Target>(arg);
} // numeric_cast
# undef BOOST_EXPLICIT_DEFAULT_TARGET
} // namespace boost
#endif // BOOST_OLD_NUMERIC_CAST_HPP
@@ -0,0 +1,49 @@
// Copyright (C) 2013 Vicente J. Botet Escriba
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// 2013/10 Vicente J. Botet Escriba
// Creation.
#ifndef BOOST_CSBL_FUNCTIONAL_HPP
#define BOOST_CSBL_FUNCTIONAL_HPP
#include <boost/config.hpp>
#include <functional>
#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL || defined BOOST_NO_CXX11_HDR_FUNCTIONAL || defined BOOST_NO_CXX11_RVALUE_REFERENCES
#ifndef BOOST_THREAD_USES_BOOST_FUNCTIONAL
#define BOOST_THREAD_USES_BOOST_FUNCTIONAL
#endif
#include <boost/function.hpp>
#endif
namespace boost
{
namespace csbl
{
#if defined BOOST_THREAD_USES_BOOST_FUNCTIONAL
using ::boost::function;
#else
// D.8.1, base (deprecated):
// 20.9.3, reference_wrapper:
// 20.9.4, arithmetic operations:
// 20.9.5, comparisons:
// 20.9.6, logical operations:
// 20.9.7, bitwise operations:
// 20.9.8, negators:
// 20.9.9, bind:
// D.9, binders (deprecated):
// D.8.2.1, adaptors (deprecated):
// D.8.2.2, adaptors (deprecated):
// 20.9.10, member function adaptors:
// 20.9.11 polymorphic function wrappers:
using ::std::function;
// 20.9.12, hash function primary template:
#endif
}
}
#endif // header
@@ -0,0 +1,13 @@
// Copyright (C) 2007 Douglas Gregor
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// This file contains a simplification of the "trigger" method for
// process groups. The simple trigger handles the common case where
// the handler associated with a trigger is a member function bound to
// a particular pointer.
// File moved
#include <boost/property_map/parallel/simple_trigger.hpp>
@@ -0,0 +1,267 @@
# /* **************************************************************************
# * *
# * (C) Copyright Paul Mensonides 2002.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# include <boost/preprocessor/slot/detail/shared.hpp>
#
# undef BOOST_PP_SLOT_5
#
# undef BOOST_PP_SLOT_5_DIGIT_1
# undef BOOST_PP_SLOT_5_DIGIT_2
# undef BOOST_PP_SLOT_5_DIGIT_3
# undef BOOST_PP_SLOT_5_DIGIT_4
# undef BOOST_PP_SLOT_5_DIGIT_5
# undef BOOST_PP_SLOT_5_DIGIT_6
# undef BOOST_PP_SLOT_5_DIGIT_7
# undef BOOST_PP_SLOT_5_DIGIT_8
# undef BOOST_PP_SLOT_5_DIGIT_9
# undef BOOST_PP_SLOT_5_DIGIT_10
#
# if BOOST_PP_SLOT_TEMP_10 == 0
# define BOOST_PP_SLOT_5_DIGIT_10 0
# elif BOOST_PP_SLOT_TEMP_10 == 1
# define BOOST_PP_SLOT_5_DIGIT_10 1
# elif BOOST_PP_SLOT_TEMP_10 == 2
# define BOOST_PP_SLOT_5_DIGIT_10 2
# elif BOOST_PP_SLOT_TEMP_10 == 3
# define BOOST_PP_SLOT_5_DIGIT_10 3
# elif BOOST_PP_SLOT_TEMP_10 == 4
# define BOOST_PP_SLOT_5_DIGIT_10 4
# elif BOOST_PP_SLOT_TEMP_10 == 5
# define BOOST_PP_SLOT_5_DIGIT_10 5
# elif BOOST_PP_SLOT_TEMP_10 == 6
# define BOOST_PP_SLOT_5_DIGIT_10 6
# elif BOOST_PP_SLOT_TEMP_10 == 7
# define BOOST_PP_SLOT_5_DIGIT_10 7
# elif BOOST_PP_SLOT_TEMP_10 == 8
# define BOOST_PP_SLOT_5_DIGIT_10 8
# elif BOOST_PP_SLOT_TEMP_10 == 9
# define BOOST_PP_SLOT_5_DIGIT_10 9
# endif
#
# if BOOST_PP_SLOT_TEMP_9 == 0
# define BOOST_PP_SLOT_5_DIGIT_9 0
# elif BOOST_PP_SLOT_TEMP_9 == 1
# define BOOST_PP_SLOT_5_DIGIT_9 1
# elif BOOST_PP_SLOT_TEMP_9 == 2
# define BOOST_PP_SLOT_5_DIGIT_9 2
# elif BOOST_PP_SLOT_TEMP_9 == 3
# define BOOST_PP_SLOT_5_DIGIT_9 3
# elif BOOST_PP_SLOT_TEMP_9 == 4
# define BOOST_PP_SLOT_5_DIGIT_9 4
# elif BOOST_PP_SLOT_TEMP_9 == 5
# define BOOST_PP_SLOT_5_DIGIT_9 5
# elif BOOST_PP_SLOT_TEMP_9 == 6
# define BOOST_PP_SLOT_5_DIGIT_9 6
# elif BOOST_PP_SLOT_TEMP_9 == 7
# define BOOST_PP_SLOT_5_DIGIT_9 7
# elif BOOST_PP_SLOT_TEMP_9 == 8
# define BOOST_PP_SLOT_5_DIGIT_9 8
# elif BOOST_PP_SLOT_TEMP_9 == 9
# define BOOST_PP_SLOT_5_DIGIT_9 9
# endif
#
# if BOOST_PP_SLOT_TEMP_8 == 0
# define BOOST_PP_SLOT_5_DIGIT_8 0
# elif BOOST_PP_SLOT_TEMP_8 == 1
# define BOOST_PP_SLOT_5_DIGIT_8 1
# elif BOOST_PP_SLOT_TEMP_8 == 2
# define BOOST_PP_SLOT_5_DIGIT_8 2
# elif BOOST_PP_SLOT_TEMP_8 == 3
# define BOOST_PP_SLOT_5_DIGIT_8 3
# elif BOOST_PP_SLOT_TEMP_8 == 4
# define BOOST_PP_SLOT_5_DIGIT_8 4
# elif BOOST_PP_SLOT_TEMP_8 == 5
# define BOOST_PP_SLOT_5_DIGIT_8 5
# elif BOOST_PP_SLOT_TEMP_8 == 6
# define BOOST_PP_SLOT_5_DIGIT_8 6
# elif BOOST_PP_SLOT_TEMP_8 == 7
# define BOOST_PP_SLOT_5_DIGIT_8 7
# elif BOOST_PP_SLOT_TEMP_8 == 8
# define BOOST_PP_SLOT_5_DIGIT_8 8
# elif BOOST_PP_SLOT_TEMP_8 == 9
# define BOOST_PP_SLOT_5_DIGIT_8 9
# endif
#
# if BOOST_PP_SLOT_TEMP_7 == 0
# define BOOST_PP_SLOT_5_DIGIT_7 0
# elif BOOST_PP_SLOT_TEMP_7 == 1
# define BOOST_PP_SLOT_5_DIGIT_7 1
# elif BOOST_PP_SLOT_TEMP_7 == 2
# define BOOST_PP_SLOT_5_DIGIT_7 2
# elif BOOST_PP_SLOT_TEMP_7 == 3
# define BOOST_PP_SLOT_5_DIGIT_7 3
# elif BOOST_PP_SLOT_TEMP_7 == 4
# define BOOST_PP_SLOT_5_DIGIT_7 4
# elif BOOST_PP_SLOT_TEMP_7 == 5
# define BOOST_PP_SLOT_5_DIGIT_7 5
# elif BOOST_PP_SLOT_TEMP_7 == 6
# define BOOST_PP_SLOT_5_DIGIT_7 6
# elif BOOST_PP_SLOT_TEMP_7 == 7
# define BOOST_PP_SLOT_5_DIGIT_7 7
# elif BOOST_PP_SLOT_TEMP_7 == 8
# define BOOST_PP_SLOT_5_DIGIT_7 8
# elif BOOST_PP_SLOT_TEMP_7 == 9
# define BOOST_PP_SLOT_5_DIGIT_7 9
# endif
#
# if BOOST_PP_SLOT_TEMP_6 == 0
# define BOOST_PP_SLOT_5_DIGIT_6 0
# elif BOOST_PP_SLOT_TEMP_6 == 1
# define BOOST_PP_SLOT_5_DIGIT_6 1
# elif BOOST_PP_SLOT_TEMP_6 == 2
# define BOOST_PP_SLOT_5_DIGIT_6 2
# elif BOOST_PP_SLOT_TEMP_6 == 3
# define BOOST_PP_SLOT_5_DIGIT_6 3
# elif BOOST_PP_SLOT_TEMP_6 == 4
# define BOOST_PP_SLOT_5_DIGIT_6 4
# elif BOOST_PP_SLOT_TEMP_6 == 5
# define BOOST_PP_SLOT_5_DIGIT_6 5
# elif BOOST_PP_SLOT_TEMP_6 == 6
# define BOOST_PP_SLOT_5_DIGIT_6 6
# elif BOOST_PP_SLOT_TEMP_6 == 7
# define BOOST_PP_SLOT_5_DIGIT_6 7
# elif BOOST_PP_SLOT_TEMP_6 == 8
# define BOOST_PP_SLOT_5_DIGIT_6 8
# elif BOOST_PP_SLOT_TEMP_6 == 9
# define BOOST_PP_SLOT_5_DIGIT_6 9
# endif
#
# if BOOST_PP_SLOT_TEMP_5 == 0
# define BOOST_PP_SLOT_5_DIGIT_5 0
# elif BOOST_PP_SLOT_TEMP_5 == 1
# define BOOST_PP_SLOT_5_DIGIT_5 1
# elif BOOST_PP_SLOT_TEMP_5 == 2
# define BOOST_PP_SLOT_5_DIGIT_5 2
# elif BOOST_PP_SLOT_TEMP_5 == 3
# define BOOST_PP_SLOT_5_DIGIT_5 3
# elif BOOST_PP_SLOT_TEMP_5 == 4
# define BOOST_PP_SLOT_5_DIGIT_5 4
# elif BOOST_PP_SLOT_TEMP_5 == 5
# define BOOST_PP_SLOT_5_DIGIT_5 5
# elif BOOST_PP_SLOT_TEMP_5 == 6
# define BOOST_PP_SLOT_5_DIGIT_5 6
# elif BOOST_PP_SLOT_TEMP_5 == 7
# define BOOST_PP_SLOT_5_DIGIT_5 7
# elif BOOST_PP_SLOT_TEMP_5 == 8
# define BOOST_PP_SLOT_5_DIGIT_5 8
# elif BOOST_PP_SLOT_TEMP_5 == 9
# define BOOST_PP_SLOT_5_DIGIT_5 9
# endif
#
# if BOOST_PP_SLOT_TEMP_4 == 0
# define BOOST_PP_SLOT_5_DIGIT_4 0
# elif BOOST_PP_SLOT_TEMP_4 == 1
# define BOOST_PP_SLOT_5_DIGIT_4 1
# elif BOOST_PP_SLOT_TEMP_4 == 2
# define BOOST_PP_SLOT_5_DIGIT_4 2
# elif BOOST_PP_SLOT_TEMP_4 == 3
# define BOOST_PP_SLOT_5_DIGIT_4 3
# elif BOOST_PP_SLOT_TEMP_4 == 4
# define BOOST_PP_SLOT_5_DIGIT_4 4
# elif BOOST_PP_SLOT_TEMP_4 == 5
# define BOOST_PP_SLOT_5_DIGIT_4 5
# elif BOOST_PP_SLOT_TEMP_4 == 6
# define BOOST_PP_SLOT_5_DIGIT_4 6
# elif BOOST_PP_SLOT_TEMP_4 == 7
# define BOOST_PP_SLOT_5_DIGIT_4 7
# elif BOOST_PP_SLOT_TEMP_4 == 8
# define BOOST_PP_SLOT_5_DIGIT_4 8
# elif BOOST_PP_SLOT_TEMP_4 == 9
# define BOOST_PP_SLOT_5_DIGIT_4 9
# endif
#
# if BOOST_PP_SLOT_TEMP_3 == 0
# define BOOST_PP_SLOT_5_DIGIT_3 0
# elif BOOST_PP_SLOT_TEMP_3 == 1
# define BOOST_PP_SLOT_5_DIGIT_3 1
# elif BOOST_PP_SLOT_TEMP_3 == 2
# define BOOST_PP_SLOT_5_DIGIT_3 2
# elif BOOST_PP_SLOT_TEMP_3 == 3
# define BOOST_PP_SLOT_5_DIGIT_3 3
# elif BOOST_PP_SLOT_TEMP_3 == 4
# define BOOST_PP_SLOT_5_DIGIT_3 4
# elif BOOST_PP_SLOT_TEMP_3 == 5
# define BOOST_PP_SLOT_5_DIGIT_3 5
# elif BOOST_PP_SLOT_TEMP_3 == 6
# define BOOST_PP_SLOT_5_DIGIT_3 6
# elif BOOST_PP_SLOT_TEMP_3 == 7
# define BOOST_PP_SLOT_5_DIGIT_3 7
# elif BOOST_PP_SLOT_TEMP_3 == 8
# define BOOST_PP_SLOT_5_DIGIT_3 8
# elif BOOST_PP_SLOT_TEMP_3 == 9
# define BOOST_PP_SLOT_5_DIGIT_3 9
# endif
#
# if BOOST_PP_SLOT_TEMP_2 == 0
# define BOOST_PP_SLOT_5_DIGIT_2 0
# elif BOOST_PP_SLOT_TEMP_2 == 1
# define BOOST_PP_SLOT_5_DIGIT_2 1
# elif BOOST_PP_SLOT_TEMP_2 == 2
# define BOOST_PP_SLOT_5_DIGIT_2 2
# elif BOOST_PP_SLOT_TEMP_2 == 3
# define BOOST_PP_SLOT_5_DIGIT_2 3
# elif BOOST_PP_SLOT_TEMP_2 == 4
# define BOOST_PP_SLOT_5_DIGIT_2 4
# elif BOOST_PP_SLOT_TEMP_2 == 5
# define BOOST_PP_SLOT_5_DIGIT_2 5
# elif BOOST_PP_SLOT_TEMP_2 == 6
# define BOOST_PP_SLOT_5_DIGIT_2 6
# elif BOOST_PP_SLOT_TEMP_2 == 7
# define BOOST_PP_SLOT_5_DIGIT_2 7
# elif BOOST_PP_SLOT_TEMP_2 == 8
# define BOOST_PP_SLOT_5_DIGIT_2 8
# elif BOOST_PP_SLOT_TEMP_2 == 9
# define BOOST_PP_SLOT_5_DIGIT_2 9
# endif
#
# if BOOST_PP_SLOT_TEMP_1 == 0
# define BOOST_PP_SLOT_5_DIGIT_1 0
# elif BOOST_PP_SLOT_TEMP_1 == 1
# define BOOST_PP_SLOT_5_DIGIT_1 1
# elif BOOST_PP_SLOT_TEMP_1 == 2
# define BOOST_PP_SLOT_5_DIGIT_1 2
# elif BOOST_PP_SLOT_TEMP_1 == 3
# define BOOST_PP_SLOT_5_DIGIT_1 3
# elif BOOST_PP_SLOT_TEMP_1 == 4
# define BOOST_PP_SLOT_5_DIGIT_1 4
# elif BOOST_PP_SLOT_TEMP_1 == 5
# define BOOST_PP_SLOT_5_DIGIT_1 5
# elif BOOST_PP_SLOT_TEMP_1 == 6
# define BOOST_PP_SLOT_5_DIGIT_1 6
# elif BOOST_PP_SLOT_TEMP_1 == 7
# define BOOST_PP_SLOT_5_DIGIT_1 7
# elif BOOST_PP_SLOT_TEMP_1 == 8
# define BOOST_PP_SLOT_5_DIGIT_1 8
# elif BOOST_PP_SLOT_TEMP_1 == 9
# define BOOST_PP_SLOT_5_DIGIT_1 9
# endif
#
# if BOOST_PP_SLOT_5_DIGIT_10
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_10(BOOST_PP_SLOT_5_DIGIT_10, BOOST_PP_SLOT_5_DIGIT_9, BOOST_PP_SLOT_5_DIGIT_8, BOOST_PP_SLOT_5_DIGIT_7, BOOST_PP_SLOT_5_DIGIT_6, BOOST_PP_SLOT_5_DIGIT_5, BOOST_PP_SLOT_5_DIGIT_4, BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_9
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_9(BOOST_PP_SLOT_5_DIGIT_9, BOOST_PP_SLOT_5_DIGIT_8, BOOST_PP_SLOT_5_DIGIT_7, BOOST_PP_SLOT_5_DIGIT_6, BOOST_PP_SLOT_5_DIGIT_5, BOOST_PP_SLOT_5_DIGIT_4, BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_8
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_8(BOOST_PP_SLOT_5_DIGIT_8, BOOST_PP_SLOT_5_DIGIT_7, BOOST_PP_SLOT_5_DIGIT_6, BOOST_PP_SLOT_5_DIGIT_5, BOOST_PP_SLOT_5_DIGIT_4, BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_7
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_7(BOOST_PP_SLOT_5_DIGIT_7, BOOST_PP_SLOT_5_DIGIT_6, BOOST_PP_SLOT_5_DIGIT_5, BOOST_PP_SLOT_5_DIGIT_4, BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_6
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_6(BOOST_PP_SLOT_5_DIGIT_6, BOOST_PP_SLOT_5_DIGIT_5, BOOST_PP_SLOT_5_DIGIT_4, BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_5
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_5(BOOST_PP_SLOT_5_DIGIT_5, BOOST_PP_SLOT_5_DIGIT_4, BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_4
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_4(BOOST_PP_SLOT_5_DIGIT_4, BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_3
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_3(BOOST_PP_SLOT_5_DIGIT_3, BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# elif BOOST_PP_SLOT_5_DIGIT_2
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_CC_2(BOOST_PP_SLOT_5_DIGIT_2, BOOST_PP_SLOT_5_DIGIT_1)
# else
# define BOOST_PP_SLOT_5() BOOST_PP_SLOT_5_DIGIT_1
# endif
@@ -0,0 +1,217 @@
program wspr5d
! Decode WSPR-LF data read from *.c5 or *.wav files.
! WSPR-LF is a potential WSPR-like mode intended for use at LF and MF.
! It uses an LDPC (300,60) code, OQPSK modulation, and 5 minute T/R sequences.
! Reception and Demodulation algorithm:
! 1. Compute coarse spectrum; find fc1 = approx carrier freq
! 2. Mix from fc1 to 0; LPF at +/- 0.75*R
! 3. Square, FFT; find peaks near -R/2 and +R/2 to get fc2
! 4. Mix from fc2 to 0
! 5. Fit cb13 (central part of csync) to c -> lag, phase
! 6. Fit complex ploynomial for channel equalization
! 7. Get soft bits from equalized data
! Still to do: find and decode more than one signal in the specified passband.
include 'wsprlf_params.f90'
parameter (NMAX=300*12000)
character arg*8,message*22,cbits*50,infile*80,fname*16,datetime*11
character*120 data_dir
complex csync(0:NZ-1) !Sync symbols only, from cbb
complex c(0:NZ-1) !Complex waveform
complex c1(0:NZ-1) !Complex waveform
complex zz(NS+ND) !Complex symbol values (intermediate)
complex z
real*8 fMHz
real rxdata(ND),llr(ND) !Soft symbols
real pp(2*NSPS) !Shaped pulse for OQPSK
real a(5) !For twkfreq1
real aa(20),bb(20) !Fitted polyco's
real fpks(20)
integer id(NS+ND) !NRZ values (+/-1) for Sync and Data
integer ierror(NS+ND)
integer isync(48) !Long sync vector
integer ib13(13) !Barker 13 code
integer ihdr(11)
integer*8 n8
integer*2 iwave(NMAX) !Generated full-length waveform
integer*1 idat(7)
integer*1 decoded(KK),apmask(ND),cw(ND)
data ib13/1,1,1,1,1,-1,-1,1,1,-1,1,-1,1/
nargs=iargc()
if(nargs.lt.2) then
print*,'Usage: wspr5d [-a <data_dir>] [-f fMHz] file1 [file2 ...]'
go to 999
endif
iarg=1
data_dir="."
call getarg(iarg,arg)
if(arg(1:2).eq.'-a') then
call getarg(iarg+1,data_dir)
iarg=iarg+2
endif
call getarg(iarg,arg)
if(arg(1:2).eq.'-f') then
call getarg(iarg+1,arg)
read(arg,*) fMHz
iarg=iarg+2
endif
open(13,file=trim(data_dir)//'/ALL_WSPR.TXT',status='unknown', &
position='append')
maxn=8 !Default value
twopi=8.0*atan(1.0)
fs=NSPS*12000.0/NSPS0 !Sample rate
dt=1.0/fs !Sample interval (s)
tt=NSPS*dt !Duration of "itone" symbols (s)
ts=2*NSPS*dt !Duration of OQPSK symbols (s)
baud=1.0/tt !Keying rate for "itone" symbols (baud)
txt=NZ*dt !Transmission length (s)
do i=1,N2 !Half-sine pulse shape
pp(i)=sin(0.5*(i-1)*twopi/(2*NSPS))
enddo
n8=z'cbf089223a51'
do i=1,48
isync(i)=-1
if(iand(n8,1).eq.1) isync(i)=1
n8=n8/2
enddo
! Define array id() for sync symbols
id=0
do j=1,48 !First group of 48
id(2*j-1)=2*isync(j)
enddo
do j=1,13 !Barker 13 code
id(j+96)=2*ib13(j)
enddo
do j=1,48 !Second group of 48
id(2*j+109)=2*isync(j)
enddo
csync=0.
do j=1,205
if(abs(id(j)).eq.2) then
ia=nint((j-0.5)*N2)
ib=ia+N2-1
csync(ia:ib)=pp*id(j)/abs(id(j))
endif
enddo
do ifile=iarg,nargs
call getarg(ifile,infile)
open(10,file=infile,status='old',access='stream')
j1=index(infile,'.c5')
j2=index(infile,'.wav')
if(j1.gt.0) then
read(10,end=999) fname,ntrmin,fMHz,c
read(fname(8:11),*) nutc
write(datetime,'(i11)') nutc
else if(j2.gt.0) then
read(10,end=999) ihdr,iwave
read(infile(j2-4:j2-1),*) nutc
datetime=infile(j2-11:j2-1)
call wspr5_downsample(iwave,c)
else
print*,'Wrong file format?'
go to 999
endif
close(10)
fa=100.0
fb=150.0
call getfc1w(c,fs,fa,fb,fc1,xsnr) !First approx for freq
npeaks=20
call getfc2w(c,csync,npeaks,fs,fc1,fpks) !Refined freq
a(1)=-fc1
a(2:5)=0.
call twkfreq1(c,NZ,fs,a,c) !Mix c down by fc1+fc2
! Find time offset xdt
amax=0.
jpk=0
iaa=0
ibb=NZ-1
jmax=1260
do j=-jmax,jmax,NSPS/8
ia=j
ib=NZ-1+j
if(ia.lt.0) then
ia=0
iaa=-j
else
iaa=0
endif
if(ib.gt.NZ-1) then
ib=NZ-1
ibb=NZ-1-j
endif
z=sum(c(ia:ib)*conjg(csync(iaa:ibb)))
write(51,*) j/fs,real(z),imag(z)
if(abs(z).gt.amax) then
amax=abs(z)
jpk=j
endif
enddo
xdt=jpk/fs
xdt=1.0
jpk=fs*xdt
do i=0,NZ-1
j=i+jpk
if(j.ge.0 .and. j.lt.NZ) c1(i)=c(j)
enddo
nterms=maxn
do itry=1,npeaks
nhard0=0
nhardsync0=0
ifer=1
a(1)=-fpks(itry)
a(2:5)=0.
call twkfreq1(c1,NZ,fs,a,c) !Mix c1 into c
call cpolyfitw(c,pp,id,maxn,aa,bb,zz,nhs)
call msksoftsymw(zz,aa,bb,id,nterms,ierror,rxdata,nhard0,nhardsync0)
if(nhardsync0.gt.35) cycle
rxav=sum(rxdata)/ND
rx2av=sum(rxdata*rxdata)/ND
rxsig=sqrt(rx2av-rxav*rxav)
rxdata=rxdata/rxsig
ss=0.84
llr=2.0*rxdata/(ss*ss)
apmask=0
max_iterations=40
ifer=0
call bpdecode300(llr,apmask,max_iterations,decoded,niterations,cw)
if(niterations.lt.0) call osd300(llr,4,decoded,niterations,cw)
nbadcrc=0
if(niterations.ge.0) call chkcrc10(decoded,nbadcrc)
if(niterations.lt.0 .or. nbadcrc.ne.0) ifer=1
if(ifer.eq.0) exit
enddo !Freq dither loop
message=' '
if(ifer.eq.0) then
write(cbits,1100) decoded(1:50)
1100 format(50i1)
read(cbits,1102) idat
1102 format(6b8,b2)
idat(7)=ishft(idat(7),6)
call wqdecode(idat,message,itype)
nsnr=nint(xsnr)
! freq=fMHz + 1.d-6*(fc1+fc2)
freq=fMHz + 1.d-6*(fc1+fpks(itry))
nfdot=0
write(13,1110) datetime,0,nsnr,xdt,freq,message,nfdot
1110 format(a11,2i4,f6.2,f12.7,2x,a22,i3)
write(*,1112) datetime(8:11),nsnr,xdt,freq,nfdot,message,itry
1112 format(a4,i4,f5.1,f11.6,i3,2x,a22,i4)
endif
enddo ! ifile loop
write(*,1120)
1120 format("<DecodeFinished>")
999 end program wspr5d
@@ -0,0 +1,123 @@
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/quote.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template< typename T, bool has_type_ >
struct quote_impl
: T
{
};
template< typename T >
struct quote_impl< T,false >
{
typedef T type;
};
template<
template< typename P1 > class F
, typename Tag = void_
>
struct quote1
{
template< typename U1 > struct apply
: quote_impl<
F<U1>
, aux::has_type< F<U1> >::value
>
{
};
};
template<
template< typename P1, typename P2 > class F
, typename Tag = void_
>
struct quote2
{
template< typename U1, typename U2 > struct apply
: quote_impl<
F< U1,U2 >
, aux::has_type< F< U1,U2 > >::value
>
{
};
};
template<
template< typename P1, typename P2, typename P3 > class F
, typename Tag = void_
>
struct quote3
{
template< typename U1, typename U2, typename U3 > struct apply
: quote_impl<
F< U1,U2,U3 >
, aux::has_type< F< U1,U2,U3 > >::value
>
{
};
};
template<
template< typename P1, typename P2, typename P3, typename P4 > class F
, typename Tag = void_
>
struct quote4
{
template<
typename U1, typename U2, typename U3, typename U4
>
struct apply
: quote_impl<
F< U1,U2,U3,U4 >
, aux::has_type< F< U1,U2,U3,U4 > >::value
>
{
};
};
template<
template<
typename P1, typename P2, typename P3, typename P4
, typename P5
>
class F
, typename Tag = void_
>
struct quote5
{
template<
typename U1, typename U2, typename U3, typename U4
, typename U5
>
struct apply
: quote_impl<
F< U1,U2,U3,U4,U5 >
, aux::has_type< F< U1,U2,U3,U4,U5 > >::value
>
{
};
};
}}
@@ -0,0 +1,27 @@
subroutine fix_contest_msg(mycall,mygrid,hiscall,msg)
! If msg is "mycall hiscall grid1" and distance from mygrid to grid1 is more
! thsn 10000 km, change "grid1" to "R grid2" where grid2 is the antipodes
! of grid1.
character*6 mycall,mygrid,hiscall
character*22 msg
character*6 g1,g2
logical isgrid
n=len(trim(msg))
g1=msg(n-3:n)//' '
if(isgrid(g1)) then
call azdist(mygrid,g1,0.d0,nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter)
if(ndkm.gt.10000) then
call grid2deg(g1,dlong,dlat)
dlong=dlong+180.0
if(dlong.gt.180.0) dlong=dlong-360.0
dlat=-dlat
call deg2grid(dlong,dlat,g2)
msg=msg(1:n-4)//'R '//g2(1:4)
endif
endif
return
end subroutine fix_contest_msg
@@ -0,0 +1,77 @@
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
#define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
#include <boost/config.hpp>
#if defined(BOOST_MSVC)
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/is_pointer.hpp>
#endif
namespace boost {
#if BOOST_WORKAROUND(BOOST_MSVC, < 1900)
namespace detail{
//
// We need all this crazy indirection because a type such as:
//
// T (*const)(U)
//
// Does not bind to a <T*> or <T*const> partial specialization with VC10 and earlier
//
template <class T>
struct remove_pointer_imp
{
typedef T type;
};
template <class T>
struct remove_pointer_imp<T*>
{
typedef T type;
};
template <class T, bool b>
struct remove_pointer_imp3
{
typedef typename remove_pointer_imp<typename boost::remove_cv<T>::type>::type type;
};
template <class T>
struct remove_pointer_imp3<T, false>
{
typedef T type;
};
template <class T>
struct remove_pointer_imp2
{
typedef typename remove_pointer_imp3<T, ::boost::is_pointer<T>::value>::type type;
};
}
template <class T> struct remove_pointer{ typedef typename boost::detail::remove_pointer_imp2<T>::type type; };
#else
template <class T> struct remove_pointer{ typedef T type; };
template <class T> struct remove_pointer<T*>{ typedef T type; };
template <class T> struct remove_pointer<T*const>{ typedef T type; };
template <class T> struct remove_pointer<T*volatile>{ typedef T type; };
template <class T> struct remove_pointer<T*const volatile>{ typedef T type; };
#endif
} // namespace boost
#endif // BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
@@ -0,0 +1,328 @@
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/list_c.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename T, long C0 = LONG_MAX, long C1 = LONG_MAX, long C2 = LONG_MAX
, long C3 = LONG_MAX, long C4 = LONG_MAX, long C5 = LONG_MAX
, long C6 = LONG_MAX, long C7 = LONG_MAX, long C8 = LONG_MAX
, long C9 = LONG_MAX, long C10 = LONG_MAX, long C11 = LONG_MAX
, long C12 = LONG_MAX, long C13 = LONG_MAX, long C14 = LONG_MAX
, long C15 = LONG_MAX, long C16 = LONG_MAX, long C17 = LONG_MAX
, long C18 = LONG_MAX, long C19 = LONG_MAX
>
struct list_c;
template<
typename T
>
struct list_c<
T, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list0_c<T>
{
typedef typename list0_c<T>::type type;
};
template<
typename T, long C0
>
struct list_c<
T, C0, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list1_c< T,C0 >
{
typedef typename list1_c< T,C0 >::type type;
};
template<
typename T, long C0, long C1
>
struct list_c<
T, C0, C1, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list2_c< T,C0,C1 >
{
typedef typename list2_c< T,C0,C1 >::type type;
};
template<
typename T, long C0, long C1, long C2
>
struct list_c<
T, C0, C1, C2, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list3_c< T,C0,C1,C2 >
{
typedef typename list3_c< T,C0,C1,C2 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3
>
struct list_c<
T, C0, C1, C2, C3, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list4_c< T,C0,C1,C2,C3 >
{
typedef typename list4_c< T,C0,C1,C2,C3 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4
>
struct list_c<
T, C0, C1, C2, C3, C4, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list5_c< T,C0,C1,C2,C3,C4 >
{
typedef typename list5_c< T,C0,C1,C2,C3,C4 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX
>
: list6_c< T,C0,C1,C2,C3,C4,C5 >
{
typedef typename list6_c< T,C0,C1,C2,C3,C4,C5 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX
>
: list7_c< T,C0,C1,C2,C3,C4,C5,C6 >
{
typedef typename list7_c< T,C0,C1,C2,C3,C4,C5,C6 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX
>
: list8_c< T,C0,C1,C2,C3,C4,C5,C6,C7 >
{
typedef typename list8_c< T,C0,C1,C2,C3,C4,C5,C6,C7 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX
>
: list9_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8 >
{
typedef typename list9_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
, LONG_MAX
>
: list10_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9 >
{
typedef typename list10_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, LONG_MAX, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list11_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10 >
{
typedef typename list11_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list12_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 >
{
typedef typename list12_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, LONG_MAX
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list13_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12 >
{
typedef typename list13_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
, long C13
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list14_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13
>
{
typedef typename list14_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
, long C13, long C14
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list15_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
>
{
typedef typename list15_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
, long C13, long C14, long C15
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, LONG_MAX, LONG_MAX, LONG_MAX, LONG_MAX
>
: list16_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15
>
{
typedef typename list16_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
, long C13, long C14, long C15, long C16
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, C16, LONG_MAX, LONG_MAX, LONG_MAX
>
: list17_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, C16
>
{
typedef typename list17_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
, long C13, long C14, long C15, long C16, long C17
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, C16, C17, LONG_MAX, LONG_MAX
>
: list18_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, C16, C17
>
{
typedef typename list18_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17 >::type type;
};
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
, long C13, long C14, long C15, long C16, long C17, long C18
>
struct list_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, C16, C17, C18, LONG_MAX
>
: list19_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, C16, C17, C18
>
{
typedef typename list19_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18 >::type type;
};
/// primary template (not a specialization!)
template<
typename T, long C0, long C1, long C2, long C3, long C4, long C5
, long C6, long C7, long C8, long C9, long C10, long C11, long C12
, long C13, long C14, long C15, long C16, long C17, long C18, long C19
>
struct list_c
: list20_c<
T, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14
, C15, C16, C17, C18, C19
>
{
typedef typename list20_c< T,C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19 >::type type;
};
}}
@@ -0,0 +1,13 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(FUSION_INCLUDE_END)
#define FUSION_INCLUDE_END
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#endif
@@ -0,0 +1,61 @@
// -*- Mode: C++ -*-
#ifndef LogQSO_H
#define LogQSO_H
#ifdef QT5
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QScopedPointer>
#include "Radio.hpp"
namespace Ui {
class LogQSO;
}
class QSettings;
class LogQSO : public QDialog
{
Q_OBJECT
public:
explicit LogQSO(QString const& programTitle, QSettings *, QWidget *parent = 0);
~LogQSO();
void initLogQSO(QString hisCall, QString hisGrid, QString mode,
QString rptSent, QString rptRcvd, QDateTime dateTimeOn,QDateTime dateTimeOff,
Radio::Frequency dialFreq, QString myCall, QString myGrid,
bool noSuffix, bool toRTTY, bool dBtoComments);
public slots:
void accept();
signals:
void acceptQSO (QDateTime const& QSO_date_off, QString const& call, QString const& grid
, Radio::Frequency dial_freq, QString const& mode
, QString const& rpt_sent, QString const& rpt_received
, QString const& tx_power, QString const& comments
, QString const& name, QDateTime const& QSO_date_on);
protected:
void hideEvent (QHideEvent *);
private:
void loadSettings ();
void storeSettings () const;
QScopedPointer<Ui::LogQSO> ui;
QSettings * m_settings;
QString m_txPower;
QString m_comments;
Radio::Frequency m_dialFreq;
QString m_myCall;
QString m_myGrid;
QDateTime m_dateTimeOn;
QDateTime m_dateTimeOff;
};
#endif // LogQSO_H
@@ -0,0 +1,55 @@
// Copyright David Abrahams 2001.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef REGISTRY_DWA20011127_HPP
# define REGISTRY_DWA20011127_HPP
# include <boost/python/type_id.hpp>
# include <boost/python/converter/to_python_function_type.hpp>
# include <boost/python/converter/rvalue_from_python_data.hpp>
# include <boost/python/converter/constructor_function.hpp>
# include <boost/python/converter/convertible_function.hpp>
namespace boost { namespace python { namespace converter {
struct registration;
// This namespace acts as a sort of singleton
namespace registry
{
// Get the registration corresponding to the type, creating it if necessary
BOOST_PYTHON_DECL registration const& lookup(type_info);
// Get the registration corresponding to the type, creating it if
// necessary. Use this first when the type is a shared_ptr.
BOOST_PYTHON_DECL registration const& lookup_shared_ptr(type_info);
// Return a pointer to the corresponding registration, if one exists
BOOST_PYTHON_DECL registration const* query(type_info);
BOOST_PYTHON_DECL void insert(to_python_function_t, type_info, PyTypeObject const* (*to_python_target_type)() = 0);
// Insert an lvalue from_python converter
BOOST_PYTHON_DECL void insert(convertible_function, type_info, PyTypeObject const* (*expected_pytype)() = 0);
// Insert an rvalue from_python converter
BOOST_PYTHON_DECL void insert(
convertible_function
, constructor_function
, type_info
, PyTypeObject const* (*expected_pytype)() = 0
);
// Insert an rvalue from_python converter at the tail of the
// chain. Used for implicit conversions
BOOST_PYTHON_DECL void push_back(
convertible_function
, constructor_function
, type_info
, PyTypeObject const* (*expected_pytype)() = 0
);
}
}}} // namespace boost::python::converter
#endif // REGISTRY_DWA20011127_HPP
@@ -0,0 +1,137 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// basic_text_iprimitive.ipp:
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // size_t, NULL
#include <limits> // NULL
#include <boost/config.hpp>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::size_t;
} // namespace std
#endif
#include <boost/serialization/throw_exception.hpp>
#include <boost/archive/basic_text_iprimitive.hpp>
#include <boost/archive/iterators/remove_whitespace.hpp>
#include <boost/archive/iterators/istream_iterator.hpp>
#include <boost/archive/iterators/binary_from_base64.hpp>
#include <boost/archive/iterators/transform_width.hpp>
namespace boost {
namespace archive {
namespace detail {
template<class CharType>
static inline bool is_whitespace(CharType c);
template<>
inline bool is_whitespace(char t){
return 0 != std::isspace(t);
}
#ifndef BOOST_NO_CWCHAR
template<>
inline bool is_whitespace(wchar_t t){
return 0 != std::iswspace(t);
}
#endif
} // detail
// translate base64 text into binary and copy into buffer
// until buffer is full.
template<class IStream>
BOOST_ARCHIVE_OR_WARCHIVE_DECL void
basic_text_iprimitive<IStream>::load_binary(
void *address,
std::size_t count
){
typedef typename IStream::char_type CharType;
if(0 == count)
return;
BOOST_ASSERT(
static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)())
> (count + sizeof(CharType) - 1)/sizeof(CharType)
);
if(is.fail())
boost::serialization::throw_exception(
archive_exception(archive_exception::input_stream_error)
);
// convert from base64 to binary
typedef typename
iterators::transform_width<
iterators::binary_from_base64<
iterators::remove_whitespace<
iterators::istream_iterator<CharType>
>
,typename IStream::int_type
>
,8
,6
,CharType
>
binary;
binary i = binary(iterators::istream_iterator<CharType>(is));
char * caddr = static_cast<char *>(address);
// take care that we don't increment anymore than necessary
while(count-- > 0){
*caddr++ = static_cast<char>(*i++);
}
// skip over any excess input
for(;;){
typename IStream::int_type r;
r = is.get();
if(is.eof())
break;
if(detail::is_whitespace(static_cast<CharType>(r)))
break;
}
}
template<class IStream>
BOOST_ARCHIVE_OR_WARCHIVE_DECL
basic_text_iprimitive<IStream>::basic_text_iprimitive(
IStream &is_,
bool no_codecvt
) :
is(is_),
flags_saver(is_),
precision_saver(is_),
#ifndef BOOST_NO_STD_LOCALE
codecvt_null_facet(1),
archive_locale(is.getloc(), & codecvt_null_facet),
locale_saver(is)
{
if(! no_codecvt){
is_.sync();
is_.imbue(archive_locale);
}
is_ >> std::noboolalpha;
}
#else
{}
#endif
template<class IStream>
BOOST_ARCHIVE_OR_WARCHIVE_DECL
basic_text_iprimitive<IStream>::~basic_text_iprimitive(){
}
} // namespace archive
} // namespace boost
@@ -0,0 +1,112 @@
#ifndef BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
#define BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2002-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id$
// $Date$
// $Revision$
#include <boost/mpl/not.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/sequence_tag_fwd.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/void.hpp>
#include <boost/mpl/aux_/has_tag.hpp>
#include <boost/mpl/aux_/has_begin.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/config/eti.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
# include <boost/mpl/aux_/msvc_is_class.hpp>
#elif BOOST_WORKAROUND(BOOST_MSVC, == 1300)
# include <boost/type_traits/is_class.hpp>
#endif
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace mpl {
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
namespace aux {
// agurt, 11/jun/03:
// MSVC 6.5/7.0 fails if 'has_begin' is instantiated on a class type that has a
// 'begin' member that doesn't name a type; e.g. 'has_begin< std::vector<int> >'
// would fail; requiring 'T' to have _both_ 'tag' and 'begin' members workarounds
// the issue for most real-world cases
template< typename T > struct is_sequence_impl
: and_<
identity< aux::has_tag<T> >
, identity< aux::has_begin<T> >
>
{
};
} // namespace aux
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct is_sequence
: if_<
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
aux::msvc_is_class<T>
#else
boost::is_class<T>
#endif
, aux::is_sequence_impl<T>
, bool_<false>
>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
};
#elif defined(BOOST_MPL_CFG_NO_HAS_XXX)
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct is_sequence
: bool_<false>
{
};
#else
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct is_sequence
: not_< is_same< typename begin<T>::type, void_ > >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1, is_sequence, (T))
};
#endif // BOOST_MSVC
#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
template<> struct is_sequence<int>
: bool_<false>
{
};
#endif
BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, is_sequence)
}}
#endif // BOOST_MPL_IS_SEQUENCE_HPP_INCLUDED
@@ -0,0 +1,9 @@
0; 0; 0
0; 0; 59
0; 0;123
131; 0;179
235; 0; 75
255; 43; 43
255;215;111
255;255;183
255;255;255
@@ -0,0 +1,35 @@
/*=============================================================================
Copyright (c) 2001-2008 Joel de Guzman
Copyright (c) 2001-2008 Hartmut Kaiser
http://spirit.sourceforge.net/
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#if !defined(SPIRIT_CLASSIC_NAMESPACE_HPP)
#define SPIRIT_CLASSIC_NAMESPACE_HPP
#if defined(BOOST_SPIRIT_USE_OLD_NAMESPACE)
// Use the old namespace for Spirit.Classic, everything is located in the
// namespace boost::spirit.
// This is in place for backwards compatibility with Spirit V1.8.x. Don't use
// it when combining Spirit.Classic with other parts of the library
#define BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN /*namespace classic {*/
#define BOOST_SPIRIT_CLASSIC_NS boost::spirit/*::classic*/
#define BOOST_SPIRIT_CLASSIC_NAMESPACE_END /*}*/
#else
// This is the normal (and suggested) mode of operation when using
// Spirit.Classic. Everything will be located in the namespace
// boost::spirit::classic, avoiding name clashes with other parts of Spirit.
#define BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN namespace classic {
#define BOOST_SPIRIT_CLASSIC_NS boost::spirit::classic
#define BOOST_SPIRIT_CLASSIC_NAMESPACE_END }
#endif
#endif
@@ -0,0 +1,19 @@
// -*- Mode: C++ -*-
#ifndef GETFILE_H
#define GETFILE_H
#include <QString>
#include <QFile>
#include <QDebug>
void getfile(QString fname, int ntrperiod);
float gran();
//int ptt(int* nport, int* ntx, int* iptt);
int ptt(int nport, int ntx, int* iptt, int* nopen);
extern "C" {
int ptt_(int nport, int ntx, int* iptt, int* nopen);
void wav12_(short d2[], short d1[], int* nbytes, short* nbitsam2);
}
#endif // GETFILE_H
@@ -0,0 +1,211 @@
// Copyright David Abrahams 2002.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef DEF_HELPER_DWA200287_HPP
# define DEF_HELPER_DWA200287_HPP
# include <boost/python/args.hpp>
# include <boost/type_traits/same_traits.hpp>
# include <boost/python/detail/indirect_traits.hpp>
# include <boost/mpl/not.hpp>
# include <boost/mpl/and.hpp>
# include <boost/mpl/or.hpp>
# include <boost/type_traits/add_reference.hpp>
# include <boost/mpl/lambda.hpp>
# include <boost/mpl/apply.hpp>
# include <boost/tuple/tuple.hpp>
# include <boost/python/detail/not_specified.hpp>
# include <boost/python/detail/def_helper_fwd.hpp>
namespace boost { namespace python {
struct default_call_policies;
namespace detail
{
// tuple_extract<Tuple,Predicate>::extract(t) returns the first
// element of a Tuple whose type E satisfies the given Predicate
// applied to add_reference<E>. The Predicate must be an MPL
// metafunction class.
template <class Tuple, class Predicate>
struct tuple_extract;
// Implementation class for when the tuple's head type does not
// satisfy the Predicate
template <bool matched>
struct tuple_extract_impl
{
template <class Tuple, class Predicate>
struct apply
{
typedef typename Tuple::head_type result_type;
static typename Tuple::head_type extract(Tuple const& x)
{
return x.get_head();
}
};
};
// Implementation specialization for when the tuple's head type
// satisfies the predicate
template <>
struct tuple_extract_impl<false>
{
template <class Tuple, class Predicate>
struct apply
{
// recursive application of tuple_extract on the tail of the tuple
typedef tuple_extract<typename Tuple::tail_type, Predicate> next;
typedef typename next::result_type result_type;
static result_type extract(Tuple const& x)
{
return next::extract(x.get_tail());
}
};
};
// A metafunction which selects a version of tuple_extract_impl to
// use for the implementation of tuple_extract
template <class Tuple, class Predicate>
struct tuple_extract_base_select
{
typedef typename Tuple::head_type head_type;
typedef typename mpl::apply1<Predicate, typename add_reference<head_type>::type>::type match_t;
BOOST_STATIC_CONSTANT(bool, match = match_t::value);
typedef typename tuple_extract_impl<match>::template apply<Tuple,Predicate> type;
};
template <class Tuple, class Predicate>
struct tuple_extract
: tuple_extract_base_select<
Tuple
, typename mpl::lambda<Predicate>::type
>::type
{
};
//
// Specialized extractors for the docstring, keywords, CallPolicies,
// and default implementation of virtual functions
//
template <class Tuple>
struct doc_extract
: tuple_extract<
Tuple
, mpl::not_<
mpl::or_<
indirect_traits::is_reference_to_class<mpl::_1>
, indirect_traits::is_reference_to_member_function_pointer<mpl::_1 >
>
>
>
{
};
template <class Tuple>
struct keyword_extract
: tuple_extract<Tuple, is_reference_to_keywords<mpl::_1 > >
{
};
template <class Tuple>
struct policy_extract
: tuple_extract<
Tuple
, mpl::and_<
mpl::not_<is_same<not_specified const&,mpl::_1> >
, indirect_traits::is_reference_to_class<mpl::_1 >
, mpl::not_<is_reference_to_keywords<mpl::_1 > >
>
>
{
};
template <class Tuple>
struct default_implementation_extract
: tuple_extract<
Tuple
, indirect_traits::is_reference_to_member_function_pointer<mpl::_1 >
>
{
};
//
// A helper class for decoding the optional arguments to def()
// invocations, which can be supplied in any order and are
// discriminated by their type properties. The template parameters
// are expected to be the types of the actual (optional) arguments
// passed to def().
//
template <class T1, class T2, class T3, class T4>
struct def_helper
{
// A tuple type which begins with references to the supplied
// arguments and ends with actual representatives of the default
// types.
typedef boost::tuples::tuple<
T1 const&
, T2 const&
, T3 const&
, T4 const&
, default_call_policies
, detail::keywords<0>
, char const*
, void(not_specified::*)() // A function pointer type which is never an
// appropriate default implementation
> all_t;
// Constructors; these initialize an member of the tuple type
// shown above.
def_helper(T1 const& a1) : m_all(a1,m_nil,m_nil,m_nil) {}
def_helper(T1 const& a1, T2 const& a2) : m_all(a1,a2,m_nil,m_nil) {}
def_helper(T1 const& a1, T2 const& a2, T3 const& a3) : m_all(a1,a2,a3,m_nil) {}
def_helper(T1 const& a1, T2 const& a2, T3 const& a3, T4 const& a4) : m_all(a1,a2,a3,a4) {}
private: // types
typedef typename default_implementation_extract<all_t>::result_type default_implementation_t;
public: // Constants which can be used for static assertions.
// Users must not supply a default implementation for non-class
// methods.
BOOST_STATIC_CONSTANT(
bool, has_default_implementation = (
!is_same<default_implementation_t, void(not_specified::*)()>::value));
public: // Extractor functions which pull the appropriate value out
// of the tuple
char const* doc() const
{
return doc_extract<all_t>::extract(m_all);
}
typename keyword_extract<all_t>::result_type keywords() const
{
return keyword_extract<all_t>::extract(m_all);
}
typename policy_extract<all_t>::result_type policies() const
{
return policy_extract<all_t>::extract(m_all);
}
default_implementation_t default_implementation() const
{
return default_implementation_extract<all_t>::extract(m_all);
}
private: // data members
all_t m_all;
not_specified m_nil; // for filling in not_specified slots
};
}
}} // namespace boost::python::detail
#endif // DEF_HELPER_DWA200287_HPP