From cd17687f01420952712a500107e0f93e7ab8d5f8 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:34 -0500 Subject: Second Life viewer sources 1.19.1.0 --- linden/indra/llui/llviewquery.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'linden/indra/llui/llviewquery.h') diff --git a/linden/indra/llui/llviewquery.h b/linden/indra/llui/llviewquery.h index 2e2b50d..7e947cd 100644 --- a/linden/indra/llui/llviewquery.h +++ b/linden/indra/llui/llviewquery.h @@ -42,12 +42,12 @@ class LLView; typedef std::list viewList_t; typedef std::pair filterResult_t; -// Abstract base class for all filters. +// Abstract base class for all query filters. class LLQueryFilter { public: virtual ~LLQueryFilter() {}; - virtual filterResult_t operator() (const LLView* const view, const viewList_t & children) const =0; + virtual filterResult_t operator() (const LLView* const view, const viewList_t & children) const = 0; }; class LLQuerySorter @@ -105,25 +105,28 @@ public: typedef filterList_t::iterator filterList_iter_t; typedef filterList_t::const_iterator filterList_const_iter_t; - LLViewQuery(); + LLViewQuery() : mPreFilters(), mPostFilters(), mSorterp() {} virtual ~LLViewQuery() {} - void addPreFilter(const LLQueryFilter* prefilter); - void addPostFilter(const LLQueryFilter* postfilter); - const filterList_t & getPreFilters() const; - const filterList_t & getPostFilters() const; + void addPreFilter(const LLQueryFilter* prefilter) { mPreFilters.push_back(prefilter); } + void addPostFilter(const LLQueryFilter* postfilter) { mPostFilters.push_back(postfilter); } + const filterList_t & getPreFilters() const { return mPreFilters; } + const filterList_t & getPostFilters() const { return mPostFilters; } - void setSorter(const LLQuerySorter* sorter); - const LLQuerySorter* getSorter() const; + void setSorter(const LLQuerySorter* sorter) { mSorterp = sorter; } + const LLQuerySorter* getSorter() const { return mSorterp; } viewList_t run(LLView * view) const; // syntactic sugar viewList_t operator () (LLView * view) const { return run(view); } -protected: + // override this method to provide iteration over other types of children virtual void filterChildren(LLView * view, viewList_t & filtered_children) const; + +private: + filterResult_t runFilters(LLView * view, const viewList_t children, const filterList_t filters) const; -protected: + filterList_t mPreFilters; filterList_t mPostFilters; const LLQuerySorter* mSorterp; @@ -135,4 +138,4 @@ public: LLCtrlQuery(); }; -#endif +#endif // LL_LLVIEWQUERY_H -- cgit v1.1