#include <arrayc.h>
Inheritance diagram for ArrayC< Typ >:


Public Methods | |
| ArrayC () | |
| ArrayC (const ArrayC< Typ > &A) | |
| ArrayC (const Typ *data, long datalen) | |
| ArrayC (long l, long b, const Typ &bl) | |
| ArrayC (long datalen) | |
| ~ArrayC () | |
| const ArrayC< Typ > & | operator= (const ArrayC< Typ > &A) |
| short | operator== (const ArrayC< Typ > &a) |
| short | operator!= (const ArrayC< Typ > &a) |
| const Typ & | get (long l) const |
| long | capacity () const |
| long | size () const |
| Typ & | operator[] (long i) |
| Typ & | back () |
| short | put (long l, const Typ &t) |
| void | set (long l, const Typ &t) |
| void | push_back (const Typ &t) |
| short | pop_back (Typ &t) |
| short | pop_front (Typ &t) |
| void | push () |
| void | Erase (long a, long e) |
| Typ * | GetBuffer () |
| void | SetBlockSize (long i) |
| void | SetBuffer (Typ *data, long n) |
| void | SetLength (long l) |
| short | SetBufferLength (long l) |
| short | InsertAtPos (long l, const Typ &t) |
| void | RemoveElementAtPos (long l) |
| short | RemoveElement (Typ &t) |
| void | Empty () |
| void | OptimizeMemory () |
| long | GetIndexOf (const Typ &t) const |
| short | Contain (const Typ &t) |
| long | Count (const Typ &t) |
| void | SetBlankAndClear (const Typ &bl) |
| void | SetBlankAndClear (const Typ &bl, long l) |
Protected Methods | |
| int | MakeLonger (unsigned int b) |
Protected Attributes | |
| Typ | m_blank |
| long | m_blocklen |
| long | m_buflen |
| long | m_anzahlelemente |
| Typ * | m_array |
|
|||||||||
|
Definition at line 48 of file arrayc.h.
00048 {
00049 m_buflen= 1;
00050 m_anzahlelemente = 0;
00051 m_blocklen = 0;
00052 m_array = new Typ[1];
00053 }
|
|
||||||||||
|
Definition at line 55 of file arrayc.h.
00055 {
00056 long i;
00057 m_blocklen=A.m_blocklen;
00058 m_buflen=A.m_buflen;
00059 m_anzahlelemente=A.m_anzahlelemente;
00060 m_array=new Typ[m_buflen];
00061 for(i=0;i<m_buflen;i++){m_array[i]=A.m_array[i];}
00062 }
|
|
||||||||||||||||
|
Definition at line 64 of file arrayc.h.
00064 {
00065 m_buflen= datalen;
00066 m_anzahlelemente = datalen;
00067 m_blocklen = 0;
00068 m_array = new Typ[datalen];
00069 for(long i=0;i<datalen;i++){
00070 m_array[i] = data[i];
00071 }
00072 }
|
|
||||||||||||||||||||
|
Definition at line 74 of file arrayc.h.
00074 {
00075 m_buflen= l;
00076 m_anzahlelemente = 0;
00077 m_blocklen = b;
00078 m_array = new Typ[l];
00079 SetBlankAndClear(bl);
00080 }
|
|
||||||||||
|
Definition at line 82 of file arrayc.h.
00082 {
00083 m_buflen= datalen;
00084 m_anzahlelemente = 0;
00085 m_blocklen = 0;
00086 m_array = new Typ[datalen];
00087 }
|
|
|||||||||
|
Definition at line 89 of file arrayc.h.
00089 {
00090 delete [] m_array;
00091 }
|
|
|||||||||
|
Definition at line 132 of file arrayc.h.
00132 {
00133 assert(m_anzahlelemente>0);
00134 return m_array[m_anzahlelemente-1];
00135 }
|
|
|||||||||
|
Definition at line 126 of file arrayc.h.
00126 {return m_buflen;}
|
|
||||||||||
|
Definition at line 269 of file arrayc.h.
00270 {
00271 for(long i=0;i<m_anzahlelemente;i++){
00272 if(m_array[i]==t){return 1;}
00273 }
00274 return 0;
00275 }
|
|
||||||||||
|
Definition at line 278 of file arrayc.h.
00279 {
00280 long j=0;
00281 for(long i=0;i<m_anzahlelemente;i++){
00282 if(m_array[i]==t){j++;}
00283 }
00284 return j;
00285 }
|
|
|||||||||
|
Definition at line 249 of file arrayc.h.
00249 {
00250 m_anzahlelemente=0;
00251 }
|
|
||||||||||||||||
|
Definition at line 179 of file arrayc.h.
00179 {
00180 if(a<0){a=0;}
00181 if(e>=m_anzahlelemente){e=m_anzahlelemente-1;}
00182 if(a>e){return;}
00183 long i;
00184 m_anzahlelemente-=e-a+1;
00185 for(i=a;i<m_anzahlelemente;i++){
00186 m_array[i]=m_array[i+(e-a)+1];
00187 }
00188 }
|
|
||||||||||
|
Definition at line 121 of file arrayc.h.
00121 {
00122 assert(l<m_anzahlelemente);
00123 return m_array[l];
00124 }
|
|
|||||||||
|
Definition at line 190 of file arrayc.h.
00190 {return m_array;}
|
|
||||||||||
|
Definition at line 262 of file arrayc.h.
00262 {
00263 for(long i=0;i<m_anzahlelemente;i++){if(m_array[i]==t){return long(i);}}
00264 return -1;
00265 }
|
|
||||||||||||||||
|
Definition at line 214 of file arrayc.h.
00214 {
00215 long i;
00216 if(l>=m_anzahlelemente) return 0;
00217 if (m_anzahlelemente >= m_buflen){MakeLonger(m_blocklen+1);}
00218 for(i=m_anzahlelemente;i>l;i--){m_array[i]=m_array[i-1];}
00219 m_array[l]=t;
00220 m_anzahlelemente++;
00221 return 1;
00222 }
|
|
||||||||||
|
Definition at line 303 of file arrayc.h.
00303 {
00304 Typ *Ablage;
00305 long i,lAlt;
00306 Ablage = m_array;
00307 lAlt=m_buflen;
00308 m_buflen+=b;
00309 m_array = new Typ[m_buflen]; assert(m_array);
00310 if(m_array==0) return 0;
00311 for(i=0;i<lAlt;i++){m_array[i]=Ablage[i];}
00312 for(i=lAlt;i<m_buflen;i++){m_array[i]=m_blank;}
00313 delete [] Ablage;
00314 return 1;
00315 }
|
|
||||||||||
|
Definition at line 114 of file arrayc.h.
|
|
||||||||||
|
Definition at line 93 of file arrayc.h.
00093 {
00094 if (this == &A) return *this;
00095 long i;
00096 delete [] m_array;
00097 m_blocklen=A.m_blocklen;
00098 m_buflen=A.m_buflen;
00099 m_anzahlelemente=A.m_anzahlelemente;
00100 m_array=new Typ[m_buflen];
00101 for(i=0;i<m_buflen;i++){m_array[i]=A.m_array[i];}
00102 return *this;
00103 }
|
|
||||||||||
|
Definition at line 106 of file arrayc.h.
|
|
||||||||||
|
Definition at line 130 of file arrayc.h.
00130 {return m_array[i];}
|
|
|||||||||
|
Definition at line 253 of file arrayc.h.
00253 {
00254 long i;
00255 Typ* tmparray=new Typ[m_anzahlelemente];
00256 m_buflen=m_anzahlelemente;
00257 for(i=0;i<m_anzahlelemente;i++){tmparray[i]=m_array[i];}
00258 delete [] m_array;
00259 m_array=tmparray;
00260 }
|
|
||||||||||
|
Definition at line 153 of file arrayc.h.
00154 {
00155 short erg = m_anzahlelemente>0;
00156 if(m_anzahlelemente>0){
00157 m_anzahlelemente--;
00158 t = m_array[m_anzahlelemente];
00159 }
00160 return erg;
00161 }
|
|
||||||||||
|
Definition at line 163 of file arrayc.h.
00164 {
00165 short erg = m_anzahlelemente>0;
00166 if(erg){
00167 t = m_array[0];
00168 RemoveElementAtPos(0);
00169 }
00170 return erg;
00171 }
|
|
|||||||||
|
Definition at line 173 of file arrayc.h.
00173 {
00174 assert(m_anzahlelemente>0);
00175 if ( m_anzahlelemente >= m_buflen){MakeLonger(m_blocklen+1);}
00176 push_back(m_array[m_anzahlelemente-1]);
00177 }
|
|
||||||||||
|
Definition at line 148 of file arrayc.h.
00148 {
00149 if ( m_anzahlelemente >= m_buflen){MakeLonger(m_blocklen+1);}
00150 m_array[m_anzahlelemente++]=t;
00151 }
|
|
||||||||||||||||
|
Definition at line 137 of file arrayc.h.
00137 {
00138 if(l>=m_anzahlelemente) return 0;
00139 m_array[l]=t;
00140 return 1;
00141 }
|
|
||||||||||
|
Definition at line 238 of file arrayc.h.
00238 {
00239 long i;
00240 for(i=0;i<m_anzahlelemente;i++){
00241 if(m_array[i]==t){
00242 RemoveElementAtPos(i);
00243 return true;
00244 }
00245 }
00246 return false;
00247 }
|
|
||||||||||
|
Definition at line 225 of file arrayc.h.
00226 {
00227 assert(l<m_buflen);
00228 long i;
00229 m_anzahlelemente--;
00230 //kein memcpy um, damit das ganze auch für arrays von Klassen funktioniert.
00231 //memcpy(&m_array[i],&m_array[i+1],(m_anzahlelemente-l)*sizeof(Typ));
00232 for(i=l;i<m_anzahlelemente;i++){
00233 m_array[i]=m_array[i+1];
00234 }
00235 }
|
|
||||||||||||||||
|
Definition at line 143 of file arrayc.h.
00143 {
00144 if(l>=m_anzahlelemente){SetLength(l+1);}
00145 m_array[l] = t;
00146 }
|
|
||||||||||||||||
|
Definition at line 294 of file arrayc.h.
00294 {
00295 m_blank=bl;
00296 if(l>m_anzahlelemente) m_anzahlelemente=l;
00297 SetBufferLength(l);
00298 long i;
00299 for(i=0;i<m_buflen;i++){m_array[i]=m_blank;}
00300 }
|
|
||||||||||
|
Definition at line 287 of file arrayc.h.
|
|
||||||||||
|
Definition at line 192 of file arrayc.h.
00192 {m_blocklen=i;}
|
|
||||||||||||||||
|
Definition at line 194 of file arrayc.h.
00194 { // aufeigene Verantwortung
00195 delete m_array;
00196 m_array = data;
00197 m_anzahlelemente = n;
00198 m_buflen = m_anzahlelemente;
00199 }
|
|
||||||||||
|
Definition at line 206 of file arrayc.h.
00206 {
00207 if(l>m_buflen){
00208 return MakeLonger((l-m_buflen)+m_blocklen);
00209 }
00210 return 0;
00211 // if(l>m_anzahlelemente){m_anzahlelemente=l;}
00212 }
|
|
||||||||||
|
Definition at line 201 of file arrayc.h.
00201 {
00202 SetBufferLength(l);
00203 m_anzahlelemente=l;
00204 }
|
|
|||||||||
|
Definition at line 128 of file arrayc.h.
00128 {return m_anzahlelemente;}
|
|
|||||
|
Definition at line 44 of file arrayc.h. Referenced by ArrayC< Value >::ArrayC(), and ArrayC< Value >::operator=(). |
|
|||||
|
Definition at line 45 of file arrayc.h. Referenced by ArrayC< Value >::ArrayC(), ArrayC< Value >::operator!=(), ArrayC< Value >::operator=(), and ArrayC< Value >::operator==(). |
|
|||||
|
|
|
|||||
|
Definition at line 42 of file arrayc.h. Referenced by ArrayC< Value >::ArrayC(), and ArrayC< Value >::operator=(). |
|
|||||
|
Definition at line 43 of file arrayc.h. Referenced by ArrayC< Value >::ArrayC(), and ArrayC< Value >::operator=(). |
1.3-rc2