23.06.2014 - PICodeParser, PICodeInfo, PIConnection, new binary "pip_cmg"
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#ifndef PICONTAINERS_H
|
||||
#define PICONTAINERS_H
|
||||
|
||||
#include "pivector.h"
|
||||
#include "piincludes.h"
|
||||
|
||||
template<typename Type0, typename Type1>
|
||||
class PIP_EXPORT PIPair {
|
||||
@@ -47,8 +47,10 @@ inline std::ostream & operator <<(std::ostream & s, const PIPair<Type0, Type1> &
|
||||
template<typename Type0, typename Type1>
|
||||
inline PICout operator <<(PICout s, const PIPair<Type0, Type1> & v) {s.space(); s.setControl(0, true); s << "(" << v.first << ", " << v.second << ")"; s.restoreControl(); return s;}
|
||||
|
||||
#include "pivector.h"
|
||||
#include "pistack.h"
|
||||
#include "piqueue.h"
|
||||
#include "pideque.h"
|
||||
#include "pimap.h"
|
||||
|
||||
#ifdef DOXYGEN
|
||||
@@ -295,25 +297,28 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#ifndef PIP_CONTAINERS_STL
|
||||
|
||||
template<typename Type, typename Allocator = std::allocator<Type> >
|
||||
class PIP_EXPORT PIDeque: public deque<Type, Allocator> {
|
||||
typedef PIDeque<Type, Allocator> _CDeque;
|
||||
typedef deque<Type, Allocator> _stlc;
|
||||
public:
|
||||
PIDeque() {piMonitor.containers++;}
|
||||
PIDeque(const Type & value) {piMonitor.containers++; _stlc::resize(1, value);}
|
||||
PIDeque(const Type & v0, const Type & v1) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1);}
|
||||
PIDeque(const Type & v0, const Type & v1, const Type & v2) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1); _stlc::push_back(v2);}
|
||||
PIDeque(const Type & v0, const Type & v1, const Type & v2, const Type & v3) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1); _stlc::push_back(v2); _stlc::push_back(v3);}
|
||||
~PIDeque() {piMonitor.containers--;}
|
||||
int size_s() const {return static_cast<int>(_stlc::size());}
|
||||
bool isEmpty() const {return _stlc::empty();}
|
||||
bool has(const Type & t) const {for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) if (t == *i) return true; return false;}
|
||||
int etries(const Type & t) const {int ec = 0; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) if (t == *i) ++ec; return ec;}
|
||||
_CDeque & operator <<(const Type & t) {_CDeque::push_back(t); return *this;}
|
||||
PIVector<Type> toVector() {PIVector<Type> v; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) v << *i; return v;}
|
||||
};
|
||||
# define __PICONTAINERS_SIMPLE_TYPE__(T) \
|
||||
__PIDEQUE_SIMPLE_TYPE__(T)\
|
||||
__PIVECTOR_SIMPLE_TYPE__(T)
|
||||
|
||||
__PICONTAINERS_SIMPLE_TYPE__(bool)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(char)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(uchar)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(short)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(ushort)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(int)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(uint)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(long)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(ulong)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(llong)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(ullong)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(float)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(double)
|
||||
__PICONTAINERS_SIMPLE_TYPE__(ldouble)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // PICONTAINERS_H
|
||||
|
||||
Reference in New Issue
Block a user