| 68 | class TPointerType = Kratos::shared_ptr<TDataType>, |
| 69 | class TContainerType = std::vector<std::pair<TKeyType, TPointerType> > > |
| 70 | class PointerVectorMap final |
| 71 | { |
| 72 | public: |
| 73 | ///@name Type Definitions |
| 74 | ///@{ |
| 75 | |
| 76 | /// Pointer definition of PointerVectorMap |
| 77 | KRATOS_CLASS_POINTER_DEFINITION(PointerVectorMap); |
| 78 | |
| 79 | /// Key type for searching in this container. |
| 80 | typedef TKeyType key_type; |
| 81 | |
| 82 | /// data type stores in this container. |
| 83 | typedef TDataType data_type; |
| 84 | typedef std::pair<TKeyType, TPointerType> value_type; |
| 85 | typedef TCompareType key_compare; |
| 86 | typedef TPointerType pointer; |
| 87 | typedef TDataType& reference; |
| 88 | typedef const TDataType& const_reference; |
| 89 | typedef TContainerType ContainerType; |
| 90 | |
| 91 | typedef PointerVectorMapIterator<typename TContainerType::iterator, TDataType> iterator; |
| 92 | typedef PointerVectorMapIterator<typename TContainerType::const_iterator, TDataType> const_iterator; |
| 93 | typedef PointerVectorMapIterator<typename TContainerType::reverse_iterator, TDataType> reverse_iterator; |
| 94 | typedef PointerVectorMapIterator<typename TContainerType::const_reverse_iterator, TDataType> const_reverse_iterator; |
| 95 | |
| 96 | typedef typename TContainerType::size_type size_type; |
| 97 | typedef typename TContainerType::iterator pair_iterator; |
| 98 | typedef typename TContainerType::const_iterator pair_const_iterator; |
| 99 | typedef typename TContainerType::reverse_iterator pair_reverse_iterator; |
| 100 | typedef typename TContainerType::const_reverse_iterator pair_const_reverse_iterator; |
| 101 | |
| 102 | ///@} |
| 103 | ///@name Life Cycle |
| 104 | ///@{ |
| 105 | |
| 106 | /// Default constructor. |
| 107 | PointerVectorMap() : mData(), mSortedPartSize(size_type()), mMaxBufferSize(100) {} |
| 108 | |
| 109 | PointerVectorMap(const PointerVectorMap& rOther) : mData(rOther.mData), mSortedPartSize(rOther.mSortedPartSize), mMaxBufferSize(rOther.mMaxBufferSize) {} |
| 110 | |
| 111 | explicit PointerVectorMap(const TContainerType& rContainer) : mData(rContainer), mSortedPartSize(size_type()), mMaxBufferSize(100) |
| 112 | { |
| 113 | Sort(); |
| 114 | std::unique(mData.begin(), mData.end(), EqualKeyTo()); |
| 115 | } |
| 116 | |
| 117 | /// Destructor. |
| 118 | ~PointerVectorMap() {} |
| 119 | |
| 120 | |
| 121 | ///@} |
| 122 | ///@name Operators |
| 123 | ///@{ |
| 124 | |
| 125 | PointerVectorMap& operator=(const PointerVectorMap& rOther) |
| 126 | { |
| 127 | mData = rOther.mData; |
nothing calls this directly
no test coverage detected