|
Go to the documentation of this file.
25 #ifndef FAUDES_BASEVECTOR_H
26 #define FAUDES_BASEVECTOR_H
97 vBaseVector( const std::string& rFilename, const std::string& rLabel = "BaseVector");
112 virtual const Type* Elementp( void) const;
122 virtual const Type& Element( void) const;
132 virtual Type* NewElement( void);
143 virtual bool ElementTry( const Type& rElement) const;
152 const std::string& Name( void) const;
160 void Name( const std::string& rName);
165 virtual void Clear( void);
173 Idx Size( void) const;
192 bool Empty( void) const;
233 virtual void Replace( const Position& pos, const Type& rElem);
263 virtual void Replace( const Position& pos, const std::string& rFileName);
275 virtual void Erase( const Position& pos);
290 virtual void Insert( const Position& pos, const Type& rElem);
321 virtual void Insert( const Position& pos, const std::string& rFileName);
333 virtual void PushBack( const Type& rElem);
347 virtual void PushBack( Type* rElem);
357 virtual void PushBack( const std::string& rFileName);
370 virtual void Append( const Type& rElem);
385 virtual void Append( Type* rElem);
396 virtual void Append( const std::string& rFileName);
410 void FilenameAt( const Position& pos, const std::string& rFileName);
422 const std::string& FilenameAt( const Position& pos) const;
432 void TakeOwnership( void);
439 void TakeCopies( void);
456 virtual void DoDWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
485 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
504 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
521 typedef std::vector<ElementRecord>::iterator iterator;
592 TBaseVector( const std::string& rFilename, const std::string& rLabel = "BaseVector");
607 virtual const T* Elementp( void) const;
633 virtual const T& At( const Position& pos) const;
671 #define THIS TBaseVector<T>
672 #define TEMP template<class T>
673 #define BASE vBaseVector
683 FD_DC( "TBaseVector(" << this << ")::TBaseVector()");
688 TEMP THIS::TBaseVector( const std::string& rFileName, const std::string& rLabel) :
691 FD_DC( "TBaseVector(" << this << ")::TBaseVector()");
693 Read(rFileName,rLabel);
701 FD_DC( "TBaseVector(" << this << ")::TBaseVector(rOtherVector " << &rOtherVector << "): copy construct");
709 FD_DC( "TBaseVector(" << this << ")::TBaseVector([v] rOtherVector " << &rOtherVector << "): copy construct");
714 TEMP THIS::~TBaseVector( void) {
715 FD_DC( "TBaseVector(" << this << ")::~TBaseVector()");
720 TEMP const T* THIS::Elementp( void) const {
726 TEMP bool THIS::ElementTry( const Type& rElement) const {
727 FD_DC( "TBaseVector::ElementTry(): casting from " << typeid(rElement).name() << " to " << typeid(*Elementp()).name());
728 return Elementp()->Cast(&rElement)!=NULL;
733 TEMP void THIS::DoAssign( const THIS& rSourceVector) {
734 FD_DC( "TBaseVector(" << this << ")::DoAssign(rOtherVector " << &rSourceVector << ")");
736 BASE::DoAssign(rSourceVector);
738 FD_DC( "TBaseVector(" << this << ")::DoAssign(rOtherVector " << &rSourceVector << "): done");
743 #ifdef FAUDES_CHECKED
744 if(pos >= mVector.size()) {
745 std::stringstream errstr;
746 errstr << "index out of range" << std::endl;
747 throw Exception( "TBaseVector::At", errstr.str(), 62);
750 #ifdef FAUDES_DEBUG_CODE
751 if(!dynamic_cast<T*>(mVector[pos].pElement)){
752 std::stringstream errstr;
753 errstr << "internal type error" << std::endl;
754 throw Exception( "TBaseVector::At", errstr.str(), 63);
757 return * dynamic_cast<T* >(mVector[pos].pElement);
762 #ifdef FAUDES_CHECKED
763 if(pos >= mVector.size()) {
764 std::stringstream errstr;
765 errstr << "index out of range" << std::endl;
766 throw Exception( "TBaseVector::At", errstr.str(), 62);
769 #ifdef FAUDES_DEBUG_CODE
770 if(!dynamic_cast<T*>(mVector[pos].pElement)){
771 std::stringstream errstr;
772 errstr << "internal type error" << std::endl;
773 throw Exception( "TBaseVector::At", errstr.str(), 63);
776 return * dynamic_cast<T* >(mVector[pos].pElement);
libFAUDES 2.28a
--- 2016.09.13
--- c++ api documentaion by doxygen
|