The Context Object 上下文對像

Introduction 簡介
Header 'wave/context.hpp' synopsis 頭文件'wave/context.hpp'概要
Public Typedefs 公有typedef
Template parameters 模板參數
Member functions 成員函數

Introduction 簡介

The boost::wave::context<> object is the main user visible object of the Wave library. It exists to generate the pair of iterators, which while dereferenced return the preprocessed tokens. Additionally it is used to control other aspects of the preprocessing, such as
boost::wave::context<> 對象是 Wave 庫主要的用戶可見的對象。它用於生成迭代器對,後者在提領時返回預處理單詞。另外,它還用於控制預處理的其它方面,如:

 include search paths, which define, where to search for files to be included with #include <...> and #include "..." directives
    包含查找路徑,定義了到何處查找 #include <...>#include "..." 指令所包含的文件
 which macros to predefine and which of the predefined macros to undefine
    哪些宏被預定義,以及哪些預定義宏被去定義
 several other options as for instance to control, whether to enable several extensions to the C++ Standard (as for instance variadics and placemarkers) or not.
一些其它選項,如控制是否激活C++標準的幾個擴展(例如 variadics 和 placemarkers)。

Header wave/cpp_context.hpp synopsis 頭文件 wave/cpp_context.hpp 概要

namespace boost {
namespace wave {

struct this_type {};

template <
typename Iterator, typename LexIterator,
typename InputPolicy, typename ContextPolicy,
typename Derived = this_type
>
class context : public InputPolicy
{
typedef <unspecified> token_sequence_type;

public:

typedef pp_iterator<context> iterator_type;
typedef Token token_type;
typedef typename token_type::position_type position_type;
typedef std::list<token_type> token_sequence_type;

// constructor
context(Iterator const &first_,
Iterator const &last_,
char const *fname = "<Unknown>",
ContextPolicy const& ctx_policy = ContextPolicy())

// iterator interface
iterator_type begin() const;
iterator_type begin(Iterator const &first,
Iterator const &last) const;
iterator_type end() const;

// maintain include paths
bool add_include_path(char const *path_);
bool add_sysinclude_path(char const *path_);
void set_sysinclude_delimiter();

size_t get_iteration_depth() const;

// maintain defined macros
template <typename String>
bool add_macro_definition(String macrostring,
bool is_predefined = false);
template <typename String>
bool add_macro_definition(StringT const &name,
position_type const& pos, bool has_params,
std::vector<token_type> &parameters,
token_sequence_type &definition,
bool is_predefined = false)

template <typename String>
bool is_defined_macro(String const &name) const;
template <typename String>
bool remove_macro_definition(String const &name,
bool even_predefined = false);
void reset_macro_definitions();
template <typename String>
bool get_macro_definition(
String const &name, bool &is_function_style,
bool
&is_predefined, position_type &pos,
std::vector<token_type> &parameters,
token_sequence_type &definition) const;

typedef <unspecified> macromap_type;
typedef typename macromap_type::name_iterator name_iterator;
typedef typename macromap_type::const_name_iterator const_name_iterator;

name_iterator macro_names_begin();
name_iterator macro_names_end();
const_name_iterator macro_names_begin() const;
const_name_iterator macro_names_end() const;

// other options
void set_language(language_support enable);
language_support get_language() const;

void set_max_include_nesting_depth(std::size_t new_depth);
size_t get_max_include_nesting_depth() const;

// get the Wave version information
static std::string get_version();
static std::string get_version_string();
};

} // namespace wave
} // namespace boost

Template parameters 模板參數

The boost::wave::context object has three template parameters to specify the concrete behaviour of its operation. The following table describes these with more detail.
boost::wave::context 對像具有三個模板參數,以指定其操作的具體行為。下表描述了相關細節。

Template parameters required for the boost::wave::context class
boost::wave::context 類所需的模板參數
Iterator

The type of the underlying iterator, through which the input stream is accessed.
底層迭代器的類型,通過它訪問輸入流。
This should be at least an forward_iterator type iterator.

至少應為 forward_iterator 類型的迭代器。

LexIterator

The type of the lexer type to be used by the Wave library to identify tokens in the input stream.

Wave 庫用於從輸入流中識別單詞的lexer類型。

InputPolicy

The type of the input policy class, which allows to customize the behaviour of the Wave library and the type of the iterators to use, when it comes to including and opening an included file.

輸入策略類的類型,用於對 Wave 庫的行為以及包含或打開一個包含文件時使用的迭代器類型進行定制。

ContextPolicy

The type of the context policy class, which allows to customize different aspects of the behaviour of the preprocessing. The requirements of this policy and the available customization points provided by this policy are described here.    
上下文策略類的類型,用於對預處理行為的其它方面進行定制。對該策略類的要求以及此策略提供的可定制點在此處說明。

Derived

The type of the type being derived from the context type (if any). This template parameter is optional and defaults to 'this_type', which means that the context type will be used assuming no derived type exists. 
從上下文類型派生的類型(如果有)。該模板參數是可選的,缺省為'this_type',即將被使用的上下文類型假定沒有派生類存在。

For further information about the lexer type to use, please refer to the The Lexer Interface .
有關所用的lexer類型的更多信息,請參考Lexer接口

If the template parameter InputPolicy is omitted, the template boost::wave::iteration_context_policies::load_file_to_string is used. For further information about the input policy, please refer to the topic The Input Policy.
如果模板參數InputPolicy被省略,則使用模板 boost::wave::iteration_context_policies::load_file_to_string 。有關這個輸入策略的更多信息,請參考主題 輸入策略

If the template parameter ContextPolicy is omitted, the boost::wave::context_policies::eat_whitespace policy type is used, implementing certain basic preprocessing hooks needed for normal (default) execution. For further information about the context policy, please refer to the topic The Context Policy.
如果模板參數ContextPolicy被省略,則使用 boost::wave::context_policies::eat_whitespace 策略類型,它實現了普通(缺省)執行所需的特定基本預處理鉤子。有關此上下文策略的更多信息,請參考主題 上下文策略

Public Typedefs 公有typedef

The boost::wave::context template defines the following public typedefs, which may be useful while using this class:
模板 boost::wave::context 定義了以下公有 typedef,在使用該類時可能需要用到:

Public typedef's defined by the boost::wave::context class
boost::wave::context 類定義的公有 typedef
iterator_type

The Iterator template parameter provided, while the context class was instantiated.
提供模板參數 Iterator,當 context 類被實例化時。

lex_type

The LexIterator template parameter provided, while the context class was instantiated.
提供模板參數 LexIterator,當 context 類被實例化時。

token_type

The token type, which is returned by the context generated iterators. This type is taken from the LexIterator template parameter provided, whicle the context class was instantiated.
context 生成的迭代器所返回的單詞類型。該類型來自於模板參數 LexIterator,當 context 類被實例化時。

input_policy_type

The InputPolicy template parameter provided, while the context class was instantiated.
提供模板參數 InputPolicy,當 context 類被實例化時。

context_policy_type

The ContextPolicy template parameter provided, while the context class was instantiated.
提供模板參數 ContextPolicy,當 context 類被實例化時。

position_type

The type of the position information contained in every returned token, which describes the point, at which the given token was recognised.

包含在每個返回的單詞中的位置信息的類型,該位置信息用於指出識別出給定單詞的點。

Member functions 成員函數

Constructor 構造函數

    context(Iterator const &first, 
Iterator const &last, char const *filename,
ContextPolicy const& ctx_policy);

Constructs a context object on top of the input stream given by the pair of auxilliary iterators [first, last). The iterators should be at least forward_iterator type iterators. The filename parameter is to be supplied for informational purposes only. This string is used for indicating the token positions inside the input stream, it is not validated against the file system. If the filename parameter is not given it defaults to "<Unknown>". If the ctx_policy parameter isn't supplied it defaults to a default constructed ContextPolicy object.
在由輔助迭代器對[first, last)所給定的輸入流之上構造一個context對象。這兩個迭代器應該至少是 forward_iterator 類型的迭代器。參數filename僅用於提供信息。該字符串用於表示在輸入流內部的單詞位置,其有效性與文件系統無關。如果參數filename未給定,則缺省為 "<Unknown>"。如果參數ctx_policy未給定,則缺省為一個缺省構造的ContextPolicy對象。

Additionally the macro symbol table is filled with the predefined macros and the current reference directory is set to the path of the given filename. If this filename does not reference valid file system item, the current reference directory is set to the current system directory. (The current reference directory is the file system path, which is used as the target directory during the processing of #include "..." directives).
此外,用預定義的宏填充宏符號表,且當前參考目錄被設置為給定文件名的路徑。如果該文件名不是指向有效的文件系統項,則當前參考目錄被設置為當前系統目錄。(當前參考目錄是文件系統路徑,在處理 #include "..." 指令時被用作目標目錄)。

Iterator interface 迭代器接口

The pair of iterators returned by the context::begin and context::end functions is the main interface for accessing the preprocessed tokens from the preprocessor engine. While iterating over the given iterator range [begin, end) there are returned the preprocessed C++ tokens, which are generated on the fly from the underlying input stream. The returned iterators are conceptually of forward_iterator type.
函數 context::begincontext::end 所返回的迭代器對是從預處理引擎訪問預處理單詞的主要接口。在對給定的迭代器區間 [begin, end) 進行迭代時,將返回預處理後的C++單詞,它們是從底層的輸入流就地生成的。返回的迭代器概念上為 forward_iterator 類型。

begin

    iterator_type begin();
iterator_type begin(Iterator const &first,
Iterator const &last, );

Initializes and returns the starting iterator for the preprocessed token stream. The iterator pair given by the parameters  [first, last) specifies the input sequence to preprocess. The first version of this function uses the iinput stream as specified by the constructor. 
初始化並返回預處理後的單詞流的開始迭代器。由參數  [first, last) 給定的迭代器對指定了進行預處理的輸入序列。該函數的第一個版本使用由構造函數指定的輸入流。

end

    iterator_type end() const;

Initializes and returns the end of stream iterator to compare with for detecting the end of the preprocessed token stream.
初始化並返回流迭代器的結尾,用於與其它迭代器進行比較以檢測預處理後的單詞流的結束。

Maintain include paths 維護包含路徑

The Wave library maintains two separate search paths for include files. A search path for user include files and a search path for system include files. Any directories specified with the add_include_path() function before the function set_sysinclude_delimiter() is called are searched only for the case of #include "..." directives, they are not searched for #include <file> directives. I.e. these directories are added to the user include search path.
Wave 庫為包含頭文件維護了兩個獨立的查找路徑。一個查找路徑用於用戶頭文件,另一個查找路徑則用於系統頭文件。在 set_sysinclude_delimiter() 函數被調用之前由 add_include_path() 函數所指定的所有目錄均只在處理 #include "..." 指令時進行查找,這些目錄不會在處理 #include <file> 指令時進行查找。即,這些目錄被增加到用戶頭文件查找路徑中。

If additional directories are specified with the add_include_path() function after a call to the function set_sysinclude_delimiter(), these directories are searched for all #include directives. I.e. these directories are added to the system include search path.
如果在調用 set_sysinclude_delimiter() 函數後,又用 add_include_path() 函數指定了其它目錄,則這些目錄會對所有 #include 指令進行查找。即,這些目錄被增加到系統頭文件查找路徑中。

In addition, a call to the function set_sysinclude_delimiter() inhibits the use of the current reference directory as the first search directory for #include "..." directives. Therefore, the current reference directory is searched only, if it is requested explicitly with a call to the function add_include_path(".").
另外,調用函數 set_sysinclude_delimiter() 將禁止將當前參考目錄作為 #include "..." 指令的第一個查找目錄。因此,當前參考目錄僅當存在顯式的 add_include_path(".") 函數調用時才會被查找。

Callig both functions, the set_sysinclude_delimiter() and add_include_path(".") allows you to control precisely, which directories are searched before the current one and which are searched after.
通過對 set_sysinclude_delimiter()add_include_path(".") 兩個函數的調用,可以讓你精確地控制哪些目錄在當前目錄之前查找,哪些在之後查找。

These functions are modelled after the command line behaviour implemented by the popular gcc compiler.
這些函數是仿照gcc編譯器的命令行行為執行的。

add_include_path

    bool add_include_path(char const *path);

Adds the given file system path to the user include search paths. After a call to the set_sysinclude_delimiter() this function adds the given file system path to the system include search paths. Note though, that the given path is validated against the file system.
增加給定的文件系統路徑到用戶頭文件查找路徑。在調用 set_sysinclude_delimiter() 之後,該函數變為增加給定的文件系統路徑到系統頭文件查找路徑。不過要注意,給定的路徑必須是文件系統有效的。

If the given path string does not form a name of a valid file system directory item, the function returns false. If the given path was successfully added to the include search paths in question, the function returns true.
如果給定的路徑字符串不是一個有效的文件系統目錄項的名字,則該函數返回 false。如果給定的路徑被成功增加到頭文件查找路徑中,則函數返回 true

add_sysinclude_path

    bool add_sysinclude_path(char const *path);

Adds the given file system path to the system include search paths. This function operates on the system include search path regardless of the mode of operation of the add_include_path(). Note though, that the given path is validated against the file system.
將給定的文件系統路徑增加到系統頭文件查找路徑中。不論 add_include_path() 處於何種操作模式,該函數均只對系統頭文件路徑進行操作。不過要注意,給定的路徑必須是文件系統有效的。

If the given path string does not form a name of a valid file system directory item, the function returns false. If the given path was successfully added to the system include search paths, the function returns true.
如果給定的路徑字符串不是一個有效的文件系統目錄項的名字,則該函數返回 false。如果給定的路徑被成功增加到頭文件查找路徑中,則函數返回 true

set_sysinclude_delimiter

    void set_sysinclude_delimiter();

Switches the mode, how the add_include_path() function operates. By default the given file system path is added to the user include search paths. After calling this function a subsequent call to the add_include_path() adds the given file system path to the system include search paths. Additionally it inhibits the the use of the current reference directory as the first search directory for #include "..." directives.
切換 add_include_path() 函數的操作模式。缺省時,給定的文件系統路徑被增加到用戶頭文件查找路徑中。而在該函數調用之後,add_include_path() 會將給定的文件系統路徑增加到系統頭文件查找路徑中。此外,它將禁止使用當前參考目錄作為 #include "..." 指令的第一個查找目錄。

get_iteration_depth

    size_t get_iteration_depth() const;

Returns the actual include iteration depth, i.e. the current number of include levels to be poped from the include iteration context, before the main (topmost) iteration context is reached.
返回實際的包含迭代深度,即從當前的頭包含迭代上下文彈出直至主迭代上下文(最頂層)的包含層級數。

Maintain defined macros 維護已定義的宏

add_macro_definition

    bool add_macro_definition(
std::string macrostring, bool is_predefined);

Adds a new macro definition to the macro symbol table. The parameter macrostring should contain the macro to define in the command line format, i.e. something like MACRO(x)=definition. The following table describes this format in more detail. The parameter is_predefined should be true while defining predefined macros, i.e. macros, which are not undefinable with an #undef directive from inside the preprocessed input stream. If this parameter is not given, it defaults to false.
向宏符號表中增加一個新的宏定義。參數 macrostring 應含有以命令行格式定義的宏,即形如 MACRO(x)=definition。下表詳細地說明了這種格式。定義預定義宏(即那些不會被預處理輸入流中的 #undef 指令去定義的宏)時,參數 is_predefined 應為true。如果該參數未給出,缺省為 false

Summary of possible formats for defining macros
對宏定義可能的格式的小結
MACRO define MACRO as 1
MACRO 定義為 1
MACRO= define MACRO as nothing (empty)
MACRO 定義為無(空)
MACRO=definition define MACRO as definition
MACRO 定義為 definition
MACRO(x) define MACRO(x) as 1
MACRO(x) 定義為 1
MACRO(x)= define MACRO(x) as nothing (empty)
MACRO(x) 定義為無(空)
MACRO(x)=definition define MACRO(x) as definition
MACRO(x) 定義為 definition

The function returns false, if the macro to define already was defined and the new definition is equivalent to the existing one, it returns true, if the new macro was successfully added to the macro symbol table.
如果要定義的宏已被定義且新的定義與已有的定義相同,則該函數返回 false,如果新的宏被成功加入宏符號表中,則返回 true。

If the given macro definition resembles a redefinition and the new macro is not identical to the already defined macro (in the sense defined by the C++ Standard), the function throws a corresponding preprocess_exception.
如果給定的宏定義為一個重定義且新的宏與已有的定義不同(按C++的標準判別),該函數將拋出一個對應的 preprocess_exception

is_defined_macro

    template <typename String>
bool is_defined_macro(String const &name) const;

Returns, if a macro with the given name is defined, i.e. if it is contained in the macro symbol table.
如果給定 name 的宏已被定義,即如果它已在宏符號表中,返回 true。

get_macro_definition

    template <typename String>
bool get_macro_definition(
String const &name, bool &is_function_style,
bool
&is_predefined, position_type &pos,
std::vector<token_type> &parameters,
token_sequence_type &definition) const;

Allows to retrieve all information known with regard to a macro definition. The parameter name specifies the name of the macro the information should be returned for. The parameters is_function_style and is_predefined return, whether the macro has been defined as a function style macro or as a predefined macro resp. The parameter pos will contain the position the macro was defined at. The parameter parameters will contain the names of the parameters the macro was defined with and the parameter definition will contain the token sequence for the definition (macro body).
允許檢索所有宏定義方面的信息。參數 name 指定要返回信息的宏的名字。參數 is_function_styleis_predefined 則分別返回該宏是否被定義為一個函數風格的宏或一個預定義的宏。參數 pos 將含有該宏的定義所在的位置。參數 parameters 將含有該宏定義的參數名,參數 definition 則含有相關定義(宏體)的單詞序列。

The function returns true is the macro was defined and the requested information has been successfully retrieved, false otherwise.
如果宏已定義且所要信息被成功取回,則該函數返回 true,否則返回 false

remove_macro_definition

    template <typename String>
bool remove_macro_definition(
String const &name, bool even_predefined);

Removes the definition of the macro with the given name from the macro symbol table. This operation is equivalent to an #undef directive with this name executed from within the input stream. If the parameter even_predefined is true, then the macro is removed from the macro symbol table even, if it is defined as a predefined macro.
從宏符號表中刪除給定 name 的宏的定義。該操作相當於從輸入流內部執行一個帶 name#undef 指令。如果參數 even_predefinedtrue,則即使該宏被定義為預定義宏,也將它從宏符號表中刪除。

Note though, that the following macros are not undefinable in any case: __FILE__, __LINE__, __DATE__, __TIME__, __cplusplus, __STDC__. If the parameter even_predefined is not given, it defaults to false.
不過請注意,以下宏在任何情況下均不可去定義:__FILE__, __LINE__, __DATE__, __TIME__, __cplusplus, __STDC__。如果參數 even_predefined 未給出,則缺省為 false

The function returns false, if the macro to undefine was not defined and returns true otherwise.
如果要去定義的宏未被定義,則該函數返回 false,否則返回 true。

If the macro to remove may not be undefined (it is a predefined macro and the parameter even_predefined is set to false or it is one of the mentioned not undefinable macros above) the function throws a preprocess_exception.
如果要刪除的宏不能被去定義(它是一個預定義宏且參數 even_predefined 被設為 false 或者它是前述不可去定義宏之一),則該函數拋出一個 preprocess_exception

reset_macro_definitions

    void reset_macro_definitions(); 

Resets the macro symbol table to it's initial state, i.e. undefines all user defined macros and inserts the internal predefined macros as described here.
將宏符號表重置為初始狀態,即去定義所有用戶定義的宏,並插入此處所述的內部預定義宏。

macro_names_begin, macro_names_end

    name_iterator macro_names_begin();
name_iterator macro_names_end();
const_name_iterator macro_names_begin() const;
const_name_iterator macro_names_end() const;

The macro_names_begin and macro_names_end functions return iterators allowing to iterate on the names of all defined macros.
函數 macro_names_beginmacro_names_end 返回可以迭代所有已定義宏的名字的迭代器。

Get Version information 獲得版本信息

get_version

    static std::string get_version(); 

Returns a string containing the current Wave version formatted as 0xvvrsbbbb (this is a string representation of the equivalent hexadecimal number), where 'vv' is the version number, 'r' the release number, 's' the subrelease number and 'bbbb' the build number. A possible return value looks like 0x00910454. The returned value is the same as is inserted in the preprocessed token stream, when the predefined macro __WAVE_VERSION__ is expanded.
返回一個包含當前Wave版本的字符串,格式為0xvvrsbbbb(這是一個表示等價的十六進制數字的字符串),其中'vv'為版本號,'r'為發佈號,'s'為子發佈號,'bbbb'為構建號。可能的返回值形如0x00910454。該返回值與對預定義宏 __WAVE_VERSION__ 進行展開時插入到預處理單詞流中的一樣。

get_version_str

    static std::string get_version_str(); 

Returns a string containing the current Wave version formatted as "v.rr.ss.bbbb", where 'v' is the version number, 'rr' the release number, 'ss' the subrelease number and 'bbbb' the build number. A possible return value looks like "0.9.1.454". The returned value is the same as it will be inserted in the preprocessed token stream, when the predefined macro __WAVE_VERSION_STR__ is expanded.
返回一個包含當前Wave版本的字符串,格式為"v.rr.ss.bbbb",其中'v'為版本號,'rr'為發佈號,'ss'為子發佈號,'bbbb'為構建號。可能的返回值形如"0.9.1.454"。該返回值與對預定義宏 __WAVE_VERSION_STR__ 進行展開時插入到預處理單詞流中的一樣。

Control extended options 控制擴展選項

set_language
get_language

    void set_language(language_support language, 
bool reset_macros = true);
language_support get_language() const;

This functions allows to specify the language mode, in which the Wave library should work. The possible language modes are defined by the enumerated type language_support:
該函數允許指定 Wave 庫工作的語言模式。可能的語言模式由枚舉類型 language_support 定義:

    enum language_support {
// support flags for C++98
support_normal = 0x01,
support_cpp = support_normal,

// support flags for C99

support_option_long_long = 0x02,
support_option_variadics = 0x04,
support_c99 = support_option_variadics | support_option_long_long | 0x08,

// the mask for the main language settings

support_option_mask = 0xFF80,

// additional fine tuning of the general behavior
support_option_insert_whitespace = 0x0080,
support_option_preserve_comments = 0x0100,
support_option_no_character_validation = 0x0200,
support_option_convert_trigraphs = 0x0400,
support_option_single_line = 0x0800,
support_option_prefer_pp_numbers = 0x1000,
support_option_emit_line_directives = 0x2000,
support_option_include_guard_detection = 0x4000,
support_option_emit_pragma_directives = 0x8000
};

When used with support_option_variadics the support for variadics, placemarkers and the operator _Pragma() is enabled in normal C++ mode. When used with the support_option_long_long the support for long long suffixes is enabled in C++ mode.
使用 support_option_variadics 時,將在正常C++模式中打開對 variadics, placemarkers 和 operator _Pragma() 的支持。使用 support_option_long_long 時,將在C++模式中打開對 long long 後綴的支持。

The support_c99 switches on the C99 language support, which enables variadics, placemarkers, the operator _Pragma and long long suffixes by default. Additionally it disables the C++ specific tokens such as '->*', '.*', '::' etc.
support_c99 打開對C99語言的支持,它缺省打開對 variadics, placemarkers, operator _Pragma 和 long long 後綴的支持。另外,它將禁止C++的專用單詞,如 '->*', '.*', '::' 等等。

The support_option_... values are to be used in conjunction with the main language settings (support_normal and support_c99) .
support_option_... 值與各種主語言設置(support_normalsupport_c99)聯接起來使用。

During this process the library will recognize two forms of include guards:
在這個處理過程中,本庫將識別兩種形式的包含防護:

 #ifndef INCLUDE_GUARD_MACRO
#define INCLUDE_GUARD_MACRO
...
#endif
or
#if !defined(INCLUDE_GUARD_MACRO)
#define INCLUDE_GUARD_MACRO
...
#endif

Note, that the parenthesis in the second form are optional (i.e. !defined INCLUDE_GUARD_MACRO will work as well). The code allows for any whitespace, newline and single '#' tokens before the #if/#ifndef and after the final #endif for the include guard to be recognized.
注意,第二種形式中的括號是可選的(即 !defined INCLUDE_GUARD_MACRO 也可以)。識別包含防護的代碼允許在 #if/#ifndef 之前和最後的 #endif 之後可以有任意的空白、換行和單個'#'單詞。

This flag is on by default, so if you do not want the library to automatically reconize include guards you will need to reset this explicitely.
該標誌缺省是打開的,因此如果你不想本庫自動識別包含防護,那麼你需要明確地重置該標誌。

If the parameter reset_macros is true the set_language function internally resets the list of defined macros, so please be careful not to call it after you have defined your own macros already.
如果參數 reset_macros 為 true,則函數 set_language 將在內部重置被定義宏的列表,所以請注意不要在你已經定義了自己的宏之後調用該函數。

set_max_include_nesting_depth
get_max_include_nesting_depth

    void set_max_include_nesting_depth(size_t new_depth); 
size_t get_max_include_nesting_depth() const;

This functions allow to set or to get the maximal possible include file nesting depth supported by the Wave library. The initial value for this is determined by the preprocessing constant WAVE_MAX_INCLUDE_LEVEL_DEPTH (see here).
這個函數允許的設置或取出 Wave 庫可支持的嵌套包含文件的最大深度。其初始值由預處理常量 WAVE_MAX_INCLUDE_LEVEL_DEPTH 決定(請見這裡)。