dtinfo subtree DtMmdb

This commit is contained in:
Ulrich Wilkens
2012-10-14 15:38:27 +02:00
committed by Jon Trulson
parent b92cf08899
commit 8c8363f4a5
184 changed files with 1090 additions and 773 deletions

View File

@@ -26,6 +26,7 @@
#define _cc_dlist_array_h
#include "dti_cc/CC_Dlist.h"
#include "dti_cc/cc_exceptions.h"
template <class T>
class dlist_array : public CC_TPtrDlist<T>
@@ -46,6 +47,21 @@ public:
T* first() ;
*/
T* at(size_t pos) const /* throw boundaryException
* if list size is smaller than pos
*/
{
// Hack to get it passed to iter
CC_TPtrSlistIterator<T> iter( *(CC_TPtrSlist<T> *)this );
for ( int i = 0; i <=pos; i++ ) {
if ( !(++iter) ) {
throw(CASTCCBEXCEPT ccBoundaryException(0,0,i));
}
}
return( iter.key() );
}
T* operator()(size_t i) const { return at(i); };
T* operator[](size_t i) const { return at(i); };
};