mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
moving sort()/order() functionality into VectorVal
This commit is contained in:
parent
0299ea0894
commit
13e7ba3a00
3 changed files with 194 additions and 126 deletions
12
src/Val.h
12
src/Val.h
|
@ -1354,10 +1354,18 @@ public:
|
|||
bool Remove(unsigned int index);
|
||||
|
||||
/**
|
||||
* Sorts the vector in place, using the given comparison function.
|
||||
* Sorts the vector in place, using the given optional
|
||||
* comparison function.
|
||||
* @param cmp_func Comparison function for vector elements.
|
||||
*/
|
||||
void Sort(bool cmp_func(const ValPtr& a, const ValPtr& b));
|
||||
void Sort(Func* cmp_func = nullptr);
|
||||
|
||||
/**
|
||||
* Returns a "vector of count" holding the indices of this
|
||||
* vector when sorted using the given (optional) comparison function.
|
||||
* @param cmp_func Comparison function for vector elements.
|
||||
*/
|
||||
VectorValPtr Order(Func* cmp_func = nullptr);
|
||||
|
||||
protected:
|
||||
void ValDescribe(ODesc* d) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue