x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
optimize.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\xpressive\detail\core\optimize.hpp
Girar
Efecto
Propiedad
Historial
/////////////////////////////////////////////////////////////////////////////// // optimize.hpp // // Copyright 2007 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) #ifndef BOOST_XPRESSIVE_DETAIL_CORE_OPTIMIZE_HPP_EAN_10_04_2005 #define BOOST_XPRESSIVE_DETAIL_CORE_OPTIMIZE_HPP_EAN_10_04_2005 #include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace xpressive { namespace detail { /////////////////////////////////////////////////////////////////////////////// // optimize_regex // template
intrusive_ptr
> optimize_regex ( xpression_peeker
::type> const &peeker , Traits const &traits , mpl::false_ ) { if(peeker.line_start()) { return intrusive_ptr
> ( new line_start_finder
(traits) ); } else if(256 != peeker.bitset().count()) { return intrusive_ptr
> ( new hash_peek_finder
(peeker.bitset()) ); } return intrusive_ptr
>(); } /////////////////////////////////////////////////////////////////////////////// // optimize_regex // template
intrusive_ptr
> optimize_regex ( xpression_peeker
::type> const &peeker , Traits const &traits , mpl::true_ ) { typedef typename iterator_value
::type char_type; // if we have a leading string literal, initialize a boyer-moore struct with it peeker_string
const &str = peeker.get_string(); if(str.begin_ != str.end_) { BOOST_ASSERT(1 == peeker.bitset().count()); return intrusive_ptr
> ( new boyer_moore_finder
(str.begin_, str.end_, traits, str.icase_) ); } return optimize_regex
(peeker, traits, mpl::false_()); } /////////////////////////////////////////////////////////////////////////////// // common_compile // template
void common_compile ( intrusive_ptr
const> const ®ex , regex_impl
&impl , Traits const &traits ) { typedef typename iterator_value
::type char_type; // "link" the regex xpression_linker
linker(traits); regex->link(linker); // "peek" into the compiled regex to see if there are optimization opportunities hash_peek_bitset
bset; xpression_peeker
peeker(bset, traits); regex->peek(peeker); // optimization: get the peek chars OR the boyer-moore search string impl.finder_ = optimize_regex
(peeker, traits, is_random
()); impl.xpr_ = regex; } }}} // namespace boost::xpressive #endif
optimize.hpp
Dirección de la página
Dirección del archivo
Anterior
9/16
Siguiente
Descargar
( 3 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.