x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
token_cache.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\wave\cpplexer\token_cache.hpp
旋转
特效
属性
历史版本
/*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library http://www.boost.org/ Copyright (c) 2001-2008 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(TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED) #define TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED #include
#include
#include
// this must occur after all of the includes and before any code appears #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_PREFIX #endif /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace wave { namespace cpplexer { /////////////////////////////////////////////////////////////////////////////// // // The token_cache template is used to cache the tokens corresponding to the // keywords, operators and other constant language elements. // // This avoids repeated construction of these tokens, which is especially // effective when used in conjunction with a copy on write string // implementation (COW string). // /////////////////////////////////////////////////////////////////////////////// template
class token_cache { public: token_cache() : cache(T_LAST_TOKEN - T_FIRST_TOKEN) { typename std::vector
::iterator it = cache.begin(); for (unsigned int i = T_FIRST_TOKEN; i < T_LAST_TOKEN; ++i, ++it) { *it = StringT(boost::wave::get_token_value(token_id(i))); } } StringT const &get_token_value(token_id id) const { return cache[BASEID_FROM_TOKEN(id) - T_FIRST_TOKEN]; } private: std::vector
cache; }; /////////////////////////////////////////////////////////////////////////////// } // namespace cpplexer } // namespace wave } // namespace boost // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX #endif #endif // !defined(TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
token_cache.hpp
网页地址
文件地址
上一页
8/9
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.