49 FD_DC(
"vBaseVector(" <<
this <<
")::vBaseVector()");
59 FD_DC(
"vBaseVector(" <<
this <<
")::vBaseVector()");
63 Read(rFileName,rLabel);
71 FD_DC(
"vBaseVector(" <<
this <<
")::vBaseVector(rOtherVector " << &rOtherVector <<
"): copy construct");
77 FD_DC(
"vBaseVector(" <<
this <<
")::~vBaseVector()");
82 FD_DC(
"vBaseVector(" <<
this <<
")::~vBaseVector(): done");
109 FD_DC(
"vBaseVector(" <<
this <<
")::DoAssign(rOtherVector " << &rSourceVector <<
")");
111 if(
this==&rSourceVector)
return;
118 mVector[pos].pElement = rSourceVector.
mVector[pos].pElement->Copy();
123 FD_DC(
"vBaseVector(" <<
this <<
")::DoAssign(rOtherVector " << &rSourceVector <<
"): done");
154 FD_DC(
"vBaseVector(" <<
this <<
")::Size(..): from " <<
mVector.size() <<
" to " << len);
158 for(
Position pos=len; pos<olen; pos++)
163 for(
Position pos=olen; pos < len; pos++) {
169 FD_DC(
"vBaseVector(" <<
this <<
")::Size(..): done");
181 #ifdef FAUDES_CHECKED
183 std::stringstream errstr;
184 errstr <<
"index out of range" << std::endl;
185 throw Exception(
"vBaseVector::At", errstr.str(), 62);
193 #ifdef FAUDES_CHECKED
195 std::stringstream errstr;
196 errstr <<
"index out of range" << std::endl;
197 throw Exception(
"vBaseVector::At", errstr.str(), 62);
207 #ifdef FAUDES_CHECKED
209 std::stringstream errstr;
210 errstr <<
"index out of range" << std::endl;
211 throw Exception(
"vBaseVector::At", errstr.str(), 62);
215 std::stringstream errstr;
216 errstr <<
"cannot cast element " << std::endl;
217 throw Exception(
"vBaseVector::Replace(pos,elem)", errstr.str(), 63);
220 if(pit->mMine)
delete pit->pElement;
221 pit->pElement=rElem.
Copy();
228 #ifdef FAUDES_CHECKED
230 std::stringstream errstr;
231 errstr <<
"index out of range" << std::endl;
232 throw Exception(
"vBaseVector::At", errstr.str(), 62);
236 std::stringstream errstr;
237 errstr <<
"cannot cast element " << std::endl;
238 throw Exception(
"vBaseVector::Replace(pos,elem)", errstr.str(), 63);
241 if(pit->mMine)
delete pit->pElement;
249 #ifdef FAUDES_CHECKED
251 std::stringstream errstr;
252 errstr <<
"index out of range" << std::endl;
253 throw Exception(
"vBaseVector::At", errstr.str(), 62);
257 if(pit->mMine)
delete pit->pElement;
260 pit->pElement->Read(rFileName);
261 pit->mFileName=rFileName;
266 #ifdef FAUDES_CHECKED
268 std::stringstream errstr;
269 errstr <<
"index out of range" << std::endl;
270 throw Exception(
"vBaseVector::At", errstr.str(), 62);
274 if(pit->mMine)
delete pit->pElement;
281 #ifdef FAUDES_CHECKED
283 std::stringstream errstr;
284 errstr <<
"index out of range" << std::endl;
285 throw Exception(
"vBaseVector::At", errstr.str(), 62);
289 std::stringstream errstr;
290 errstr <<
"cannot cast element " << std::endl;
291 throw Exception(
"vBaseVector::Insert(pos,elem)", errstr.str(), 63);
303 #ifdef FAUDES_CHECKED
305 std::stringstream errstr;
306 errstr <<
"index out of range" << std::endl;
307 throw Exception(
"vBaseVector::At", errstr.str(), 62);
311 std::stringstream errstr;
312 errstr <<
"cannot cast element " << std::endl;
313 throw Exception(
"vBaseVector::Insert(pos,elem)", errstr.str(), 63);
325 #ifdef FAUDES_CHECKED
327 std::stringstream errstr;
328 errstr <<
"index out of range" << std::endl;
329 throw Exception(
"vBaseVector::At", errstr.str(), 62);
345 std::stringstream errstr;
346 errstr <<
"cannot cast element " << std::endl;
347 throw Exception(
"vBaseVector::PushBack(elem)", errstr.str(), 63);
359 std::stringstream errstr;
360 errstr <<
"cannot cast element " << std::endl;
361 throw Exception(
"vBaseVector::PushBack(elem)", errstr.str(), 63);
400 std::stringstream errstr;
401 errstr <<
"cannot cast element " << std::endl;
402 throw Exception(
"vBaseVector::Find(elem)", errstr.str(), 63);
405 for(;pos<
Size();++pos) {
406 if(rElem.
Equal(
At(pos)))
return pos;
413 #ifdef FAUDES_CHECKED
415 std::stringstream errstr;
416 errstr <<
"index out of range" << std::endl;
417 throw Exception(
"vBaseVector::FilenameAt", errstr.str(), 62);
425 #ifdef FAUDES_CHECKED
427 std::stringstream errstr;
428 errstr <<
"index out of range" << std::endl;
429 throw Exception(
"vBaseVector::FilenameAt", errstr.str(), 62);
432 mVector[pos].mFileName = rFileName;
438 for(;pit!=
mVector.end();++pit) {
439 if(pit->mMine)
continue;
440 pit->pElement=pit->pElement->Copy();
457 if(
mVector[pos].mFileName==
"") ifiles=
false;
459 std::string dirname=
"";
464 FD_DC(
"vBaseVector(" <<
this <<
")::DoWrite(..): #" <<
Size());
470 mVector[pos].pElement->Write(rTw,
"",pContext);
486 FD_DC(
"vBaseVector(" <<
this <<
")::DoWrite(..): #" <<
Size());
489 mVector[pos].pElement->DWrite(rTw,
"",pContext);
497 FD_DC(
"vBaseVector(" <<
this <<
")::DoSWrite(..)");
501 mVector[pos].pElement->SWrite(rTw);
512 std::string filename =
"";
513 std::string dirname =
"";
516 std::string label=rLabel;
517 if(label==
"") label=
"Vector";
521 while(!rTr.
Eos(label)){
533 path = dirname.append(filename);
551 std::stringstream errstr;
552 errstr <<
"token mismatch" << std::endl;
553 throw Exception(
"vBaseVector::At", errstr.str(), 50);
Classes NameSet, TaNameSet.
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase)
bool Eos(const std::string &rLabel)
void ReadEnd(const std::string &rLabel)
void ReadBegin(const std::string &rLabel)
std::string FileName(void) const
Mode SourceMode(void) const
std::string FileName(void) const
void WriteComment(const std::string &rComment)
void Write(Token &rToken)
void WriteString(const std::string &rString)
bool FileMode(void) const
void WriteEnd(const std::string &rLabel)
const std::string & StringValue(void) const
@ Begin
<label> (begin of section)
@ String
any string, space separated or quoted, must start with a letter
TokenType Type(void) const
virtual Token XBeginTag(const std::string &rLabel="", const std::string &rFallbackLabel="") const
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
virtual Type * New(void) const
virtual Type * Copy(void) const
virtual bool Equal(const Type &rOther) const
virtual const Type * Cast(const Type *pOther) const
virtual Position Find(const Type &rElem)
virtual void DoSWrite(TokenWriter &rTw) const
void FilenameAt(const Position &pos, const std::string &rFileName)
virtual ~vBaseVector(void)
virtual Type * NewElement(void)
virtual const Type & At(const Position &pos) const
virtual const Type & Element(void) const
virtual void Insert(const Position &pos, const Type &rElem)
virtual const Type * Elementp(void) const
virtual bool ElementTry(const Type &rElement) const
virtual void Erase(const Position &pos)
virtual void DoWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
virtual void Append(const Type &rElem)
virtual void DoDWrite(TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
virtual void PushBack(const Type &rElem)
virtual void Replace(const Position &pos, const Type &rElem)
virtual void DoRead(TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
const std::string & Name(void) const
void DoAssign(const vBaseVector &rSourceVector)
std::vector< ElementRecord >::iterator iterator
std::vector< ElementRecord > mVector
std::string ExtractDirectory(const std::string &rFullPath)
std::string PrependPath(const std::string &rLeft, const std::string &rRight)
std::string ExtractFilename(const std::string &rFullPath)
std::string ToStringInteger(Int number)