00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __XVR2_VECTOR_H__
00015 #define __XVR2_VECTOR_H__
00016 #include<xvr2/Mutex.h>
00017 #include<xvr2/String.h>
00018 #include<vector>
00019
00020 namespace xvr2 {
00021
00029 template<typename _Tp, typename _Alloc=std::allocator<_Tp> >
00030 class Vector : public xvr2::Object, public std::vector<_Tp, _Alloc> {
00031 protected:
00032 Mutex mv;
00033 public:
00035 template<typename _InputIterator>
00036 Vector (_InputIterator __first,
00037 _InputIterator __last,
00038 const _Alloc &__a = _Alloc()
00039 ) : std::vector<_InputIterator>(__first, __last, __a){ }
00041 Vector (const Vector &__x) : std::vector<_Tp, _Alloc>(__x){ }
00043 Vector (size_t __n, const _Tp &__value = _Tp(),
00044 const _Alloc &__a = _Alloc()
00045 ) :
00046 std::vector<_Tp, _Alloc>(__n, __value, __a){ }
00048 Vector (const _Alloc &__a = _Alloc()) :
00049 std::vector<_Tp, _Alloc>(__a){ }
00050
00052 std::string toString(){
00053 std::string ret;
00054 ret = "{ ";
00055
00056
00057
00058
00059
00060
00061
00062
00063 ret.append(" }");
00064 return std::string(ret);
00065 }
00073 void lock(){
00074 mv.lock();
00075 }
00079 void unlock(){
00080 mv.unlock();
00081 }
00082 };
00083
00084 }
00085
00086 #endif