Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
console::gen::Debug< Gen > Class Template Reference

调试生成器,打印每个元素的值。 More...

#include <gextra.h>

Inheritance diagram for console::gen::Debug< Gen >:
console::Generator< Debug< Gen >, Gen::value_type >

Public Member Functions

 Debug (Gen g, std::string msg="Current Value: ", std::ostream &os=std::cout)
 构造函数。
bool done ()
 检查生成器是否已完成。
Gen::value_type current ()
 获取当前值并打印调试信息。
void advance ()
 向前移动一步。
Public Member Functions inherited from console::Generator< Debug< Gen >, Gen::value_type >
iterator iter () const
 获取生成器的迭代器对象。
iterator begin () const
 获取开始迭代器。
iterator end () const
 获取结束迭代器。
bool done ()
 检查生成器是否已完成。
Gen::value_type current ()
 获取当前值。
void advance ()
 推进生成器到下一个位置。

Private Attributes

Gen gen
std::string message
std::ostream & out

Additional Inherited Members

Public Types inherited from console::Generator< Debug< Gen >, Gen::value_type >
typedef Gen::value_type value_type
 生成器产生的值类型。

Detailed Description

template<class Gen>
class console::gen::Debug< Gen >

调试生成器,打印每个元素的值。

Template Parameters
Gen源生成器类型。

Constructor & Destructor Documentation

◆ Debug()

template<class Gen>
console::gen::Debug< Gen >::Debug ( Gen g,
std::string msg = "Current Value: ",
std::ostream & os = std::cout )
inlineexplicit

构造函数。

Parameters
g源生成器。
msg调试消息前缀,默认为"Current Value: "。
os输出流,默认为std::cout。

Member Function Documentation

◆ advance()

template<class Gen>
void console::gen::Debug< Gen >::advance ( )
inline

向前移动一步。

◆ current()

template<class Gen>
Gen::value_type console::gen::Debug< Gen >::current ( )
inline

获取当前值并打印调试信息。

Returns
当前值。

◆ done()

template<class Gen>
bool console::gen::Debug< Gen >::done ( )
inline

检查生成器是否已完成。

Returns
如果源生成器已完成则返回true。

Member Data Documentation

◆ gen

template<class Gen>
Gen console::gen::Debug< Gen >::gen
private

◆ message

template<class Gen>
std::string console::gen::Debug< Gen >::message
private

◆ out

template<class Gen>
std::ostream& console::gen::Debug< Gen >::out
private

The documentation for this class was generated from the following file: