YSTest: YSLib::Components::GSequenceViewer< _tContainer > Class Template Reference

YSTest PreAlpha_b380_20130211 The YSLib Test Project

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
YSLib::Components::GSequenceViewer< _tContainer > Class Template Reference

序列视图类模板。 More...

`#include <viewer.hpp>`

## Public Types

typedef _tContainer | ContainerType
| 容器类型。
typedef _tContainer::size_type | SizeType
| 项目下标类型。
typedef _tContainer::difference_type | DifferenceType
| 项目索引差值类型。

## Public Member Functions

| GSequenceViewer (ContainerType &con)
| 构造：使用指定容器。
GSequenceViewer & | operator++ ()
GSequenceViewer & | operator-- ()
GSequenceViewer & | operator++ (int)
GSequenceViewer & | operator-- (int)
bool | IsSelected () const ynothrow
| 判断是否为选中状态。
bool | Contains (SizeType i) const
| 判断是否在有效范围内包含指定项目索引。
SizeType | GetTotal () const ynothrow
| 取容器中项目个数。
SizeType | GetLength () const ynothrow
SizeType | GetHeadIndex () const ynothrow
SizeType | GetSelectedIndex () const ynothrow
DifferenceType | GetOffset () const ynothrow
| 取选中的项目相对于视图中首个项目的下标偏移（未选中时为 -1 ）。
SizeType | GetValid () const ynothrow
| 取当前视图中有效项目个数。
void | SetContainer (ContainerType &con)
| 设置容器。
bool | SetHeadIndex (SizeType t)
| 设置项目索引。
bool | SetLength (SizeType l)
| 设置长度。
bool | SetSelectedIndex (SizeType t)
| 设置选中项目下标。
void | ClearSelected ()
| 取消选中状态。
GSequenceViewer & | DecreaseHead (DifferenceType d)
GSequenceViewer & | DecreaseSelected (DifferenceType d)
GSequenceViewer & | IncreaseHead (DifferenceType d)
| 视图中首个项目下标增加 d 。
GSequenceViewer & | IncreaseSelected (DifferenceType d)
| 选中项目下标增加 d 。
bool | MoveViewerToBegin ()
| 移动视图至序列起始。
bool | MoveViewerToEnd ()
| 移动视图至序列结尾。
void | Reset ()
| 复位视图。
bool | RestrictSelected ()
| 约束被选中的元素在视图内。
bool | RestrictView ()
| 约束视图包含被选中的元素。

## Private Attributes

_tContainer * | pContainer
| 序列容器指针。
SizeType | head
| 视图中首个项目下标，大于等于 GetTotal() 时无效。
SizeType | selected
| 选中项目下标，大于等于 GetTotal() 时无效。
SizeType | length
| 视图长度：最大可视项目数。
bool | is_selected
| 选中状态。

## Detailed Description

### template<class _tContainer>
class YSLib::Components::GSequenceViewer< _tContainer >

序列视图类模板。

Since
  build 147

Definition at line 43 of file viewer.hpp.

## Member Typedef Documentation

template<class _tContainer>

typedef _tContainer YSLib::Components::GSequenceViewer< _tContainer >::ContainerType

容器类型。

Since
  build 292

Definition at line 50 of file viewer.hpp.

template<class _tContainer>

typedef _tContainer::difference_type YSLib::Components::GSequenceViewer< _tContainer >::DifferenceType

项目索引差值类型。

Definition at line 53 of file viewer.hpp.

template<class _tContainer>

typedef _tContainer::size_type YSLib::Components::GSequenceViewer< _tContainer >::SizeType

项目下标类型。

Definition at line 51 of file viewer.hpp.

## Constructor & Destructor Documentation

template<class _tContainer>

YSLib::Components::GSequenceViewer< _tContainer >::GSequenceViewer | ( | ContainerType & | con | ) |

inlineexplicit

构造：使用指定容器。

Definition at line 72 of file viewer.hpp.

## Member Function Documentation

template<class _tContainer>

void YSLib::Components::GSequenceViewer< _tContainer >::ClearSelected | ( |  | ) |

inline

取消选中状态。

Definition at line 175 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::Contains | ( | SizeType | i | ) | const

inline

判断是否在有效范围内包含指定项目索引。

Definition at line 96 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::DecreaseHead | ( | DifferenceType | d | ) |

inline

Parameters

  d | 视图中首个项目下标减少 d 。

Definition at line 180 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::DecreaseSelected | ( | DifferenceType | d | ) |

inline

Parameters

  d | 选中项目下标减少 d 。

Definition at line 184 of file viewer.hpp.

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::GetHeadIndex | ( |  | ) | const

inline

Definition at line 105 of file viewer.hpp.

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::GetLength | ( |  | ) | const

inline

Definition at line 104 of file viewer.hpp.

template<class _tContainer>

DifferenceType YSLib::Components::GSequenceViewer< _tContainer >::GetOffset | ( |  | ) | const

inline

取选中的项目相对于视图中首个项目的下标偏移（未选中时为 -1 ）。

Definition at line 108 of file viewer.hpp.

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::GetSelectedIndex | ( |  | ) | const

inline

Definition at line 106 of file viewer.hpp.

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::GetTotal | ( |  | ) | const

inline

取容器中项目个数。

Definition at line 102 of file viewer.hpp.

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::GetValid | ( |  | ) | const

inline

取当前视图中有效项目个数。

Definition at line 111 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::IncreaseHead | ( | DifferenceType | d | ) |

inline

视图中首个项目下标增加 d 。

Definition at line 192 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::IncreaseSelected | ( | DifferenceType | d | ) |

inline

选中项目下标增加 d 。

Definition at line 205 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::IsSelected | ( |  | ) | const

inline

判断是否为选中状态。

Definition at line 90 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::MoveViewerToBegin | ( |  | ) |

inline

移动视图至序列起始。

Definition at line 218 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::MoveViewerToEnd | ( |  | ) |

inline

移动视图至序列结尾。

Definition at line 232 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::operator++ | ( |  | ) |

inline

Definition at line 76 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::operator++ | ( | int |  | ) |

inline

Definition at line 80 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::operator-- | ( |  | ) |

inline

Definition at line 78 of file viewer.hpp.

template<class _tContainer>

GSequenceViewer& YSLib::Components::GSequenceViewer< _tContainer >::operator-- | ( | int |  | ) |

inline

Definition at line 83 of file viewer.hpp.

template<class _tContainer>

void YSLib::Components::GSequenceViewer< _tContainer >::Reset | ( |  | ) |

inline

复位视图。

Since
  build 298

Definition at line 247 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::RestrictSelected | ( |  | ) |

inline

约束被选中的元素在视图内。

Definition at line 256 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::RestrictView | ( |  | ) |

inline

约束视图包含被选中的元素。

Definition at line 273 of file viewer.hpp.

template<class _tContainer>

void YSLib::Components::GSequenceViewer< _tContainer >::SetContainer | ( | ContainerType & | con | ) |

inline

设置容器。

Note
  若容器和之前不同则重置视图。

Since
  build 292

Definition at line 119 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::SetHeadIndex | ( | SizeType | t | ) |

inline

设置项目索引。

Definition at line 128 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::SetLength | ( | SizeType | l | ) |

inline

设置长度。

Definition at line 146 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::SetSelectedIndex | ( | SizeType | t | ) |

inline

设置选中项目下标。

Definition at line 159 of file viewer.hpp.

## Member Data Documentation

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::head

private

视图中首个项目下标，大于等于 GetTotal() 时无效。

Definition at line 62 of file viewer.hpp.

template<class _tContainer>

bool YSLib::Components::GSequenceViewer< _tContainer >::is_selected

private

选中状态。

Definition at line 65 of file viewer.hpp.

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::length

private

视图长度：最大可视项目数。

Definition at line 64 of file viewer.hpp.

template<class _tContainer>

_tContainer* YSLib::Components::GSequenceViewer< _tContainer >::pContainer

private

序列容器指针。

Note
  非空。

Since
  build 292

Definition at line 61 of file viewer.hpp.

template<class _tContainer>

SizeType YSLib::Components::GSequenceViewer< _tContainer >::selected

private

选中项目下标，大于等于 GetTotal() 时无效。

Definition at line 63 of file viewer.hpp.

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

- viewer.hpp