-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpstldll.h
183 lines (158 loc) · 5.39 KB
/
cpstldll.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*
* Copyright(C) 2004 Ïðîåêò ÈÎÊ
*
* Ýòîò ôàéë ñîäåðæèò èíôîðìàöèþ, ÿâëÿþùóþñÿ
* ñîáñòâåííîñòüþ êîìïàíèè Êðèïòî Ïðî.
*
* Ëþáàÿ ÷àñòü ýòîãî ôàéëà íå ìîæåò áûòü ñêîïèðîâàíà,
* èñïðàâëåíà, ïåðåâåäåíà íà äðóãèå ÿçûêè,
* ëîêàëèçîâàíà èëè ìîäèôèöèðîâàíà ëþáûì ñïîñîáîì,
* îòêîìïèëèðîâàíà, ïåðåäàíà ïî ñåòè ñ èëè íà
* ëþáóþ êîìïüþòåðíóþ ñèñòåìó áåç ïðåäâàðèòåëüíîãî
* çàêëþ÷åíèÿ ñîãëàøåíèÿ ñ êîìïàíèåé Êðèïòî Ïðî.
*/
/*!
* \file $RCSfile$
* \version $Revision$
* \date $Date:: $
* \author $Author$
*
* \brief Îáåðòêè äëÿ stl êëàññîâ, ïîçâîëÿþùèå èõ ýêñïîðòèðîâàòü â dll.
*/
#ifndef _CPSTLDLL_H_INCLUDED
#define _CPSTLDLL_H_INCLUDED
#include <list>
#if defined UNIX
# define CDllList std::list
# define EXPIMP_CDLLLIST_ITERATORS(...)
#else // !defined UNIX
#ifdef NO_EXPIMP_CDLLLIST_ITERATORS
# define EXPIMP_CDLLLIST_ITERATORS(...)
#else
# define EXPIMP_CDLLLIST_ITERATORS(Type, Extern, Declspec) \
__pragma(warning(push)); \
__pragma(warning(disable: 4231)); \
Extern template class Declspec CDllList<Type>::_Const_iterator; \
Extern template class Declspec CDllList<Type>::_Iterator; \
__pragma(warning(pop));
#endif
namespace CryptoPro {
/**
* \class CDllList cpstldll.h <cpstldll.h>
* \brief Êëàññ ñïèñêà àíàëîãè÷íûé ïî èíòåðôåéñó êëàññó std::list èç áèáëèîòåêè
* ñòàíäàðòíûõ øàáëîíîâ.
*/
template<class _Ty>
class CDllList
{
typedef typename std::list<_Ty> stlContainer;
typedef CDllList<_Ty> _Myt;
typedef typename stlContainer::pointer _Tptr;
typedef typename stlContainer::reference _Reft;
#ifdef _STL70_
typedef typename stlContainer::iterator cont_const_iterator;
#else
typedef typename stlContainer::const_iterator cont_const_iterator;
#endif
typedef typename stlContainer::iterator cont_iterator;
public:
typedef typename stlContainer::allocator_type allocator_type;
typedef typename stlContainer::size_type size_type;
typedef typename stlContainer::difference_type difference_type;
typedef typename stlContainer::pointer pointer;
typedef typename stlContainer::const_pointer const_pointer;
typedef typename stlContainer::reference reference;
typedef typename stlContainer::const_reference const_reference;
typedef typename stlContainer::value_type value_type;
typedef typename stlContainer::const_reverse_iterator const_reverse_iterator;
typedef typename stlContainer::reverse_iterator reverse_iterator;
class _Const_iterator
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER < 1600) && !defined ( _STL70_ )
// ×òîáû VS2008 ñ÷èòàëà èòåðàòîð çà checked
: public std::_Iterator_base_universal
#endif // defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER < 1700)
{
friend CDllList;
cont_const_iterator *pImpl_;
_Const_iterator(const cont_const_iterator it);
public:
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER < 1600)
typedef std::_Range_checked_iterator_tag _Checked_iterator_category;
#endif //defined(_MSC_VER) && (_MSC_VER >= 1500) && (_MSC_VER < 1700)
typedef std::bidirectional_iterator_tag iterator_category;
typedef _Ty value_type;
typedef typename stlContainer::difference_type difference_type;
typedef typename stlContainer::const_pointer pointer;
typedef typename stlContainer::const_reference reference;
_Const_iterator();
~_Const_iterator();
_Const_iterator(const _Const_iterator& _Right);
_Const_iterator& operator=(const _Const_iterator& _Right);
const_reference operator*() const;
const_pointer operator->() const;
_Const_iterator& operator++();
_Const_iterator operator++(int);
_Const_iterator& operator--();
_Const_iterator operator--(int);
bool operator==(const _Const_iterator& _Right) const;
bool operator!=(const _Const_iterator& _Right) const;
};
class _Iterator : public _Const_iterator
{
friend CDllList;
_Iterator(const cont_iterator it);
public:
_Iterator();
_Reft operator*() const;
_Tptr operator->() const;
_Iterator& operator++();
_Iterator operator++(int);
_Iterator& operator--();
_Iterator operator--(int);
};
typedef _Const_iterator const_iterator;
typedef _Iterator iterator;
CDllList();
CDllList( const _Myt& _Right);
~CDllList();
const_iterator begin() const;
const_iterator end() const;
iterator begin();
iterator end();
const_reverse_iterator rbegin() const;
const_reverse_iterator rend() const;
reverse_iterator rbegin();
reverse_iterator rend();
_Myt& operator=(const _Myt& _Right);
void resize(size_type _Newsize);
void resize(size_type _Newsize, _Ty _Val);
size_type size() const;
size_type max_size() const;
bool empty() const;
reference front();
const_reference front() const;
reference back();
const_reference back() const;
void push_front(const _Ty& _Val);
void push_back(const _Ty& _Val);
void pop_front();
void pop_back();
void assign(size_type _Count, const _Ty& _Val);
iterator insert(iterator _Where, const _Ty& _Val);
void insert(iterator _Where, iterator _First, iterator _Last);
void insert(iterator _Where, size_type _Count, const _Ty& _Val);
iterator erase(iterator _Where);
iterator erase(iterator _First, iterator _Last);
void clear();
void swap(_Myt& _Right);
// void sort();
// void reverse();
protected:
void* impl();
const void* impl() const;
private:
void* pImpl_;
};
} // namespace CryptoPro
#endif // !defined UNIX
#endif // _CPSTLDLL_H_INCLUDED