CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
icollection.h
1
2#ifndef _aspose_system_collections_icollection_h_
3#define _aspose_system_collections_icollection_h_
4
5#include <system/collections/ienumerable.h>
6#include <system/details/pointer_collection_helpers.h>
7
8
9namespace System {
10namespace Collections {
11namespace Generic {
12
18template<typename T>
19class ASPOSECPP_SHARED_CLASS ICollection : public virtual System::Collections::Generic::IEnumerable<T>
20{
23
24public:
26 typedef T ValueType;
29
32 virtual int get_Count() const = 0;
35 virtual void Add(const T& item) = 0;
37 virtual void Clear() = 0;
41 virtual bool Contains(const T& item) const = 0;
45 virtual bool Remove(const T& item) = 0;
48 virtual bool get_IsReadOnly() const { return false; }
49
53 virtual void CopyTo(System::ArrayPtr<T> array, int arrayIndex) = 0;
54
55 // Explicit definitions to avoid GCC warnings.
58 ICollection& operator = (ICollection&&) noexcept { return *this; }
61 ICollection& operator = (const ICollection&) { return *this; }
67 ICollection(ICollection&&) noexcept {}
69 virtual ~ICollection() {}
70
72 SharedPtr<Object> get_SyncRoot() const { return const_cast<ThisType*>(this); }
73};
74
75} // namespace Generic
76} // namespace Collections
77} // namespace System
78
79#endif // _aspose_system_collections_icollection_h_
Interface of collection of elements. Objects of this class should only be allocated using System::Mak...
Definition: icollection.h:20
virtual bool Contains(const T &item) const =0
Checks if element is present in collection.
virtual void Add(const T &item)=0
Adds element into collection.
virtual void CopyTo(System::ArrayPtr< T > array, int arrayIndex)=0
Copies all collection elements to existing array elements.
virtual ~ICollection()
Destructor.
Definition: icollection.h:69
virtual void Clear()=0
Deletes all elements from collection.
virtual bool Remove(const T &item)=0
Deletes element from collection.
ICollection(ICollection &&) noexcept
Move constructor.
Definition: icollection.h:67
virtual bool get_IsReadOnly() const
Checks if collection is read only.
Definition: icollection.h:48
ICollection()
Default constructor.
Definition: icollection.h:63
SharedPtr< Object > get_SyncRoot() const
Gets the object the collection is being synchronized through.
Definition: icollection.h:72
ICollection(const ICollection &)
Copy constructor.
Definition: icollection.h:65
T ValueType
Value type name.
Definition: icollection.h:26
virtual int get_Count() const =0
Gets number of elements in collection.
ICollection< T > ThisType
Collection type name.
Definition: icollection.h:28
Interface of object providing enumerator on contained elements.
Definition: ienumerable.h:25
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