CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
iordered_enumerable.h
1
2#pragma once
3
4#include <iterator>
5#include <memory>
6
7#include <system/collections/ienumerable.h>
8
9namespace System { namespace Linq {
10
13template<typename T>
14class ASPOSECPP_SHARED_CLASS IOrderedEnumerable : public System::Collections::Generic::IEnumerable<T>
15{
17 RTTI_INFO_TEMPLATE_CLASS(IOrderedEnumerable, System::BaseTypesInfo<System::Collections::Generic::IEnumerable<T>>);
18
19public:
20 using Comparator = std::function<bool(const T&, const T&)>;
21
23 : m_root(root), m_comparator(comp)
24 {
25 }
26
28 {
29 return m_root->GetEnumerator();
30 }
31
36 template <typename Key>
38
39protected:
42};
43
44}} // namespace System::Linq
Interface of object providing enumerator on contained elements.
Definition: ienumerable.h:25
Function delegate. This type should be allocated on stack and passed to functions by value or by refe...
Definition: func.h:82
Represents a sorted sequence.
Definition: iordered_enumerable.h:15
IOrderedEnumerable(const System::SharedPtr< System::Collections::Generic::IEnumerable< T > > &root, const Comparator &comp)
Definition: iordered_enumerable.h:22
std::function< bool(const T &, const T &)> Comparator
Definition: iordered_enumerable.h:20
System::SharedPtr< System::Collections::Generic::IEnumerable< T > > m_root
Definition: iordered_enumerable.h:40
SharedPtr< IOrderedEnumerable< T > > LINQ_ThenBy(const Func< T, Key > &keySelector)
Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.
virtual SharedPtr< System::Collections::Generic::IEnumerator< T > > GetEnumerator() override
Gets enumerator.
Definition: iordered_enumerable.h:27
Comparator m_comparator
Definition: iordered_enumerable.h:41
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: db_command.h:9