バナーをクリックすれば目次に戻ります
Copyright 1999 Rogue Wave Software
Copyright 1999 Sun Microsystems, Inc.
RWTPtrOrderedVector<T>
#include <rw/tpordvec.h> RWTPtrOrderedVector<T> ordvec;
注 - 標準 C++ ライブラリがある場合は、ここで述べるインタフェースを使用します。標準 C++ ライブラリがない場合は、付録 A に記載する RWTPtrOrderedVector 用に限定されたインタフェースを使用してください。
// // tporddat.cpp // #include <rw/tpordvec.h> #include <rw/rwdate.h> #include <iostream.h> main(){ RWTPtrOrderedVector<RWDate> week(7); RWDate begin; // 今日の日付 for (int i=0; i<7; i++) week.insert(new RWDate(begin++)); for (i=0; i<7; i++) cout << *week[i] << endl; return 0; } |
05/31/95 06/01/95 06/02/95 06/03/95 06/04/95 06/05/95 06/06/95 |
クラス vector<T*,allocator> は、このクラスの基礎となる実装として使用される C++ 標準コレクションです。
typedef vector<T*,allocator> container_type; typedef container_type::iterator iterator; typedef container_type::const_iterator const_iterator; typedef container_type::size_type size_type; typedef container_type::difference_type difference_type; typedef T* value_type; typedef T*& reference; typedef T* const& const_reference;
RWTPtrOrderedVector<T>();
RWTPtrOrderedVector<T>(const RWTPtrOrderedVector<T>& rwvec);
RWTPtrOrderedVector<T>(const vector<T*,allocator>& vec);
RWTPtrOrderedVector<T>(size_type n, T* a);
RWTPtrOrderedVector<T>(T* const* first,T* const* last);
RWTPtrOrderedVector<T>& operator=(const RWTPtrOrderedVector<T>& vec); RWTPtrOrderedVector<T>& operator=(const vector<T*,allocator>& vec);
bool operator<(const RWTPtrOrderedVector<T>& vec) const;
bool operator==(const RWTPtrOrderedVector<T>& vec) const;
reference operator()(size_type i); const_reference operator()(size_type i) const;
reference operator[](size_type i); const_reference operator[](size_type i) const;
void append(T* a);
void apply(void (*fn)(T*&,void*), void* d); void apply(void (*fn)(T*,void*), void* d); void apply(void (*fn)(const T*,void*), void*d) const;
void yourfun(reference a, void* d); void yourfun(T* a, void* d); void yourfun(const T* a, void* d);
reference at(size_type i); const_reference at(size_type i) const;
iterator begin(); const_iterator begin() const;
void clear();
void clearAndDestroy();
bool contains(const T* a) const;
bool contains(bool (*fn)(T*,void*), void* d) const; bool contains(bool (*fn)(const T*,void*), void* d) const;
bool yourTester(T* a, void* d); bool yourTester(const T* a, void* d);
T*const* data() const;
iterator end(); const_iterator end() const;
size_type entries();
T* find(const T* a) const;
T* find(bool (*fn)(T*,void*), void* d) const; T* find(bool (*fn)(const T*,void*), void* d) const;
bool yourTester(T* a, void* d); bool yourTester(const T* a, void* d);
reference first(); const_reference first() const;
size_type index(const T* a) const;
size_type index(bool (*fn)(T*,void*), void* d) const; size_type index(bool (*fn)(const T*,void*), void* d) const;
bool yourTester(T* a, void* d); bool yourTester(const T* a, void* d);
bool insert(T* a);
void insertAt(size_type i, T* a);
bool isEmpty() const;
T*& last(); T*const& last() const;
size_type length() const;
reference maxElement(); const_reference maxElement() const; reference minElement(); const_reference minElement() const;
size_type occurrencesOf(const T* a) const;
size_type occurrencesOf(bool (*fn)(T*,void*),void* d) const; size_type occurrencesOf(bool (*fn)(const T*,void*),void* d) const;
bool yourTester(T* a, void* d); bool yourTester(const T* a, void* d);
void prepend(T* a);
T* remove(const T* a);
T* remove(bool (*fn)( T*,void*), void* d); T* remove(bool (*fn)(const T*,void*), void* d);
bool yourTester(const T* a, void* d); bool yourTester(const T* a, void* d);
size_type removeAll(const T* a);
size_type removeAll(bool (*fn)(T*,void*), void* d); size_type removeAll(bool (*fn)(const T*,void*), void* d);
bool yourTester(T* a, void* d); bool yourTester(const T* a, void* d);
T* removeAt(size_type i);
T* removeFirst();
T* removeLast();
size_type replaceAll(const T* oldVal, T* newVal);
size_type replaceAll(bool (*fn)(T*, void*),void* x,T* newVal); size_type replaceAll(bool (*fn)(const T*, void*),void* x,T* newVal);
bool yourTester(T* a, void* d); bool yourTester(const T* a, void* d);
void resize(size_type n);
void sort();
vector<T*,allocator>& std(); const vector<T*,allocator>& std() const;
const size_type npos;
RWvostream& operator<<(RWvostream& strm, const RWTPtrOrderedVector<T>& coll); RWFile& operator<<(RWFile& strm, const RWTPtrOrderedVector<T>& coll);
RWvistream& operator>>(RWvistream& strm, RWTPtrOrderedVector<T>& coll); RWFile& operator>>(RWFile& strm, RWTPtrOrderedVector<T>& coll);
RWvistream& operator>>(RWvistream& strm, RWTPtrOrderedVector<T>*& p); RWFile& operator>>(RWFile& strm, RWTPtrOrderedVector<T>*& p);