Commit c6d7906f authored by Frédéric Larue's avatar Frédéric Larue
Browse files

UIToolDataSet modified so as to recover the total item count.

parent bc012232
......@@ -99,12 +99,13 @@ public:
inline iterator end() { return iterator(items.back().end()); }
};
inline unsigned int Count() const;
inline GenericIterable GetAll();
template <typename T> inline Iterable<T> Get( int id );
template <typename T> inline Iterable<T> Get();
template <typename T> inline unsigned int Count() const;
template <typename T> inline unsigned int CountOf() const;
template <typename T> inline bool HasSomeOf() const;
template <typename T> inline bool HasNoneOf() const;
......@@ -129,6 +130,14 @@ inline int UIToolDataSet::ListId() const
return -1;
}
inline unsigned int UIToolDataSet::Count() const
{
unsigned int count = 0;
for( int i=0; i<items.size(); ++i )
count += items[i].size();
return count;
}
inline UIToolDataSet::GenericIterable UIToolDataSet::GetAll()
{
return GenericIterable( items );
......@@ -148,7 +157,7 @@ inline UIToolDataSet::Iterable<T> UIToolDataSet::Get()
}
template <typename T>
inline unsigned int UIToolDataSet::Count() const
inline unsigned int UIToolDataSet::CountOf() const
{
int id = ListId<T>();
return (id >= 0)? items[id].size() : 0;
......@@ -157,19 +166,19 @@ inline unsigned int UIToolDataSet::Count() const
template <typename T>
inline bool UIToolDataSet::HasSomeOf() const
{
return Count<T>() > 0;
return CountOf<T>() > 0;
}
template <typename T>
inline bool UIToolDataSet::HasNoneOf() const
{
return Count<T>() == 0;
return CountOf<T>() == 0;
}
template <typename T>
inline bool UIToolDataSet::HasOneOf() const
{
return Count<T>() == 1;
return CountOf<T>() == 1;
}
template <typename T>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment