Initial Commit
This commit is contained in:
@@ -0,0 +1,422 @@
|
||||
subroutine multimode_decoder(ss,id2,params,nfsample)
|
||||
|
||||
!$ use omp_lib
|
||||
use prog_args
|
||||
use timer_module, only: timer
|
||||
use jt4_decode
|
||||
use jt65_decode
|
||||
use jt9_decode
|
||||
use ft8_decode
|
||||
|
||||
include 'jt9com.f90'
|
||||
include 'timer_common.inc'
|
||||
|
||||
type, extends(jt4_decoder) :: counting_jt4_decoder
|
||||
integer :: decoded
|
||||
end type counting_jt4_decoder
|
||||
|
||||
type, extends(jt65_decoder) :: counting_jt65_decoder
|
||||
integer :: decoded
|
||||
end type counting_jt65_decoder
|
||||
|
||||
type, extends(jt9_decoder) :: counting_jt9_decoder
|
||||
integer :: decoded
|
||||
end type counting_jt9_decoder
|
||||
|
||||
type, extends(ft8_decoder) :: counting_ft8_decoder
|
||||
integer :: decoded
|
||||
end type counting_ft8_decoder
|
||||
|
||||
real ss(184,NSMAX)
|
||||
logical baddata,newdat65,newdat9,single_decode,bVHF,bad0
|
||||
integer*2 id2(NTMAX*12000)
|
||||
type(params_block) :: params
|
||||
real*4 dd(NTMAX*12000)
|
||||
save
|
||||
type(counting_jt4_decoder) :: my_jt4
|
||||
type(counting_jt65_decoder) :: my_jt65
|
||||
type(counting_jt9_decoder) :: my_jt9
|
||||
type(counting_ft8_decoder) :: my_ft8
|
||||
|
||||
! initialize decode counts
|
||||
my_jt4%decoded = 0
|
||||
my_jt65%decoded = 0
|
||||
my_jt9%decoded = 0
|
||||
my_ft8%decoded = 0
|
||||
|
||||
single_decode=iand(params%nexp_decode,32).ne.0
|
||||
bVHF=iand(params%nexp_decode,64).ne.0
|
||||
if(mod(params%nranera,2).eq.0) ntrials=10**(params%nranera/2)
|
||||
if(mod(params%nranera,2).eq.1) ntrials=3*10**(params%nranera/2)
|
||||
if(params%nranera.eq.0) ntrials=0
|
||||
|
||||
nfail=0
|
||||
10 if (params%nagain) then
|
||||
open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', &
|
||||
position='append',iostat=ios)
|
||||
else
|
||||
open(13,file=trim(temp_dir)//'/decoded.txt',status='unknown', &
|
||||
iostat=ios)
|
||||
end if
|
||||
if(ios.ne.0) then
|
||||
nfail=nfail+1
|
||||
if(nfail.le.3) then
|
||||
call sleep_msec(100)
|
||||
go to 10
|
||||
endif
|
||||
endif
|
||||
|
||||
if(params%nmode.eq.8) then
|
||||
! We're in FT8 mode
|
||||
call timer('decft8 ',0)
|
||||
call my_ft8%decode(ft8_decoded,ss,id2,params%nfqso, &
|
||||
newdat9,params%npts8,params%nutc,params%nfa,params%nfsplit, &
|
||||
params%nfb,params%ntol,params%nzhsym,logical(params%nagain), &
|
||||
params%ndepth,params%nmode,params%nsubmode,params%nexp_decode)
|
||||
call timer('decft8 ',1)
|
||||
go to 800
|
||||
endif
|
||||
|
||||
rms=sqrt(dot_product(float(id2(300000:310000)), &
|
||||
float(id2(300000:310000)))/10000.0)
|
||||
if(rms.lt.2.0) go to 800
|
||||
|
||||
! Zap data at start that might come from T/R switching transient?
|
||||
nadd=100
|
||||
k=0
|
||||
bad0=.false.
|
||||
do i=1,240
|
||||
sq=0.
|
||||
do n=1,nadd
|
||||
k=k+1
|
||||
sq=sq + float(id2(k))**2
|
||||
enddo
|
||||
rms=sqrt(sq/nadd)
|
||||
if(rms.gt.10000.0) then
|
||||
bad0=.true.
|
||||
kbad=k
|
||||
rmsbad=rms
|
||||
endif
|
||||
enddo
|
||||
if(bad0) then
|
||||
nz=min(NTMAX*12000,kbad+100)
|
||||
! id2(1:nz)=0 ! temporarily disabled as it can breaak the JT9 decoder, maybe others
|
||||
endif
|
||||
|
||||
if(params%nmode.eq.4 .or. params%nmode.eq.65) open(14,file=trim(temp_dir)// &
|
||||
'/avemsg.txt',status='unknown')
|
||||
if(params%nmode.eq.164) open(17,file=trim(temp_dir)//'/red.dat', &
|
||||
status='unknown')
|
||||
|
||||
if(params%nmode.eq.4) then
|
||||
jz=52*nfsample
|
||||
if(params%newdat) then
|
||||
if(nfsample.eq.12000) call wav11(id2,jz,dd)
|
||||
if(nfsample.eq.11025) dd(1:jz)=id2(1:jz)
|
||||
endif
|
||||
call my_jt4%decode(jt4_decoded,dd,jz,params%nutc,params%nfqso, &
|
||||
params%ntol,params%emedelay,params%dttol,logical(params%nagain), &
|
||||
params%ndepth,logical(params%nclearave),params%minsync, &
|
||||
params%minw,params%nsubmode,params%mycall,params%hiscall, &
|
||||
params%hisgrid,params%nlist,params%listutc,jt4_average)
|
||||
go to 800
|
||||
endif
|
||||
|
||||
npts65=52*12000
|
||||
if(params%nmode.eq.164) npts65=54*12000
|
||||
if(baddata(id2,npts65)) then
|
||||
nsynced=0
|
||||
ndecoded=0
|
||||
go to 800
|
||||
endif
|
||||
|
||||
ntol65=params%ntol !### is this OK? ###
|
||||
newdat65=params%newdat
|
||||
newdat9=params%newdat
|
||||
|
||||
!$call omp_set_dynamic(.true.)
|
||||
!$omp parallel sections num_threads(2) copyin(/timer_private/) shared(ndecoded) if(.true.) !iif() needed on Mac
|
||||
|
||||
!$omp section
|
||||
if(params%nmode.eq.65 .or. params%nmode.eq.164 .or. &
|
||||
(params%nmode.eq.(65+9) .and. params%ntxmode.eq.65)) then
|
||||
! We're in JT65 or QRA64 mode, or should do JT65 first
|
||||
|
||||
if(newdat65) dd(1:npts65)=id2(1:npts65)
|
||||
nf1=params%nfa
|
||||
nf2=params%nfb
|
||||
call timer('jt65a ',0)
|
||||
call my_jt65%decode(jt65_decoded,dd,npts65,newdat65,params%nutc, &
|
||||
nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, &
|
||||
logical(params%nagain),params%n2pass,logical(params%nrobust), &
|
||||
ntrials,params%naggressive,params%ndepth,params%emedelay, &
|
||||
logical(params%nclearave),params%mycall,params%hiscall, &
|
||||
params%hisgrid,params%nexp_decode)
|
||||
call timer('jt65a ',1)
|
||||
|
||||
else if(params%nmode.eq.9 .or. (params%nmode.eq.(65+9) .and. params%ntxmode.eq.9)) then
|
||||
! We're in JT9 mode, or should do JT9 first
|
||||
call timer('decjt9 ',0)
|
||||
call my_jt9%decode(jt9_decoded,ss,id2,params%nfqso, &
|
||||
newdat9,params%npts8,params%nfa,params%nfsplit,params%nfb, &
|
||||
params%ntol,params%nzhsym,logical(params%nagain),params%ndepth, &
|
||||
params%nmode,params%nsubmode,params%nexp_decode)
|
||||
call timer('decjt9 ',1)
|
||||
endif
|
||||
|
||||
!$omp section
|
||||
if(params%nmode.eq.(65+9)) then !Do the other mode (we're in dual mode)
|
||||
if (params%ntxmode.eq.9) then
|
||||
if(newdat65) dd(1:npts65)=id2(1:npts65)
|
||||
nf1=params%nfa
|
||||
nf2=params%nfb
|
||||
call timer('jt65a ',0)
|
||||
call my_jt65%decode(jt65_decoded,dd,npts65,newdat65,params%nutc, &
|
||||
nf1,nf2,params%nfqso,ntol65,params%nsubmode,params%minsync, &
|
||||
logical(params%nagain),params%n2pass,logical(params%nrobust), &
|
||||
ntrials,params%naggressive,params%ndepth,params%emedelay, &
|
||||
logical(params%nclearave),params%mycall,params%hiscall, &
|
||||
params%hisgrid,params%nexp_decode)
|
||||
call timer('jt65a ',1)
|
||||
else
|
||||
call timer('decjt9 ',0)
|
||||
call my_jt9%decode(jt9_decoded,ss,id2,params%nfqso, &
|
||||
newdat9,params%npts8,params%nfa,params%nfsplit,params%nfb, &
|
||||
params%ntol,params%nzhsym,logical(params%nagain), &
|
||||
params%ndepth,params%nmode,params%nsubmode,params%nexp_decode)
|
||||
call timer('decjt9 ',1)
|
||||
end if
|
||||
endif
|
||||
|
||||
!$omp end parallel sections
|
||||
|
||||
! JT65 is not yet producing info for nsynced, ndecoded.
|
||||
800 ndecoded = my_jt4%decoded + my_jt65%decoded + my_jt9%decoded + my_ft8%decoded
|
||||
write(*,1010) nsynced,ndecoded
|
||||
1010 format('<DecodeFinished>',2i4)
|
||||
call flush(6)
|
||||
close(13)
|
||||
if(params%nmode.eq.4 .or. params%nmode.eq.65) close(14)
|
||||
|
||||
return
|
||||
|
||||
contains
|
||||
|
||||
subroutine jt4_decoded(this,snr,dt,freq,have_sync,sync,is_deep, &
|
||||
decoded0,qual,ich,is_average,ave)
|
||||
implicit none
|
||||
class(jt4_decoder), intent(inout) :: this
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
integer, intent(in) :: freq
|
||||
logical, intent(in) :: have_sync
|
||||
logical, intent(in) :: is_deep
|
||||
character(len=1), intent(in) :: sync
|
||||
character(len=22), intent(in) :: decoded0
|
||||
real, intent(in) :: qual
|
||||
integer, intent(in) :: ich
|
||||
logical, intent(in) :: is_average
|
||||
integer, intent(in) :: ave
|
||||
|
||||
character*22 decoded
|
||||
character*3 cflags
|
||||
|
||||
if(ich.eq.-99) stop !Silence compiler warning
|
||||
if (have_sync) then
|
||||
decoded=decoded0
|
||||
cflags=' '
|
||||
if(decoded.ne.' ') cflags='f '
|
||||
if(is_deep) then
|
||||
cflags(1:2)='d1'
|
||||
write(cflags(3:3),'(i1)') min(int(qual),9)
|
||||
if(qual.ge.10.0) cflags(3:3)='*'
|
||||
if(qual.lt.3.0) decoded(22:22)='?'
|
||||
endif
|
||||
if(is_average) then
|
||||
write(cflags(2:2),'(i1)') min(ave,9)
|
||||
if(ave.ge.10) cflags(2:2)='*'
|
||||
endif
|
||||
write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cflags
|
||||
1000 format(i4.4,i4,f5.1,i5,1x,'$',a1,1x,a22,1x,a3)
|
||||
else
|
||||
write(*,1000) params%nutc,snr,dt,freq
|
||||
end if
|
||||
|
||||
select type(this)
|
||||
type is (counting_jt4_decoder)
|
||||
this%decoded = this%decoded + 1
|
||||
end select
|
||||
end subroutine jt4_decoded
|
||||
|
||||
subroutine jt4_average (this, used, utc, sync, dt, freq, flip)
|
||||
implicit none
|
||||
class(jt4_decoder), intent(inout) :: this
|
||||
logical, intent(in) :: used
|
||||
integer, intent(in) :: utc
|
||||
real, intent(in) :: sync
|
||||
real, intent(in) :: dt
|
||||
integer, intent(in) :: freq
|
||||
logical, intent(in) :: flip
|
||||
character(len=1) :: cused, csync
|
||||
|
||||
cused = '.'
|
||||
csync = '*'
|
||||
if (used) cused = '$'
|
||||
if (flip) csync = '$'
|
||||
write(14,1000) cused,utc,sync,dt,freq,csync
|
||||
1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1)
|
||||
end subroutine jt4_average
|
||||
|
||||
subroutine jt65_decoded(this,sync,snr,dt,freq,drift,nflip,width, &
|
||||
decoded0,ft,qual,nsmo,nsum,minsync)
|
||||
|
||||
use jt65_decode
|
||||
implicit none
|
||||
|
||||
class(jt65_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
integer, intent(in) :: freq
|
||||
integer, intent(in) :: drift
|
||||
integer, intent(in) :: nflip
|
||||
real, intent(in) :: width
|
||||
character(len=22), intent(in) :: decoded0
|
||||
integer, intent(in) :: ft
|
||||
integer, intent(in) :: qual
|
||||
integer, intent(in) :: nsmo
|
||||
integer, intent(in) :: nsum
|
||||
integer, intent(in) :: minsync
|
||||
|
||||
integer i,nft
|
||||
logical is_deep,is_average
|
||||
character decoded*22,csync*2,cflags*3
|
||||
|
||||
if(width.eq.-9999.0) stop !Silence compiler warning
|
||||
!$omp critical(decode_results)
|
||||
decoded=decoded0
|
||||
cflags=' '
|
||||
is_deep=ft.eq.2
|
||||
|
||||
if(ft.ge.80) then !QRA64 mode
|
||||
nft=ft-100
|
||||
csync=': '
|
||||
if(sync-3.4.ge.float(minsync) .or. nft.ge.0) csync=':*'
|
||||
if(nft.lt.0) then
|
||||
write(*,1009) params%nutc,snr,dt,freq,csync,decoded
|
||||
else
|
||||
write(*,1009) params%nutc,snr,dt,freq,csync,decoded,nft
|
||||
1009 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,i2)
|
||||
endif
|
||||
write(13,1011) params%nutc,nint(sync),snr,dt,float(freq),drift, &
|
||||
decoded,nft
|
||||
1011 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' QRA64',i3)
|
||||
go to 100
|
||||
endif
|
||||
|
||||
if(ft.eq.0 .and. minsync.ge.0 .and. int(sync).lt.minsync) then
|
||||
write(*,1010) params%nutc,snr,dt,freq
|
||||
else
|
||||
is_average=nsum.ge.2
|
||||
if(bVHF .and. ft.gt.0) then
|
||||
cflags='f '
|
||||
if(is_deep) then
|
||||
cflags(1:2)='d1'
|
||||
write(cflags(3:3),'(i1)') min(qual,9)
|
||||
if(qual.ge.10) cflags(3:3)='*'
|
||||
if(qual.lt.3) decoded(22:22)='?'
|
||||
endif
|
||||
if(is_average) then
|
||||
write(cflags(2:2),'(i1)') min(nsum,9)
|
||||
if(nsum.ge.10) cflags(2:2)='*'
|
||||
endif
|
||||
endif
|
||||
csync='# '
|
||||
i=0
|
||||
if(bVHF .and. nflip.ne.0 .and. &
|
||||
sync.ge.max(0.0,float(minsync))) then
|
||||
csync='#*'
|
||||
if(nflip.eq.-1) then
|
||||
csync='##'
|
||||
if(decoded.ne.' ') then
|
||||
do i=22,1,-1
|
||||
if(decoded(i:i).ne.' ') exit
|
||||
enddo
|
||||
if(i.gt.18) i=18
|
||||
decoded(i+2:i+4)='OOO'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
write(*,1010) params%nutc,snr,dt,freq,csync,decoded,cflags
|
||||
1010 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,1x,a3)
|
||||
endif
|
||||
write(13,1012) params%nutc,nint(sync),snr,dt,float(freq),drift, &
|
||||
decoded,ft,nsum,nsmo
|
||||
1012 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' JT65',3i3)
|
||||
|
||||
100 call flush(6)
|
||||
|
||||
!$omp end critical(decode_results)
|
||||
select type(this)
|
||||
type is (counting_jt65_decoder)
|
||||
this%decoded = this%decoded + 1
|
||||
end select
|
||||
end subroutine jt65_decoded
|
||||
|
||||
subroutine jt9_decoded (this, sync, snr, dt, freq, drift, decoded)
|
||||
use jt9_decode
|
||||
implicit none
|
||||
|
||||
class(jt9_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
real, intent(in) :: freq
|
||||
integer, intent(in) :: drift
|
||||
character(len=22), intent(in) :: decoded
|
||||
|
||||
!$omp critical(decode_results)
|
||||
write(*,1000) params%nutc,snr,dt,nint(freq),decoded
|
||||
1000 format(i4.4,i4,f5.1,i5,1x,'@ ',1x,a22)
|
||||
write(13,1002) params%nutc,nint(sync),snr,dt,freq,drift,decoded
|
||||
1002 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a22,' JT9')
|
||||
call flush(6)
|
||||
!$omp end critical(decode_results)
|
||||
select type(this)
|
||||
type is (counting_jt9_decoder)
|
||||
this%decoded = this%decoded + 1
|
||||
end select
|
||||
end subroutine jt9_decoded
|
||||
|
||||
subroutine ft8_decoded (this,sync,snr,dt,freq,nbadcrc,decoded)
|
||||
use ft8_decode
|
||||
implicit none
|
||||
|
||||
class(ft8_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
real, intent(in) :: freq
|
||||
integer, intent(in) :: nbadcrc
|
||||
character(len=22), intent(in) :: decoded
|
||||
|
||||
!### !$omp critical(decode_results)
|
||||
if(nbadcrc.eq.0) then
|
||||
write(*,1000) params%nutc,snr,dt,nint(freq),decoded
|
||||
1000 format(i6.6,i4,f5.1,i5,' ~ ',1x,a22)
|
||||
write(13,1002) params%nutc,nint(sync),snr,dt,freq,0,decoded
|
||||
1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a22,' FT8')
|
||||
call flush(6)
|
||||
call flush(13)
|
||||
endif
|
||||
!### !$omp end critical(decode_results)
|
||||
|
||||
select type(this)
|
||||
type is (counting_ft8_decoder)
|
||||
this%decoded = this%decoded + 1
|
||||
end select
|
||||
|
||||
return
|
||||
end subroutine ft8_decoded
|
||||
|
||||
end subroutine multimode_decoder
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright 2006 Roland Schwarz.
|
||||
// (C) Copyright 2007 Anthony Williams
|
||||
// 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 work is a reimplementation along the design and ideas
|
||||
// of William E. Kempf.
|
||||
|
||||
#ifndef BOOST_THREAD_RS06040501_HPP
|
||||
#define BOOST_THREAD_RS06040501_HPP
|
||||
|
||||
// fetch compiler and platform configuration
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// insist on threading support being available:
|
||||
#include <boost/config/requires_threads.hpp>
|
||||
|
||||
// choose platform
|
||||
#if defined(linux) || defined(__linux) || defined(__linux__)
|
||||
# define BOOST_THREAD_LINUX
|
||||
//# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(100000)
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
# define BOOST_THREAD_BSD
|
||||
#elif defined(sun) || defined(__sun)
|
||||
# define BOOST_THREAD_SOLARIS
|
||||
#elif defined(__sgi)
|
||||
# define BOOST_THREAD_IRIX
|
||||
#elif defined(__hpux)
|
||||
# define BOOST_THREAD_HPUX
|
||||
#elif defined(__CYGWIN__)
|
||||
# define BOOST_THREAD_CYGWIN
|
||||
#elif (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(BOOST_DISABLE_WIN32)
|
||||
# define BOOST_THREAD_WIN32
|
||||
#elif defined(__BEOS__)
|
||||
# define BOOST_THREAD_BEOS
|
||||
#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
|
||||
# define BOOST_THREAD_MACOS
|
||||
//# define BOOST_THREAD_WAIT_BUG boost::posix_time::microseconds(1000)
|
||||
#elif defined(__IBMCPP__) || defined(_AIX)
|
||||
# define BOOST_THREAD_AIX
|
||||
#elif defined(__amigaos__)
|
||||
# define BOOST_THREAD_AMIGAOS
|
||||
#elif defined(__QNXNTO__)
|
||||
# define BOOST_THREAD_QNXNTO
|
||||
#elif defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE)
|
||||
# if defined(BOOST_HAS_PTHREADS) && !defined(BOOST_THREAD_POSIX)
|
||||
# define BOOST_THREAD_POSIX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// For every supported platform add a new entry into the dispatch table below.
|
||||
// BOOST_THREAD_POSIX is tested first, so on platforms where posix and native
|
||||
// threading is available, the user may choose, by defining BOOST_THREAD_POSIX
|
||||
// in her source. If a platform is known to support pthreads and no native
|
||||
// port of boost_thread is available just specify "pthread" in the
|
||||
// dispatcher table. If there is no entry for a platform but pthreads is
|
||||
// available on the platform, pthread is choosen as default. If nothing is
|
||||
// available the preprocessor will fail with a diagnostic message.
|
||||
|
||||
#if defined(BOOST_THREAD_POSIX)
|
||||
# define BOOST_THREAD_PLATFORM_PTHREAD
|
||||
#else
|
||||
# if defined(BOOST_THREAD_WIN32)
|
||||
# define BOOST_THREAD_PLATFORM_WIN32
|
||||
# elif defined(BOOST_HAS_PTHREADS)
|
||||
# define BOOST_THREAD_PLATFORM_PTHREAD
|
||||
# else
|
||||
# error "Sorry, no boost threads are available for this platform."
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif // BOOST_THREAD_RS06040501_HPP
|
||||
@@ -0,0 +1,107 @@
|
||||
/*=============================================================================
|
||||
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_ADVANCE_09172005_1149)
|
||||
#define FUSION_ADVANCE_09172005_1149
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
#include <boost/fusion/iterator/prior.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace advance_detail
|
||||
{
|
||||
// Default advance implementation, perform next(i)
|
||||
// or prior(i) N times.
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct forward;
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct next_forward
|
||||
{
|
||||
typedef typename
|
||||
forward<
|
||||
typename result_of::next<Iterator>::type
|
||||
, N-1
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct forward
|
||||
{
|
||||
typedef typename
|
||||
mpl::eval_if_c<
|
||||
(N == 0)
|
||||
, mpl::identity<Iterator>
|
||||
, next_forward<Iterator, N>
|
||||
>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type const&
|
||||
call(type const& i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(I const& i)
|
||||
{
|
||||
return call(fusion::next(i));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct backward;
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct next_backward
|
||||
{
|
||||
typedef typename
|
||||
backward<
|
||||
typename result_of::prior<Iterator>::type
|
||||
, N+1
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename Iterator, int N>
|
||||
struct backward
|
||||
{
|
||||
typedef typename
|
||||
mpl::eval_if_c<
|
||||
(N == 0)
|
||||
, mpl::identity<Iterator>
|
||||
, next_backward<Iterator, N>
|
||||
>::type
|
||||
type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type const&
|
||||
call(type const& i)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
template <typename I>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type
|
||||
call(I const& i)
|
||||
{
|
||||
return call(fusion::prior(i));
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
// Copyright Neil Groves 2009. 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_ALGORITHM_PARTIAL_SORT_HPP_INCLUDED
|
||||
#define BOOST_RANGE_ALGORITHM_PARTIAL_SORT_HPP_INCLUDED
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
{
|
||||
|
||||
/// \brief template function partial_sort
|
||||
///
|
||||
/// range-based version of the partial_sort std algorithm
|
||||
///
|
||||
/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept
|
||||
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
|
||||
template<class RandomAccessRange>
|
||||
inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type middle)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
|
||||
std::partial_sort(boost::begin(rng), middle, boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class RandomAccessRange>
|
||||
inline const RandomAccessRange& partial_sort(const RandomAccessRange& rng,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type middle)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
|
||||
std::partial_sort(boost::begin(rng), middle, boost::end(rng));
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class RandomAccessRange, class BinaryPredicate>
|
||||
inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type middle,
|
||||
BinaryPredicate sort_pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<RandomAccessRange> ));
|
||||
std::partial_sort(boost::begin(rng), middle, boost::end(rng),
|
||||
sort_pred);
|
||||
return rng;
|
||||
}
|
||||
|
||||
/// \overload
|
||||
template<class RandomAccessRange, class BinaryPredicate>
|
||||
inline const RandomAccessRange& partial_sort(const RandomAccessRange& rng,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type middle,
|
||||
BinaryPredicate sort_pred)
|
||||
{
|
||||
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
|
||||
std::partial_sort(boost::begin(rng), middle, boost::end(rng),
|
||||
sort_pred);
|
||||
return rng;
|
||||
}
|
||||
|
||||
} // namespace range
|
||||
using range::partial_sort;
|
||||
} // namespace boost
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,382 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 1998-2002
|
||||
* John Maddock
|
||||
*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* LOCATION: see http://www.boost.org for most recent version.
|
||||
* FILE regex_match.hpp
|
||||
* VERSION see <boost/version.hpp>
|
||||
* DESCRIPTION: Regular expression matching algorithms.
|
||||
* Note this is an internal header file included
|
||||
* by regex.hpp, do not include on its own.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef BOOST_REGEX_MATCH_HPP
|
||||
#define BOOST_REGEX_MATCH_HPP
|
||||
|
||||
namespace boost{
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
//
|
||||
// proc regex_match
|
||||
// returns true if the specified regular expression matches
|
||||
// the whole of the input. Fills in what matched in m.
|
||||
//
|
||||
template <class BidiIterator, class Allocator, class charT, class traits>
|
||||
bool regex_match(BidiIterator first, BidiIterator last,
|
||||
match_results<BidiIterator, Allocator>& m,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
BOOST_REGEX_DETAIL_NS::perl_matcher<BidiIterator, Allocator, traits> matcher(first, last, m, e, flags, first);
|
||||
return matcher.match();
|
||||
}
|
||||
template <class iterator, class charT, class traits>
|
||||
bool regex_match(iterator first, iterator last,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<iterator> m;
|
||||
return regex_match(first, last, m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
//
|
||||
// query_match convenience interfaces:
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
//
|
||||
// this isn't really a partial specialisation, but template function
|
||||
// overloading - if the compiler doesn't support partial specialisation
|
||||
// then it really won't support this either:
|
||||
template <class charT, class Allocator, class traits>
|
||||
inline bool regex_match(const charT* str,
|
||||
match_results<const charT*, Allocator>& m,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + traits::length(str), m, e, flags);
|
||||
}
|
||||
|
||||
template <class ST, class SA, class Allocator, class charT, class traits>
|
||||
inline bool regex_match(const std::basic_string<charT, ST, SA>& s,
|
||||
match_results<typename std::basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
template <class charT, class traits>
|
||||
inline bool regex_match(const charT* str,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const charT*> m;
|
||||
return regex_match(str, str + traits::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
|
||||
template <class ST, class SA, class charT, class traits>
|
||||
inline bool regex_match(const std::basic_string<charT, ST, SA>& s,
|
||||
const basic_regex<charT, traits>& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
typedef typename std::basic_string<charT, ST, SA>::const_iterator iterator;
|
||||
match_results<iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#else // partial ordering
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const char* str,
|
||||
cmatch& m,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const char* str,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const char*> m;
|
||||
return regex_match(str, str + regex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_WREGEX
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
wcmatch& m,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const wchar_t* str,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<const wchar_t*> m;
|
||||
return regex_match(str, str + wregex::traits_type::length(str), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const regex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const basic_regex<char, cpp_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const basic_regex<char, c_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const std::string& s,
|
||||
smatch& m,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::string& s,
|
||||
const basic_regex<char, w32_regex_traits<char> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::string::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#if !defined(BOOST_NO_WREGEX)
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const wregex& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#ifndef BOOST_NO_STD_LOCALE
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const basic_regex<wchar_t, cpp_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const basic_regex<wchar_t, c_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
match_results<std::basic_string<wchar_t>::const_iterator>& m,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
return regex_match(s.begin(), s.end(), m, e, flags);
|
||||
}
|
||||
inline bool regex_match(const std::basic_string<wchar_t>& s,
|
||||
const basic_regex<wchar_t, w32_regex_traits<wchar_t> >& e,
|
||||
match_flag_type flags = match_default)
|
||||
{
|
||||
match_results<std::basic_string<wchar_t>::const_iterator> m;
|
||||
return regex_match(s.begin(), s.end(), m, e, flags | regex_constants::match_any);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4103)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
# include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_REGEX_MATCH_HPP
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
* Copyright (c) 2011 Helge Bahmann
|
||||
* Copyright (c) 2013 Tim Blechmann
|
||||
* Copyright (c) 2014 Andrey Semashev
|
||||
*/
|
||||
/*!
|
||||
* \file atomic/detail/caps_gcc_sync.hpp
|
||||
*
|
||||
* This header defines feature capabilities macros
|
||||
*/
|
||||
|
||||
#ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_
|
||||
#define BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_
|
||||
|
||||
#include <boost/atomic/detail/config.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)
|
||||
#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B 1
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
|
||||
#define BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B 1
|
||||
#endif
|
||||
|
||||
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
|
||||
#define BOOST_ATOMIC_INT8_LOCK_FREE 2
|
||||
#endif
|
||||
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
|
||||
#define BOOST_ATOMIC_INT16_LOCK_FREE 2
|
||||
#endif
|
||||
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
|
||||
#define BOOST_ATOMIC_INT32_LOCK_FREE 2
|
||||
#endif
|
||||
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)\
|
||||
|| defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
|
||||
#define BOOST_ATOMIC_INT64_LOCK_FREE 2
|
||||
#endif
|
||||
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)
|
||||
#define BOOST_ATOMIC_INT128_LOCK_FREE 2
|
||||
#endif
|
||||
|
||||
#define BOOST_ATOMIC_THREAD_FENCE 2
|
||||
#define BOOST_ATOMIC_SIGNAL_FENCE 2
|
||||
|
||||
#endif // BOOST_ATOMIC_DETAIL_CAPS_GCC_SYNC_HPP_INCLUDED_
|
||||
@@ -0,0 +1,145 @@
|
||||
#ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED
|
||||
#define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// Copyright 2015 Peter Dimov
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/decay.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
#include <boost/type_traits/detail/common_type_impl.hpp>
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
#include <boost/type_traits/detail/mp_defer.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
// variadic common_type
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
template<class... T> struct common_type
|
||||
{
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
template<class... T> using common_type_t = typename common_type<T...>::type;
|
||||
|
||||
namespace type_traits_detail
|
||||
{
|
||||
|
||||
template<class T1, class T2, class... T> using common_type_fold = common_type_t<common_type_t<T1, T2>, T...>;
|
||||
|
||||
} // namespace type_traits_detail
|
||||
|
||||
template<class T1, class T2, class... T>
|
||||
struct common_type<T1, T2, T...>: type_traits_detail::mp_defer<type_traits_detail::common_type_fold, T1, T2, T...>
|
||||
{
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template<class T1, class T2, class... T>
|
||||
struct common_type<T1, T2, T...>: common_type<typename common_type<T1, T2>::type, T...>
|
||||
{
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
|
||||
#else
|
||||
|
||||
template<
|
||||
class T1 = void, class T2 = void, class T3 = void,
|
||||
class T4 = void, class T5 = void, class T6 = void,
|
||||
class T7 = void, class T8 = void, class T9 = void
|
||||
>
|
||||
struct common_type: common_type<typename common_type<T1, T2>::type, T3, T4, T5, T6, T7, T8, T9>
|
||||
{
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
// one argument
|
||||
|
||||
template<class T> struct common_type<T>: boost::decay<T>
|
||||
{
|
||||
};
|
||||
|
||||
// two arguments
|
||||
|
||||
namespace type_traits_detail
|
||||
{
|
||||
|
||||
// binary common_type
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1800
|
||||
|
||||
// internal compiler error on msvc-12.0
|
||||
|
||||
template<class T1, class T2> using builtin_common_type = typename boost::decay<decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() )>::type;
|
||||
|
||||
template<class T1, class T2> struct common_type_impl: mp_defer<builtin_common_type, T1, T2>
|
||||
{
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template<class T1, class T2> using builtin_common_type = decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() );
|
||||
|
||||
template<class T1, class T2> struct common_type_impl_2: mp_defer<builtin_common_type, T1, T2>
|
||||
{
|
||||
};
|
||||
|
||||
template<class T1, class T2> using decay_common_type = typename boost::decay<typename common_type_impl_2<T1, T2>::type>::type;
|
||||
|
||||
template<class T1, class T2> struct common_type_impl: mp_defer<decay_common_type, T1, T2>
|
||||
{
|
||||
};
|
||||
|
||||
#endif // !defined(BOOST_MSVC) || BOOST_MSVC > 1800
|
||||
|
||||
#else
|
||||
|
||||
template<class T1, class T2> struct common_type_impl: boost::decay<decltype( boost::declval<bool>()? boost::declval<T1>(): boost::declval<T2>() )>
|
||||
{
|
||||
};
|
||||
|
||||
#endif // #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#endif // #if !defined(BOOST_NO_CXX11_DECLTYPE)
|
||||
|
||||
// decay helper
|
||||
|
||||
template<class T1, class T2, class T1d = typename boost::decay<T1>::type, class T2d = typename boost::decay<T2>::type> struct common_type_decay_helper: boost::common_type<T1d, T2d>
|
||||
{
|
||||
};
|
||||
|
||||
template<class T1, class T2> struct common_type_decay_helper<T1, T2, T1, T2>: common_type_impl<T1, T2>
|
||||
{
|
||||
};
|
||||
|
||||
} // type_traits_detail
|
||||
|
||||
template<class T1, class T2> struct common_type<T1, T2>: type_traits_detail::common_type_decay_helper<T1, T2>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP_INCLUDED
|
||||
@@ -0,0 +1,51 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2009 Sebastian Redl
|
||||
//
|
||||
// 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)
|
||||
//
|
||||
// For more information, see www.boost.org
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef BOOST_PROPERTY_TREE_ID_TRANSLATOR_HPP_INCLUDED
|
||||
#define BOOST_PROPERTY_TREE_ID_TRANSLATOR_HPP_INCLUDED
|
||||
|
||||
#include <boost/property_tree/ptree_fwd.hpp>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace boost { namespace property_tree
|
||||
{
|
||||
|
||||
/// Simple implementation of the Translator concept. It does no translation.
|
||||
template <typename T>
|
||||
struct id_translator
|
||||
{
|
||||
typedef T internal_type;
|
||||
typedef T external_type;
|
||||
|
||||
boost::optional<T> get_value(const T &v) { return v; }
|
||||
boost::optional<T> put_value(const T &v) { return v; }
|
||||
};
|
||||
|
||||
// This is the default translator whenever you get two equal types.
|
||||
template <typename T>
|
||||
struct translator_between<T, T>
|
||||
{
|
||||
typedef id_translator<T> type;
|
||||
};
|
||||
|
||||
// A more specific specialization for std::basic_string. Otherwise,
|
||||
// stream_translator's specialization wins.
|
||||
template <typename Ch, typename Traits, typename Alloc>
|
||||
struct translator_between< std::basic_string<Ch, Traits, Alloc>,
|
||||
std::basic_string<Ch, Traits, Alloc> >
|
||||
{
|
||||
typedef id_translator< std::basic_string<Ch, Traits, Alloc> > type;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,172 @@
|
||||
#include "decodedtext.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QRegularExpression>
|
||||
|
||||
extern "C" {
|
||||
bool stdmsg_(const char* msg, int len);
|
||||
}
|
||||
|
||||
QString DecodedText::CQersCall()
|
||||
{
|
||||
QRegularExpression callsign_re {R"(\s(CQ|DE|QRZ)(\s?DX|\s([A-Z]{2}|\d{3}))?\s(?<callsign>[A-Z0-9/]{2,})(\s[A-R]{2}[0-9]{2})?)"};
|
||||
return callsign_re.match (_string).captured ("callsign");
|
||||
}
|
||||
|
||||
|
||||
bool DecodedText::isJT65()
|
||||
{
|
||||
return _string.indexOf("#") == column_mode + padding_;
|
||||
}
|
||||
|
||||
bool DecodedText::isJT9()
|
||||
{
|
||||
return _string.indexOf("@") == column_mode + padding_;
|
||||
}
|
||||
|
||||
bool DecodedText::isTX()
|
||||
{
|
||||
int i = _string.indexOf("Tx");
|
||||
return (i >= 0 && i < 15); // TODO guessing those numbers. Does Tx ever move?
|
||||
}
|
||||
|
||||
bool DecodedText::isLowConfidence ()
|
||||
{
|
||||
return QChar {'?'} == _string.mid (padding_ + column_qsoText + 21, 1);
|
||||
}
|
||||
|
||||
int DecodedText::frequencyOffset()
|
||||
{
|
||||
return _string.mid(column_freq + padding_,4).toInt();
|
||||
}
|
||||
|
||||
int DecodedText::snr()
|
||||
{
|
||||
int i1=_string.indexOf(" ")+1;
|
||||
return _string.mid(i1,3).toInt();
|
||||
}
|
||||
|
||||
float DecodedText::dt()
|
||||
{
|
||||
return _string.mid(column_dt + padding_,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 + padding_).trimmed();
|
||||
if(msg.length() < 1) return false;
|
||||
msg = msg.left (22).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 + padding_);
|
||||
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 + padding_);
|
||||
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,25 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2011 Hartmut Kaiser
|
||||
|
||||
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_PHOENIX_PREPROCESSED_NEW)
|
||||
#define BOOST_PHOENIX_PREPROCESSED_NEW
|
||||
|
||||
#if BOOST_PHOENIX_LIMIT <= 10
|
||||
#include <boost/phoenix/object/detail/cpp03/preprocessed/new_10.hpp>
|
||||
#elif BOOST_PHOENIX_LIMIT <= 20
|
||||
#include <boost/phoenix/object/detail/cpp03/preprocessed/new_20.hpp>
|
||||
#elif BOOST_PHOENIX_LIMIT <= 30
|
||||
#include <boost/phoenix/object/detail/cpp03/preprocessed/new_30.hpp>
|
||||
#elif BOOST_PHOENIX_LIMIT <= 40
|
||||
#include <boost/phoenix/object/detail/cpp03/preprocessed/new_40.hpp>
|
||||
#elif BOOST_PHOENIX_LIMIT <= 50
|
||||
#include <boost/phoenix/object/detail/cpp03/preprocessed/new_50.hpp>
|
||||
#else
|
||||
#error "BOOST_PHOENIX_LIMIT out of bounds for preprocessed headers"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,323 @@
|
||||
|
||||
// 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/deque.hpp" header
|
||||
// -- DO NOT modify by hand!
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<
|
||||
typename T0 = na, typename T1 = na, typename T2 = na, typename T3 = na
|
||||
, typename T4 = na, typename T5 = na, typename T6 = na, typename T7 = na
|
||||
, typename T8 = na, typename T9 = na, typename T10 = na, typename T11 = na
|
||||
, typename T12 = na, typename T13 = na, typename T14 = na
|
||||
, typename T15 = na, typename T16 = na, typename T17 = na
|
||||
, typename T18 = na, typename T19 = na
|
||||
>
|
||||
struct deque;
|
||||
|
||||
template<
|
||||
|
||||
>
|
||||
struct deque<
|
||||
na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector0< >
|
||||
{
|
||||
typedef vector0< >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0
|
||||
>
|
||||
struct deque<
|
||||
T0, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector1<T0>
|
||||
{
|
||||
typedef typename vector1<T0>::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector2< T0,T1 >
|
||||
{
|
||||
typedef typename vector2< T0,T1 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, na, na, na, na, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector3< T0,T1,T2 >
|
||||
{
|
||||
typedef typename vector3< T0,T1,T2 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, na, na, na, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector4< T0,T1,T2,T3 >
|
||||
{
|
||||
typedef typename vector4< T0,T1,T2,T3 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, na, na, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector5< T0,T1,T2,T3,T4 >
|
||||
{
|
||||
typedef typename vector5< T0,T1,T2,T3,T4 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, na, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector6< T0,T1,T2,T3,T4,T5 >
|
||||
{
|
||||
typedef typename vector6< T0,T1,T2,T3,T4,T5 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, na, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector7< T0,T1,T2,T3,T4,T5,T6 >
|
||||
{
|
||||
typedef typename vector7< T0,T1,T2,T3,T4,T5,T6 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, na, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector8< T0,T1,T2,T3,T4,T5,T6,T7 >
|
||||
{
|
||||
typedef typename vector8< T0,T1,T2,T3,T4,T5,T6,T7 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, na, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector9< T0,T1,T2,T3,T4,T5,T6,T7,T8 >
|
||||
{
|
||||
typedef typename vector9< T0,T1,T2,T3,T4,T5,T6,T7,T8 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, na, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector10< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 >
|
||||
{
|
||||
typedef typename vector10< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, na, na, na, na, na, na
|
||||
, na, na, na
|
||||
>
|
||||
: vector11< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >
|
||||
{
|
||||
typedef typename vector11< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, na, na, na, na
|
||||
, na, na, na, na
|
||||
>
|
||||
: vector12< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >
|
||||
{
|
||||
typedef typename vector12< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, na, na, na
|
||||
, na, na, na, na
|
||||
>
|
||||
: vector13< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >
|
||||
{
|
||||
typedef typename vector13< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12, typename T13
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, na, na
|
||||
, na, na, na, na
|
||||
>
|
||||
: vector14< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >
|
||||
{
|
||||
typedef typename vector14< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12, typename T13, typename T14
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, na
|
||||
, na, na, na, na
|
||||
>
|
||||
: vector15<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
>
|
||||
{
|
||||
typedef typename vector15< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12, typename T13, typename T14
|
||||
, typename T15
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, na, na, na, na
|
||||
>
|
||||
: vector16<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15
|
||||
>
|
||||
{
|
||||
typedef typename vector16< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12, typename T13, typename T14
|
||||
, typename T15, typename T16
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, T16, na, na, na
|
||||
>
|
||||
: vector17<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, T16
|
||||
>
|
||||
{
|
||||
typedef typename vector17< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12, typename T13, typename T14
|
||||
, typename T15, typename T16, typename T17
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, T16, T17, na, na
|
||||
>
|
||||
: vector18<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, T16, T17
|
||||
>
|
||||
{
|
||||
typedef typename vector18< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17 >::type type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12, typename T13, typename T14
|
||||
, typename T15, typename T16, typename T17, typename T18
|
||||
>
|
||||
struct deque<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, T16, T17, T18, na
|
||||
>
|
||||
: vector19<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, T16, T17, T18
|
||||
>
|
||||
{
|
||||
typedef typename vector19< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18 >::type type;
|
||||
};
|
||||
|
||||
/// primary template (not a specialization!)
|
||||
|
||||
template<
|
||||
typename T0, typename T1, typename T2, typename T3, typename T4
|
||||
, typename T5, typename T6, typename T7, typename T8, typename T9
|
||||
, typename T10, typename T11, typename T12, typename T13, typename T14
|
||||
, typename T15, typename T16, typename T17, typename T18, typename T19
|
||||
>
|
||||
struct deque
|
||||
: vector20<
|
||||
T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14
|
||||
, T15, T16, T17, T18, T19
|
||||
>
|
||||
{
|
||||
typedef typename vector20< T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19 >::type type;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/proto/context/detail/preprocessed/callable_eval.hpp>
|
||||
|
||||
#elif !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
#define BOOST_PROTO_CHILD_N_TYPE(Z, N, Expr) \
|
||||
typedef typename proto::result_of::child_c<Expr const &, N>::type BOOST_PP_CAT(child, N); \
|
||||
/**/
|
||||
|
||||
#define BOOST_PROTO_CHILD_N(Z, N, expr) \
|
||||
proto::child_c<N>(expr) \
|
||||
/**/
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/callable_eval.hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file callable_eval.hpp
|
||||
/// Contains specializations of the callable_eval\<\> class template.
|
||||
//
|
||||
// Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/callable_eval.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#undef BOOST_PROTO_CHILD_N_TYPE
|
||||
#undef BOOST_PROTO_CHILD_N
|
||||
|
||||
#else
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
namespace detail
|
||||
{
|
||||
template<typename Expr, typename Context>
|
||||
struct is_expr_handled<Expr, Context, N>
|
||||
{
|
||||
static callable_context_wrapper<Context> &sctx_;
|
||||
static Expr &sexpr_;
|
||||
static typename Expr::proto_tag &stag_;
|
||||
|
||||
static const bool value =
|
||||
sizeof(yes_type) ==
|
||||
sizeof(
|
||||
detail::check_is_expr_handled(
|
||||
(sctx_(
|
||||
stag_
|
||||
BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, sexpr_)
|
||||
), 0)
|
||||
)
|
||||
);
|
||||
|
||||
typedef mpl::bool_<value> type;
|
||||
};
|
||||
}
|
||||
|
||||
namespace context
|
||||
{
|
||||
/// \brief A BinaryFunction that accepts a Proto expression and a
|
||||
/// callable context and calls the context with the expression tag
|
||||
/// and children as arguments, effectively fanning the expression
|
||||
/// out.
|
||||
///
|
||||
/// <tt>callable_eval\<\></tt> requires that \c Context is a
|
||||
/// PolymorphicFunctionObject that can be invoked with \c Expr's
|
||||
/// tag and children as expressions, as follows:
|
||||
///
|
||||
/// \code
|
||||
/// context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...)
|
||||
/// \endcode
|
||||
template<typename Expr, typename Context>
|
||||
struct callable_eval<Expr, Context, N>
|
||||
{
|
||||
BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD_N_TYPE, Expr)
|
||||
|
||||
typedef
|
||||
typename BOOST_PROTO_RESULT_OF<
|
||||
Context(
|
||||
typename Expr::proto_tag
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(N, child)
|
||||
)
|
||||
>::type
|
||||
result_type;
|
||||
|
||||
/// \param expr The current expression
|
||||
/// \param context The callable evaluation context
|
||||
/// \return <tt>context(Expr::proto_tag(), child_c\<0\>(expr), child_c\<1\>(expr), ...)</tt>
|
||||
result_type operator ()(Expr &expr, Context &context) const
|
||||
{
|
||||
return context(
|
||||
typename Expr::proto_tag()
|
||||
BOOST_PP_ENUM_TRAILING(N, BOOST_PROTO_CHILD_N, expr)
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#undef N
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,123 @@
|
||||
#ifndef DATE_TIME_C_TIME_HPP___
|
||||
#define DATE_TIME_C_TIME_HPP___
|
||||
|
||||
/* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc.
|
||||
* Use, modification and distribution is subject to the
|
||||
* Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
* Author: Jeff Garland, Bart Garst
|
||||
* $Date$
|
||||
*/
|
||||
|
||||
|
||||
/*! @file c_time.hpp
|
||||
Provide workarounds related to the ctime header
|
||||
*/
|
||||
|
||||
#include <ctime>
|
||||
#include <string> // to be able to convert from string literals to exceptions
|
||||
#include <stdexcept>
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/date_time/compiler_config.hpp>
|
||||
|
||||
//Work around libraries that don't put time_t and time in namespace std
|
||||
#ifdef BOOST_NO_STDC_NAMESPACE
|
||||
namespace std { using ::time_t; using ::time; using ::localtime;
|
||||
using ::tm; using ::gmtime; }
|
||||
#endif // BOOST_NO_STDC_NAMESPACE
|
||||
|
||||
//The following is used to support high precision time clocks
|
||||
#ifdef BOOST_HAS_GETTIMEOFDAY
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_FTIME
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace date_time {
|
||||
//! Provides a uniform interface to some 'ctime' functions
|
||||
/*! Provides a uniform interface to some ctime functions and
|
||||
* their '_r' counterparts. The '_r' functions require a pointer to a
|
||||
* user created std::tm struct whereas the regular functions use a
|
||||
* staticly created struct and return a pointer to that. These wrapper
|
||||
* functions require the user to create a std::tm struct and send in a
|
||||
* pointer to it. This struct may be used to store the resulting time.
|
||||
* The returned pointer may or may not point to this struct, however,
|
||||
* it will point to the result of the corresponding function.
|
||||
* All functions do proper checking of the C function results and throw
|
||||
* exceptions on error. Therefore the functions will never return NULL.
|
||||
*/
|
||||
struct c_time {
|
||||
public:
|
||||
#if defined(BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS)
|
||||
//! requires a pointer to a user created std::tm struct
|
||||
inline
|
||||
static std::tm* localtime(const std::time_t* t, std::tm* result)
|
||||
{
|
||||
// localtime_r() not in namespace std???
|
||||
#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
|
||||
std::tm tmp;
|
||||
if(!localtime_r(t,&tmp))
|
||||
result = 0;
|
||||
else
|
||||
*result = tmp;
|
||||
#else
|
||||
result = localtime_r(t, result);
|
||||
#endif
|
||||
if (!result)
|
||||
boost::throw_exception(std::runtime_error("could not convert calendar time to local time"));
|
||||
return result;
|
||||
}
|
||||
//! requires a pointer to a user created std::tm struct
|
||||
inline
|
||||
static std::tm* gmtime(const std::time_t* t, std::tm* result)
|
||||
{
|
||||
// gmtime_r() not in namespace std???
|
||||
#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
|
||||
std::tm tmp;
|
||||
if(!gmtime_r(t,&tmp))
|
||||
result = 0;
|
||||
else
|
||||
*result = tmp;
|
||||
#else
|
||||
result = gmtime_r(t, result);
|
||||
#endif
|
||||
if (!result)
|
||||
boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time"));
|
||||
return result;
|
||||
}
|
||||
#else // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1400))
|
||||
#pragma warning(push) // preserve warning settings
|
||||
#pragma warning(disable : 4996) // disable depricated localtime/gmtime warning on vc8
|
||||
#endif // _MSC_VER >= 1400
|
||||
//! requires a pointer to a user created std::tm struct
|
||||
inline
|
||||
static std::tm* localtime(const std::time_t* t, std::tm* result)
|
||||
{
|
||||
result = std::localtime(t);
|
||||
if (!result)
|
||||
boost::throw_exception(std::runtime_error("could not convert calendar time to local time"));
|
||||
return result;
|
||||
}
|
||||
//! requires a pointer to a user created std::tm struct
|
||||
inline
|
||||
static std::tm* gmtime(const std::time_t* t, std::tm* result)
|
||||
{
|
||||
result = std::gmtime(t);
|
||||
if (!result)
|
||||
boost::throw_exception(std::runtime_error("could not convert calendar time to UTC time"));
|
||||
return result;
|
||||
}
|
||||
#if (defined(_MSC_VER) && (_MSC_VER >= 1400))
|
||||
#pragma warning(pop) // restore warnings to previous state
|
||||
#endif // _MSC_VER >= 1400
|
||||
|
||||
#endif // BOOST_DATE_TIME_HAS_REENTRANT_STD_FUNCTIONS
|
||||
};
|
||||
}} // namespaces
|
||||
|
||||
#endif // DATE_TIME_C_TIME_HPP___
|
||||
@@ -0,0 +1,127 @@
|
||||
// -------------- Boost static_log2.hpp header file ----------------------- //
|
||||
//
|
||||
// Copyright (C) 2001 Daryle Walker.
|
||||
// Copyright (C) 2003 Vesa Karvonen.
|
||||
// Copyright (C) 2003 Gennaro Prota.
|
||||
//
|
||||
// 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/integer for documentation.
|
||||
// ------------------------------------------------------------------------- //
|
||||
|
||||
|
||||
#ifndef BOOST_INTEGER_STATIC_LOG2_HPP
|
||||
#define BOOST_INTEGER_STATIC_LOG2_HPP
|
||||
|
||||
#include "boost/integer_fwd.hpp" // for boost::intmax_t
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail {
|
||||
|
||||
namespace static_log2_impl {
|
||||
|
||||
// choose_initial_n<>
|
||||
//
|
||||
// Recursively doubles its integer argument, until it
|
||||
// becomes >= of the "width" (C99, 6.2.6.2p4) of
|
||||
// static_log2_argument_type.
|
||||
//
|
||||
// Used to get the maximum power of two less then the width.
|
||||
//
|
||||
// Example: if on your platform argument_type has 48 value
|
||||
// bits it yields n=32.
|
||||
//
|
||||
// It's easy to prove that, starting from such a value
|
||||
// of n, the core algorithm works correctly for any width
|
||||
// of static_log2_argument_type and that recursion always
|
||||
// terminates with x = 1 and n = 0 (see the algorithm's
|
||||
// invariant).
|
||||
|
||||
typedef boost::static_log2_argument_type argument_type;
|
||||
typedef boost::static_log2_result_type result_type;
|
||||
|
||||
template <result_type n>
|
||||
struct choose_initial_n {
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0);
|
||||
BOOST_STATIC_CONSTANT(
|
||||
result_type,
|
||||
value = !c*n + choose_initial_n<2*c*n>::value
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct choose_initial_n<0> {
|
||||
BOOST_STATIC_CONSTANT(result_type, value = 0);
|
||||
};
|
||||
|
||||
|
||||
|
||||
// start computing from n_zero - must be a power of two
|
||||
const result_type n_zero = 16;
|
||||
const result_type initial_n = choose_initial_n<n_zero>::value;
|
||||
|
||||
// static_log2_impl<>
|
||||
//
|
||||
// * Invariant:
|
||||
// 2n
|
||||
// 1 <= x && x < 2 at the start of each recursion
|
||||
// (see also choose_initial_n<>)
|
||||
//
|
||||
// * Type requirements:
|
||||
//
|
||||
// argument_type maybe any unsigned type with at least n_zero + 1
|
||||
// value bits. (Note: If larger types will be standardized -e.g.
|
||||
// unsigned long long- then the argument_type typedef can be
|
||||
// changed without affecting the rest of the code.)
|
||||
//
|
||||
|
||||
template <argument_type x, result_type n = initial_n>
|
||||
struct static_log2_impl {
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ?
|
||||
BOOST_STATIC_CONSTANT(
|
||||
result_type,
|
||||
value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value)
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct static_log2_impl<1, 0> {
|
||||
BOOST_STATIC_CONSTANT(result_type, value = 0);
|
||||
};
|
||||
|
||||
}
|
||||
} // detail
|
||||
|
||||
|
||||
|
||||
// --------------------------------------
|
||||
// static_log2<x>
|
||||
// ----------------------------------------
|
||||
|
||||
template <static_log2_argument_type x>
|
||||
struct static_log2 {
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
static_log2_result_type,
|
||||
value = detail::static_log2_impl::static_log2_impl<x>::value
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct static_log2<0> { };
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // include guard
|
||||
@@ -0,0 +1,50 @@
|
||||
|
||||
#ifndef BOOST_MPL_FIND_IF_HPP_INCLUDED
|
||||
#define BOOST_MPL_FIND_IF_HPP_INCLUDED
|
||||
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/aux_/find_if_pred.hpp>
|
||||
#include <boost/mpl/arg.hpp>
|
||||
#include <boost/mpl/iter_fold_if.hpp>
|
||||
#include <boost/mpl/aux_/common_name_wknd.hpp>
|
||||
#include <boost/mpl/aux_/na_spec.hpp>
|
||||
#include <boost/mpl/aux_/lambda_support.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
BOOST_MPL_AUX_COMMON_NAME_WKND(find_if)
|
||||
|
||||
template<
|
||||
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
|
||||
, typename BOOST_MPL_AUX_NA_PARAM(Predicate)
|
||||
>
|
||||
struct find_if
|
||||
{
|
||||
typedef typename iter_fold_if<
|
||||
Sequence
|
||||
, void
|
||||
, mpl::arg<1> // ignore
|
||||
, protect< aux::find_if_pred<Predicate> >
|
||||
>::type result_;
|
||||
|
||||
typedef typename second<result_>::type type;
|
||||
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,find_if,(Sequence,Predicate))
|
||||
};
|
||||
|
||||
BOOST_MPL_AUX_NA_SPEC(2,find_if)
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_FIND_IF_HPP_INCLUDED
|
||||
@@ -0,0 +1,54 @@
|
||||
/* Include file to configure the RS codec for integer symbols
|
||||
*
|
||||
* Copyright 2002, Phil Karn, KA9Q
|
||||
* May be used under the terms of the GNU General Public License (GPL)
|
||||
*/
|
||||
#define DTYPE int
|
||||
|
||||
/* Reed-Solomon codec control block */
|
||||
struct rs {
|
||||
unsigned int mm; /* Bits per symbol */
|
||||
unsigned int nn; /* Symbols per block (= (1<<mm)-1) */
|
||||
int *alpha_to; /* log lookup table */
|
||||
int *index_of; /* Antilog lookup table */
|
||||
int *genpoly; /* Generator polynomial */
|
||||
unsigned int nroots; /* Number of generator roots = number of parity symbols */
|
||||
unsigned int fcr; /* First consecutive root, index form */
|
||||
unsigned int prim; /* Primitive element, index form */
|
||||
unsigned int iprim; /* prim-th root of 1, index form */
|
||||
};
|
||||
|
||||
static inline int modnn(struct rs *rs,int x){
|
||||
while (x >= rs->nn) {
|
||||
x -= rs->nn;
|
||||
x = (x >> rs->mm) + (x & rs->nn);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
#define MODNN(x) modnn(rs,x)
|
||||
|
||||
#define MM (rs->mm)
|
||||
#define NN (rs->nn)
|
||||
#define ALPHA_TO (rs->alpha_to)
|
||||
#define INDEX_OF (rs->index_of)
|
||||
#define GENPOLY (rs->genpoly)
|
||||
#define NROOTS (rs->nroots)
|
||||
#define FCR (rs->fcr)
|
||||
#define PRIM (rs->prim)
|
||||
#define IPRIM (rs->iprim)
|
||||
#define A0 (NN)
|
||||
|
||||
#define ENCODE_RS encode_rs_int
|
||||
#define DECODE_RS decode_rs_int
|
||||
#define INIT_RS init_rs_int
|
||||
#define FREE_RS free_rs_int
|
||||
|
||||
void ENCODE_RS(void *p,DTYPE *data,DTYPE *parity);
|
||||
int DECODE_RS(void *p,DTYPE *data,int *eras_pos,int no_eras, int calc_syn);
|
||||
void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned int fcr,
|
||||
unsigned int prim,unsigned int nroots);
|
||||
void FREE_RS(void *p);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,536 @@
|
||||
#include "StationList.hpp"
|
||||
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
#include <QMetaType>
|
||||
#include <QAbstractTableModel>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
#include <QStringList>
|
||||
#include <QMimeData>
|
||||
#include <QDataStream>
|
||||
#include <QByteArray>
|
||||
#include <QDebug>
|
||||
#include <QDebugStateSaver>
|
||||
|
||||
#include "pimpl_impl.hpp"
|
||||
|
||||
#include "Radio.hpp"
|
||||
#include "Bands.hpp"
|
||||
#include "FrequencyList.hpp"
|
||||
|
||||
#if !defined (QT_NO_DEBUG_STREAM)
|
||||
QDebug operator << (QDebug debug, StationList::Station const& station)
|
||||
{
|
||||
QDebugStateSaver saver {debug};
|
||||
debug.nospace () << "Station("
|
||||
<< station.band_name_ << ", "
|
||||
<< station.offset_ << ", "
|
||||
<< station.antenna_description_ << ')';
|
||||
return debug;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDataStream& operator << (QDataStream& os, StationList::Station const& station)
|
||||
{
|
||||
return os << station.band_name_
|
||||
<< station.offset_
|
||||
<< station.antenna_description_;
|
||||
}
|
||||
|
||||
QDataStream& operator >> (QDataStream& is, StationList::Station& station)
|
||||
{
|
||||
return is >> station.band_name_
|
||||
>> station.offset_
|
||||
>> station.antenna_description_;
|
||||
}
|
||||
|
||||
|
||||
class StationList::impl final
|
||||
: public QAbstractTableModel
|
||||
{
|
||||
public:
|
||||
impl (Bands const * bands, Stations stations, QObject * parent)
|
||||
: QAbstractTableModel {parent}
|
||||
, bands_ {bands}
|
||||
, stations_ {stations}
|
||||
{
|
||||
}
|
||||
|
||||
Stations station_list (Stations);
|
||||
QModelIndex add (Station);
|
||||
FrequencyDelta offset (Frequency) const;
|
||||
|
||||
// Implement the QAbstractTableModel interface.
|
||||
int rowCount (QModelIndex const& parent = QModelIndex {}) const override;
|
||||
int columnCount (QModelIndex const& parent = QModelIndex {}) const override;
|
||||
Qt::ItemFlags flags (QModelIndex const& = QModelIndex {}) const override;
|
||||
QVariant data (QModelIndex const&, int role) const override;
|
||||
QVariant headerData (int section, Qt::Orientation, int = Qt::DisplayRole) const override;
|
||||
bool setData (QModelIndex const&, QVariant const& value, int role = Qt::EditRole) override;
|
||||
bool removeRows (int row, int count, QModelIndex const& parent = QModelIndex {}) override;
|
||||
bool insertRows (int row, int count, QModelIndex const& parent = QModelIndex {}) override;
|
||||
Qt::DropActions supportedDropActions () const override;
|
||||
QStringList mimeTypes () const override;
|
||||
QMimeData * mimeData (QModelIndexList const&) const override;
|
||||
bool dropMimeData (QMimeData const *, Qt::DropAction, int row, int column, QModelIndex const& parent) override;
|
||||
|
||||
// Helper method for band validation.
|
||||
QModelIndex first_matching_band (QString const& band_name) const
|
||||
{
|
||||
// find first exact match in bands
|
||||
auto matches = bands_->match (bands_->index (0, 0)
|
||||
, Qt::DisplayRole
|
||||
, band_name
|
||||
, 1
|
||||
, Qt::MatchExactly);
|
||||
return matches.isEmpty () ? QModelIndex {} : matches.first ();
|
||||
}
|
||||
|
||||
static int constexpr num_columns {3};
|
||||
static auto constexpr mime_type = "application/wsjt.antenna-descriptions";
|
||||
|
||||
Bands const * bands_;
|
||||
Stations stations_;
|
||||
};
|
||||
|
||||
StationList::StationList (Bands const * bands, QObject * parent)
|
||||
: StationList {bands, {}, parent}
|
||||
{
|
||||
}
|
||||
|
||||
StationList::StationList (Bands const * bands, Stations stations, QObject * parent)
|
||||
: QSortFilterProxyModel {parent}
|
||||
, m_ {bands, stations, parent}
|
||||
{
|
||||
setSourceModel (&*m_);
|
||||
setSortRole (SortRole);
|
||||
}
|
||||
|
||||
StationList::~StationList ()
|
||||
{
|
||||
}
|
||||
|
||||
auto StationList::station_list (Stations stations) -> Stations
|
||||
{
|
||||
return m_->station_list (stations);
|
||||
}
|
||||
|
||||
auto StationList::station_list () const -> Stations const&
|
||||
{
|
||||
return m_->stations_;
|
||||
}
|
||||
|
||||
QModelIndex StationList::add (Station s)
|
||||
{
|
||||
return mapFromSource (m_->add (s));
|
||||
}
|
||||
|
||||
bool StationList::remove (Station s)
|
||||
{
|
||||
auto row = m_->stations_.indexOf (s);
|
||||
if (0 > row)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return removeRow (row);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
bool row_is_higher (QModelIndex const& lhs, QModelIndex const& rhs)
|
||||
{
|
||||
return lhs.row () > rhs.row ();
|
||||
}
|
||||
}
|
||||
|
||||
bool StationList::removeDisjointRows (QModelIndexList rows)
|
||||
{
|
||||
bool result {true};
|
||||
|
||||
// We must work with source model indexes because we don't want row
|
||||
// removes to invalidate model indexes we haven't yet processed. We
|
||||
// achieve that by processing them in decending row order.
|
||||
for (int r = 0; r < rows.size (); ++r)
|
||||
{
|
||||
rows[r] = mapToSource (rows[r]);
|
||||
}
|
||||
|
||||
// reverse sort by row
|
||||
qSort (rows.begin (), rows.end (), row_is_higher);
|
||||
Q_FOREACH (auto index, rows)
|
||||
{
|
||||
if (result && !m_->removeRow (index.row ()))
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
auto StationList::offset (Frequency f) const -> FrequencyDelta
|
||||
{
|
||||
return m_->offset (f);
|
||||
}
|
||||
|
||||
|
||||
auto StationList::impl::station_list (Stations stations) -> Stations
|
||||
{
|
||||
beginResetModel ();
|
||||
std::swap (stations_, stations);
|
||||
endResetModel ();
|
||||
return stations;
|
||||
}
|
||||
|
||||
QModelIndex StationList::impl::add (Station s)
|
||||
{
|
||||
// Any band that isn't in the list may be added
|
||||
if (!stations_.contains (s))
|
||||
{
|
||||
auto row = stations_.size ();
|
||||
|
||||
beginInsertRows (QModelIndex {}, row, row);
|
||||
stations_.append (s);
|
||||
endInsertRows ();
|
||||
|
||||
return index (row, 0);
|
||||
}
|
||||
|
||||
return QModelIndex {};
|
||||
}
|
||||
|
||||
auto StationList::impl::offset (Frequency f) const -> FrequencyDelta
|
||||
{
|
||||
// Lookup band for frequency
|
||||
auto const& band = bands_->find (f);
|
||||
if (!band.isEmpty ())
|
||||
{
|
||||
// Lookup station for band
|
||||
for (int i = 0; i < stations_.size (); ++i)
|
||||
{
|
||||
if (stations_[i].band_name_ == band)
|
||||
{
|
||||
return stations_[i].offset_;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0; // no offset
|
||||
}
|
||||
|
||||
int StationList::impl::rowCount (QModelIndex const& parent) const
|
||||
{
|
||||
return parent.isValid () ? 0 : stations_.size ();
|
||||
}
|
||||
|
||||
int StationList::impl::columnCount (QModelIndex const& parent) const
|
||||
{
|
||||
return parent.isValid () ? 0 : num_columns;
|
||||
}
|
||||
|
||||
Qt::ItemFlags StationList::impl::flags (QModelIndex const& index) const
|
||||
{
|
||||
auto result = QAbstractTableModel::flags (index);
|
||||
|
||||
auto row = index.row ();
|
||||
auto column = index.column ();
|
||||
|
||||
if (index.isValid ()
|
||||
&& row < stations_.size ()
|
||||
&& column < num_columns)
|
||||
{
|
||||
if (description_column == column)
|
||||
{
|
||||
result |= Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
result |= Qt::ItemIsEditable | Qt::ItemIsDropEnabled;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result |= Qt::ItemIsDropEnabled;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QVariant StationList::impl::data (QModelIndex const& index, int role) const
|
||||
{
|
||||
QVariant item;
|
||||
|
||||
auto row = index.row ();
|
||||
auto column = index.column ();
|
||||
|
||||
if (index.isValid ()
|
||||
&& row < stations_.size ())
|
||||
{
|
||||
switch (column)
|
||||
{
|
||||
case band_column:
|
||||
switch (role)
|
||||
{
|
||||
case SortRole:
|
||||
{
|
||||
// Lookup band.
|
||||
auto band_index = first_matching_band (stations_.at (row).band_name_);
|
||||
// Use the sort role value of the band.
|
||||
item = band_index.data (Bands::SortRole);
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::DisplayRole:
|
||||
case Qt::EditRole:
|
||||
case Qt::AccessibleTextRole:
|
||||
item = stations_.at (row).band_name_;
|
||||
break;
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
case Qt::AccessibleDescriptionRole:
|
||||
item = tr ("Band name");
|
||||
break;
|
||||
|
||||
case Qt::TextAlignmentRole:
|
||||
item = Qt::AlignHCenter + Qt::AlignVCenter;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case offset_column:
|
||||
{
|
||||
auto frequency_offset = stations_.at (row).offset_;
|
||||
switch (role)
|
||||
{
|
||||
case SortRole:
|
||||
case Qt::EditRole:
|
||||
case Qt::AccessibleTextRole:
|
||||
item = frequency_offset;
|
||||
break;
|
||||
|
||||
case Qt::DisplayRole:
|
||||
item = Radio::pretty_frequency_MHz_string (frequency_offset) + " MHz";
|
||||
break;
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
case Qt::AccessibleDescriptionRole:
|
||||
item = tr ("Frequency offset");
|
||||
break;
|
||||
|
||||
case Qt::TextAlignmentRole:
|
||||
item = Qt::AlignRight + Qt::AlignVCenter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case description_column:
|
||||
switch (role)
|
||||
{
|
||||
case SortRole:
|
||||
case Qt::EditRole:
|
||||
case Qt::DisplayRole:
|
||||
case Qt::AccessibleTextRole:
|
||||
item = stations_.at (row).antenna_description_;
|
||||
break;
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
case Qt::AccessibleDescriptionRole:
|
||||
item = tr ("Antenna description");
|
||||
break;
|
||||
|
||||
case Qt::TextAlignmentRole:
|
||||
item = Qt::AlignLeft + Qt::AlignVCenter;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
QVariant StationList::impl::headerData (int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
QVariant header;
|
||||
|
||||
if (Qt::DisplayRole == role && Qt::Horizontal == orientation)
|
||||
{
|
||||
switch (section)
|
||||
{
|
||||
case band_column: header = tr ("Band"); break;
|
||||
case offset_column: header = tr ("Offset"); break;
|
||||
case description_column: header = tr ("Antenna Description"); break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
header = QAbstractTableModel::headerData (section, orientation, role);
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
bool StationList::impl::setData (QModelIndex const& model_index, QVariant const& value, int role)
|
||||
{
|
||||
bool changed {false};
|
||||
|
||||
auto row = model_index.row ();
|
||||
auto size = stations_.size ();
|
||||
if (model_index.isValid ()
|
||||
&& Qt::EditRole == role
|
||||
&& row < size)
|
||||
{
|
||||
QVector<int> roles;
|
||||
roles << role;
|
||||
|
||||
switch (model_index.column ())
|
||||
{
|
||||
case band_column:
|
||||
{
|
||||
// Check if band name is valid.
|
||||
auto band_index = first_matching_band (value.toString ());
|
||||
if (band_index.isValid ())
|
||||
{
|
||||
stations_[row].band_name_ = band_index.data ().toString ();
|
||||
Q_EMIT dataChanged (model_index, model_index, roles);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case offset_column:
|
||||
{
|
||||
if (value.canConvert<FrequencyDelta> ())
|
||||
{
|
||||
FrequencyDelta offset {qvariant_cast<Radio::FrequencyDelta> (value)};
|
||||
if (offset != stations_[row].offset_)
|
||||
{
|
||||
stations_[row].offset_ = offset;
|
||||
Q_EMIT dataChanged (model_index, model_index, roles);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case description_column:
|
||||
stations_[row].antenna_description_ = value.toString ();
|
||||
Q_EMIT dataChanged (model_index, model_index, roles);
|
||||
changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool StationList::impl::removeRows (int row, int count, QModelIndex const& parent)
|
||||
{
|
||||
if (0 < count && (row + count) <= rowCount (parent))
|
||||
{
|
||||
beginRemoveRows (parent, row, row + count - 1);
|
||||
for (auto r = 0; r < count; ++r)
|
||||
{
|
||||
stations_.removeAt (row);
|
||||
}
|
||||
endRemoveRows ();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StationList::impl::insertRows (int row, int count, QModelIndex const& parent)
|
||||
{
|
||||
if (0 < count)
|
||||
{
|
||||
beginInsertRows (parent, row, row + count - 1);
|
||||
for (auto r = 0; r < count; ++r)
|
||||
{
|
||||
stations_.insert (row, Station ());
|
||||
}
|
||||
endInsertRows ();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Qt::DropActions StationList::impl::supportedDropActions () const
|
||||
{
|
||||
return Qt::CopyAction | Qt::MoveAction;
|
||||
}
|
||||
|
||||
QStringList StationList::impl::mimeTypes () const
|
||||
{
|
||||
QStringList types;
|
||||
types << mime_type;
|
||||
types << "application/wsjt.Frequencies";
|
||||
return types;
|
||||
}
|
||||
|
||||
QMimeData * StationList::impl::mimeData (QModelIndexList const& items) const
|
||||
{
|
||||
QMimeData * mime_data = new QMimeData {};
|
||||
QByteArray encoded_data;
|
||||
QDataStream stream {&encoded_data, QIODevice::WriteOnly};
|
||||
|
||||
Q_FOREACH (auto const& item, items)
|
||||
{
|
||||
if (item.isValid ())
|
||||
{
|
||||
stream << QString {data (item, Qt::DisplayRole).toString ()};
|
||||
}
|
||||
}
|
||||
|
||||
mime_data->setData (mime_type, encoded_data);
|
||||
return mime_data;
|
||||
}
|
||||
|
||||
bool StationList::impl::dropMimeData (QMimeData const * data, Qt::DropAction action, int /* row */, int /* column */, QModelIndex const& parent)
|
||||
{
|
||||
if (Qt::IgnoreAction == action)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (parent.isValid ()
|
||||
&& description_column == parent.column ()
|
||||
&& data->hasFormat (mime_type))
|
||||
{
|
||||
QByteArray encoded_data {data->data (mime_type)};
|
||||
QDataStream stream {&encoded_data, QIODevice::ReadOnly};
|
||||
auto dest_index = parent;
|
||||
while (!stream.atEnd ())
|
||||
{
|
||||
QString text;
|
||||
stream >> text;
|
||||
setData (dest_index, text);
|
||||
dest_index = index (dest_index.row () + 1, dest_index.column (), QModelIndex {});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (data->hasFormat ("application/wsjt.Frequencies"))
|
||||
{
|
||||
QByteArray encoded_data {data->data ("application/wsjt.Frequencies")};
|
||||
QDataStream stream {&encoded_data, QIODevice::ReadOnly};
|
||||
while (!stream.atEnd ())
|
||||
{
|
||||
FrequencyList::Item item;
|
||||
stream >> item;
|
||||
auto const& band = bands_->find (item.frequency_);
|
||||
if (stations_.cend () == std::find_if (stations_.cbegin ()
|
||||
, stations_.cend ()
|
||||
, [&band] (Station const& s) {return s.band_name_ == band;}))
|
||||
{
|
||||
// not found so add it
|
||||
add (Station {band, 0, QString {}});
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
/*=============================================================================
|
||||
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)
|
||||
|
||||
This is an auto-generated file. Do not edit!
|
||||
==============================================================================*/
|
||||
namespace boost { namespace fusion {
|
||||
struct deque_tag;
|
||||
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
|
||||
struct deque
|
||||
:
|
||||
detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>::type,
|
||||
sequence_base<deque<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9> >
|
||||
{
|
||||
typedef deque_tag fusion_tag;
|
||||
typedef bidirectional_traversal_tag category;
|
||||
typedef typename detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>::type base;
|
||||
typedef typename detail::deque_initial_size<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>::type size;
|
||||
typedef mpl::int_<size::value> next_up;
|
||||
typedef mpl::int_<-1> next_down;
|
||||
typedef mpl::false_ is_view;
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1)
|
||||
: base(detail::deque_keyed_values<T0 , T1>::construct(t0 , t1))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1)
|
||||
: base(detail::deque_keyed_values<T0 , T1>::construct(t0 , t1))
|
||||
{}
|
||||
template <typename T_0 , typename T_1>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1)
|
||||
: base(detail::deque_keyed_values<T0 , T1>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2>::construct(t0 , t1 , t2))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2>::construct(t0 , t1 , t2))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2 , typename detail::call_param<T3 >::type t3)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3>::construct(t0 , t1 , t2 , t3))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2 , T3 const& t3)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3>::construct(t0 , t1 , t2 , t3))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2 , typename T_3>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2 , typename detail::call_param<T3 >::type t3 , typename detail::call_param<T4 >::type t4)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4>::construct(t0 , t1 , t2 , t3 , t4))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2 , T3 const& t3 , T4 const& t4)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4>::construct(t0 , t1 , t2 , t3 , t4))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2 , typename T_3 , typename T_4>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3) , std::forward<T_4>( t4)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2 , typename detail::call_param<T3 >::type t3 , typename detail::call_param<T4 >::type t4 , typename detail::call_param<T5 >::type t5)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5>::construct(t0 , t1 , t2 , t3 , t4 , t5))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2 , T3 const& t3 , T4 const& t4 , T5 const& t5)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5>::construct(t0 , t1 , t2 , t3 , t4 , t5))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2 , typename T_3 , typename T_4 , typename T_5>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3) , std::forward<T_4>( t4) , std::forward<T_5>( t5)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2 , typename detail::call_param<T3 >::type t3 , typename detail::call_param<T4 >::type t4 , typename detail::call_param<T5 >::type t5 , typename detail::call_param<T6 >::type t6)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2 , T3 const& t3 , T4 const& t4 , T5 const& t5 , T6 const& t6)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2 , typename T_3 , typename T_4 , typename T_5 , typename T_6>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_6 && t6)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3) , std::forward<T_4>( t4) , std::forward<T_5>( t5) , std::forward<T_6>( t6)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2 , typename detail::call_param<T3 >::type t3 , typename detail::call_param<T4 >::type t4 , typename detail::call_param<T5 >::type t5 , typename detail::call_param<T6 >::type t6 , typename detail::call_param<T7 >::type t7)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2 , T3 const& t3 , T4 const& t4 , T5 const& t5 , T6 const& t6 , T7 const& t7)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2 , typename T_3 , typename T_4 , typename T_5 , typename T_6 , typename T_7>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_6 && t6 , T_7 && t7)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3) , std::forward<T_4>( t4) , std::forward<T_5>( t5) , std::forward<T_6>( t6) , std::forward<T_7>( t7)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2 , typename detail::call_param<T3 >::type t3 , typename detail::call_param<T4 >::type t4 , typename detail::call_param<T5 >::type t5 , typename detail::call_param<T6 >::type t6 , typename detail::call_param<T7 >::type t7 , typename detail::call_param<T8 >::type t8)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2 , T3 const& t3 , T4 const& t4 , T5 const& t5 , T6 const& t6 , T7 const& t7 , T8 const& t8)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2 , typename T_3 , typename T_4 , typename T_5 , typename T_6 , typename T_7 , typename T_8>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_6 && t6 , T_7 && t7 , T_8 && t8)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3) , std::forward<T_4>( t4) , std::forward<T_5>( t5) , std::forward<T_6>( t6) , std::forward<T_7>( t7) , std::forward<T_8>( t8)))
|
||||
{}
|
||||
# endif
|
||||
# if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(typename detail::call_param<T0 >::type t0 , typename detail::call_param<T1 >::type t1 , typename detail::call_param<T2 >::type t2 , typename detail::call_param<T3 >::type t3 , typename detail::call_param<T4 >::type t4 , typename detail::call_param<T5 >::type t5 , typename detail::call_param<T6 >::type t6 , typename detail::call_param<T7 >::type t7 , typename detail::call_param<T8 >::type t8 , typename detail::call_param<T9 >::type t9)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9))
|
||||
{}
|
||||
# endif
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T0 const& t0 , T1 const& t1 , T2 const& t2 , T3 const& t3 , T4 const& t4 , T5 const& t5 , T6 const& t6 , T7 const& t7 , T8 const& t8 , T9 const& t9)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>::construct(t0 , t1 , t2 , t3 , t4 , t5 , t6 , t7 , t8 , t9))
|
||||
{}
|
||||
template <typename T_0 , typename T_1 , typename T_2 , typename T_3 , typename T_4 , typename T_5 , typename T_6 , typename T_7 , typename T_8 , typename T_9>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(T_0 && t0 , T_1 && t1 , T_2 && t2 , T_3 && t3 , T_4 && t4 , T_5 && t5 , T_6 && t6 , T_7 && t7 , T_8 && t8 , T_9 && t9)
|
||||
: base(detail::deque_keyed_values<T0 , T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9>::
|
||||
forward_(std::forward<T_0>( t0) , std::forward<T_1>( t1) , std::forward<T_2>( t2) , std::forward<T_3>( t3) , std::forward<T_4>( t4) , std::forward<T_5>( t5) , std::forward<T_6>( t6) , std::forward<T_7>( t7) , std::forward<T_8>( t8) , std::forward<T_9>( t9)))
|
||||
{}
|
||||
# endif
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque()
|
||||
{}
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(typename detail::call_param<T0>::type t0)
|
||||
: base(t0, detail::nil_keyed_element())
|
||||
{}
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(deque const& rhs)
|
||||
: base(rhs)
|
||||
{}
|
||||
template<typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9> const& seq)
|
||||
: base(seq)
|
||||
{}
|
||||
template<typename Sequence>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(Sequence const& seq
|
||||
, typename disable_if<is_convertible<Sequence, T0>, detail::enabler_>::type = detail::enabler
|
||||
, typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler)
|
||||
: base(base::from_iterator(fusion::begin(seq)))
|
||||
{}
|
||||
template <typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque&
|
||||
operator=(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9> const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
template <typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque&
|
||||
operator=(T const& rhs)
|
||||
{
|
||||
base::operator=(rhs);
|
||||
return *this;
|
||||
}
|
||||
# if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <typename T0_>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(T0_&& t0
|
||||
, typename enable_if<is_convertible<T0_, T0>, detail::enabler_>::type = detail::enabler
|
||||
)
|
||||
: base(std::forward<T0_>( t0), detail::nil_keyed_element())
|
||||
{}
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(deque&& rhs)
|
||||
: base(std::forward<deque>(rhs))
|
||||
{}
|
||||
template<typename U0 , typename U1 , typename U2 , typename U3 , typename U4 , typename U5 , typename U6 , typename U7 , typename U8 , typename U9>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9>&& seq
|
||||
, typename disable_if<
|
||||
is_convertible<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9>, T0>
|
||||
, detail::enabler_
|
||||
>::type = detail::enabler)
|
||||
: base(std::forward<deque<U0 , U1 , U2 , U3 , U4 , U5 , U6 , U7 , U8 , U9>>(seq))
|
||||
{}
|
||||
template <typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque&
|
||||
operator=(T&& rhs)
|
||||
{
|
||||
base::operator=(std::forward<T>( rhs));
|
||||
return *this;
|
||||
}
|
||||
# endif
|
||||
};
|
||||
template <>
|
||||
struct deque<> : detail::nil_keyed_element
|
||||
{
|
||||
typedef deque_tag fusion_tag;
|
||||
typedef bidirectional_traversal_tag category;
|
||||
typedef mpl::int_<0> size;
|
||||
typedef mpl::int_<0> next_up;
|
||||
typedef mpl::int_<-1> next_down;
|
||||
typedef mpl::false_ is_view;
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(Sequence const&,
|
||||
typename enable_if<
|
||||
mpl::and_<
|
||||
traits::is_sequence<Sequence>
|
||||
, result_of::empty<Sequence> >, detail::enabler_>::type = detail::enabler) BOOST_NOEXCEPT
|
||||
{}
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque() BOOST_NOEXCEPT {}
|
||||
};
|
||||
}}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Andrey Semashev
|
||||
*
|
||||
* 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_DETAIL_SCOPED_ENUM_EMULATION_HPP
|
||||
#define BOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP
|
||||
|
||||
// The header file at this path is deprecated;
|
||||
// use boost/core/scoped_enum.hpp instead.
|
||||
|
||||
#include <boost/core/scoped_enum.hpp>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
|
||||
#ifndef BOOST_MPL_VECTOR_AUX_BEGIN_END_HPP_INCLUDED
|
||||
#define BOOST_MPL_VECTOR_AUX_BEGIN_END_HPP_INCLUDED
|
||||
|
||||
// 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)
|
||||
//
|
||||
// See http://www.boost.org/libs/mpl for documentation.
|
||||
|
||||
// $Id$
|
||||
// $Date$
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/aux_/config/typeof.hpp>
|
||||
|
||||
#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
|
||||
|
||||
# include <boost/mpl/begin_end_fwd.hpp>
|
||||
# include <boost/mpl/vector/aux_/iterator.hpp>
|
||||
# include <boost/mpl/vector/aux_/tag.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template<>
|
||||
struct begin_impl< aux::vector_tag >
|
||||
{
|
||||
template< typename Vector > struct apply
|
||||
{
|
||||
typedef v_iter<Vector,0> type;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct end_impl< aux::vector_tag >
|
||||
{
|
||||
template< typename Vector > struct apply
|
||||
{
|
||||
typedef v_iter<Vector,Vector::size::value> type;
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
|
||||
|
||||
#endif // BOOST_MPL_VECTOR_AUX_BEGIN_END_HPP_INCLUDED
|
||||
@@ -0,0 +1,101 @@
|
||||
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
|
||||
|
||||
#include <boost/proto/transform/detail/preprocessed/when.hpp>
|
||||
|
||||
#elif !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/when.hpp")
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// \file when.hpp
|
||||
/// Definition of when transform.
|
||||
//
|
||||
// Copyright 2008 Eric Niebler. 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(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 \
|
||||
(3, (0, BOOST_PROTO_MAX_ARITY, <boost/proto/transform/detail/when.hpp>))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
/// \brief A grammar element and a PrimitiveTransform that associates
|
||||
/// a transform with the grammar.
|
||||
///
|
||||
/// Use <tt>when\<\></tt> to override a grammar's default transform
|
||||
/// with a custom transform. It is for used when composing larger
|
||||
/// transforms by associating smaller transforms with individual
|
||||
/// rules in your grammar, as in the following transform which
|
||||
/// counts the number of terminals in an expression.
|
||||
///
|
||||
/// \code
|
||||
/// // Count the terminals in an expression tree.
|
||||
/// // Must be invoked with initial state == mpl::int_<0>().
|
||||
/// struct CountLeaves
|
||||
/// : or_<
|
||||
/// when<terminal<_>, mpl::next<_state>()>
|
||||
/// , otherwise<fold<_, _state, CountLeaves> >
|
||||
/// >
|
||||
/// {};
|
||||
/// \endcode
|
||||
///
|
||||
/// The <tt>when\<G, R(A0,A1,...)\></tt> form accepts either a
|
||||
/// CallableTransform or an ObjectTransform as its second parameter.
|
||||
/// <tt>when\<\></tt> uses <tt>is_callable\<R\>::value</tt> to
|
||||
/// distinguish between the two, and uses <tt>call\<\></tt> to
|
||||
/// evaluate CallableTransforms and <tt>make\<\></tt> to evaluate
|
||||
/// ObjectTransforms.
|
||||
template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
|
||||
struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A))>
|
||||
: detail::when_impl<Grammar, R, R(BOOST_PP_ENUM_PARAMS(N, A))>
|
||||
{};
|
||||
|
||||
#if N > 0
|
||||
/// \brief A grammar element and a PrimitiveTransform that associates
|
||||
/// a transform with the grammar.
|
||||
///
|
||||
/// Use <tt>when\<\></tt> to override a grammar's default transform
|
||||
/// with a custom transform. It is for used when composing larger
|
||||
/// transforms by associating smaller transforms with individual
|
||||
/// rules in your grammar, as in the following transform which
|
||||
/// counts the number of terminals in an expression.
|
||||
///
|
||||
/// \code
|
||||
/// // Count the terminals in an expression tree.
|
||||
/// // Must be invoked with initial state == mpl::int_<0>().
|
||||
/// struct CountLeaves
|
||||
/// : or_<
|
||||
/// when<terminal<_>, mpl::next<_state>()>
|
||||
/// , otherwise<fold<_, _state, CountLeaves> >
|
||||
/// >
|
||||
/// {};
|
||||
/// \endcode
|
||||
///
|
||||
/// The <tt>when\<G, R(A0,A1,...)\></tt> form accepts either a
|
||||
/// CallableTransform or an ObjectTransform as its second parameter.
|
||||
/// <tt>when\<\></tt> uses <tt>is_callable\<R\>::value</tt> to
|
||||
/// distinguish between the two, and uses <tt>call\<\></tt> to
|
||||
/// evaluate CallableTransforms and <tt>make\<\></tt> to evaluate
|
||||
/// ObjectTransforms.
|
||||
template<typename Grammar, typename R BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
|
||||
struct when<Grammar, R(BOOST_PP_ENUM_PARAMS(N, A)...)>
|
||||
: detail::when_impl<Grammar, R, R(BOOST_PP_ENUM_PARAMS(N, A)...)>
|
||||
{};
|
||||
#endif
|
||||
|
||||
#undef N
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright Rene Rivera 2008-2015
|
||||
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_PREDEF_OS_IRIX_H
|
||||
#define BOOST_PREDEF_OS_IRIX_H
|
||||
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
|
||||
/*`
|
||||
[heading `BOOST_OS_IRIX`]
|
||||
|
||||
[@http://en.wikipedia.org/wiki/Irix IRIX] operating system.
|
||||
|
||||
[table
|
||||
[[__predef_symbol__] [__predef_version__]]
|
||||
|
||||
[[`sgi`] [__predef_detection__]]
|
||||
[[`__sgi`] [__predef_detection__]]
|
||||
]
|
||||
*/
|
||||
|
||||
#define BOOST_OS_IRIX BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
|
||||
defined(sgi) || defined(__sgi) \
|
||||
)
|
||||
# undef BOOST_OS_IRIX
|
||||
# define BOOST_OS_IRIX BOOST_VERSION_NUMBER_AVAILABLE
|
||||
#endif
|
||||
|
||||
#if BOOST_OS_IRIX
|
||||
# define BOOST_OS_IRIX_AVAILABLE
|
||||
# include <boost/predef/detail/os_detected.h>
|
||||
#endif
|
||||
|
||||
#define BOOST_OS_IRIX_NAME "IRIX"
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/predef/detail/test.h>
|
||||
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_IRIX,BOOST_OS_IRIX_NAME)
|
||||
@@ -0,0 +1,40 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2005-2013 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(BOOST_FUSION_MAP_BEGIN_IMPL_02042013_0857)
|
||||
#define BOOST_FUSION_MAP_BEGIN_IMPL_02042013_0857
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/container/map/map_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct map_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct begin_impl;
|
||||
|
||||
template<>
|
||||
struct begin_impl<map_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef map_iterator<Sequence, 0> type;
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
static type call(Sequence& seq)
|
||||
{
|
||||
return type(seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
// Boost.Range library
|
||||
//
|
||||
// Copyright Thorsten Ottosen 2003-2004. 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_RESULT_ITERATOR_HPP
|
||||
#define BOOST_RANGE_RESULT_ITERATOR_HPP
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#include <boost/range/iterator.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
//
|
||||
// This interface is deprecated, use range_iterator<T>
|
||||
//
|
||||
|
||||
template< typename C >
|
||||
struct range_result_iterator : range_iterator<C>
|
||||
{ };
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
|
||||
#define BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
|
||||
|
||||
//
|
||||
// Copyright 2015 Peter Dimov
|
||||
//
|
||||
// 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
|
||||
//
|
||||
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_volatile.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
template<class T, class U> struct copy_cv
|
||||
{
|
||||
private:
|
||||
|
||||
typedef typename boost::conditional<boost::is_const<U>::value, typename boost::add_const<T>::type, T>::type CT;
|
||||
|
||||
public:
|
||||
|
||||
typedef typename boost::conditional<boost::is_volatile<U>::value, typename boost::add_volatile<CT>::type, CT>::type type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #ifndef BOOST_TYPE_TRAITS_COPY_CV_HPP_INCLUDED
|
||||
Reference in New Issue
Block a user