|
Go to the documentation of this file.
23 #ifndef FAUDES_RTITYPES_H
24 #define FAUDES_RTITYPES_H
174 class TypeDefinition;
264 virtual Type* New( void) const;
278 virtual Type* Copy( void) const;
293 virtual const Type* Cast( const Type* pOther) const;
299 virtual void Clear( void);
318 virtual Type& Assign( const Type& rSrc);
340 virtual Type& operator=( const Type& rSrc);
357 virtual bool Equal( const Type& rOther) const;
375 virtual bool operator==( const Type& rOther) const;
391 virtual bool operator!=( const Type& rOther) const;
403 virtual void Name( const std::string& rName);
413 virtual const std::string& Name( void) const;
424 void Write( const Type* pContext=0) const;
443 void Write( const std::string& pFileName, const std::string& rLabel= "",
444 const Type* pContext=0, std::ios::openmode openmode = std::ios::out|std::ios::trunc) const;
459 void Write( const std::string& pFileName, std::ios::openmode openmode) const;
476 void Write( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
494 virtual void XWrite( const std::string& pFileName, const std::string& rLabel= "",
495 const Type* pContext=0) const;
506 void XWrite( const Type* pContext=0) const;
523 void XWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
539 std::string ToString( const std::string& rLabel= "", const Type* pContext=0) const;
557 std::string ToText( const std::string& rLabel= "", const Type* pContext=0) const;
568 void DWrite( const Type* pContext=0) const;
587 void DWrite( const std::string& pFileName, const std::string& rLabel= "",
588 const Type* pContext=0, std::ios::openmode openmode = std::ios::out|std::ios::trunc) const;
605 void DWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
626 void SWrite( void) const;
638 std::string ToSText( void) const;
656 void Read( const std::string& rFileName, const std::string& rLabel = "", const Type* pContext=0);
673 void FromString( const std::string& rString, const std::string& rLabel= "", const Type* pContext=0);
691 void Read( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
706 void DoAssign( const Type& rSrc);
718 bool DoEqual( const Type& rOther) const;
737 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
755 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
775 virtual void DoXWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
793 virtual void DoDWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
838 virtual const std::string& TypeName( void) const;
852 virtual Token XBeginTag( const std::string& rLabel= "", const std::string& rFallbackLabel= "") const;
867 #define FAUDES_TYPE_DECLARATION(ftype,ctype,cbase) \
868 public: virtual ctype* New(void) const; \
869 public: virtual ctype* Copy(void) const; \
870 public: virtual const Type* Cast(const Type* pOther) const; \
871 public: virtual ctype& Assign(const Type& rSrc); \
872 public: virtual bool Equal(const Type& rOther) const; \
873 public: virtual ctype& operator=(const ctype& rSrc); \
874 public: virtual bool operator==(const ctype& rOther) const; \
875 public: virtual bool operator!=(const ctype& rOther) const;
878 #define FAUDES_TYPE_TDECLARATION(ftype,ctype,cbase) \
879 public: virtual ctype* New(void) const; \
880 public: virtual ctype* Copy(void) const; \
881 public: virtual const Type* Cast(const Type* pOther) const; \
882 public: virtual ctype& Assign(const Type& rSrc); \
883 public: virtual bool Equal(const Type& rOther) const; \
884 public: virtual ctype& operator=(const ctype& rSrc); \
885 public: virtual bool operator==(const ctype& rOther) const; \
886 public: virtual bool operator!=(const ctype& rOther) const;
889 #define FAUDES_TYPE_IMPLEMENTATION_NEW(ftype,ctype,cbase) \
890 ctype* ctype::New(void) const { return new ctype(); }
891 #define FAUDES_TYPE_IMPLEMENTATION_COPY(ftype,ctype,cbase) \
892 ctype* ctype::Copy(void) const { return new ctype(*this); }
893 #define FAUDES_TYPE_IMPLEMENTATION_CAST(ftype,ctype,cbase) \
894 const Type* ctype::Cast(const Type* pOther) const { \
895 return dynamic_cast< const ctype * >(pOther); }
896 #define FAUDES_TYPE_IMPLEMENTATION_ASSIGN(ftype,ctype,cbase) \
897 ctype& ctype::Assign(const Type& rSrc) { \
898 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
899 this->Clear(); DoAssign(*csattr);} \
901 cbase::Assign(rSrc);}; \
903 ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); DoAssign(rSrc); return *this; }
904 #define FAUDES_TYPE_IMPLEMENTATION_EQUAL(ftype,ctype,cbase) \
905 bool ctype::Equal(const Type& rOther) const { \
906 if(&rOther==this) return true; \
907 if(typeid(rOther) != typeid(*this)) return false; \
908 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
909 if(!csattr) return false; \
910 if(!DoEqual(*csattr)) return false; \
912 bool ctype::operator==(const ctype& rOther) const { return DoEqual(rOther); } \
913 bool ctype::operator!=(const ctype& rOther) const { return !DoEqual(rOther); }
916 #define FAUDES_TYPE_TIMPLEMENTATION_NEW(ftype,ctype,cbase,ctemp) \
917 ctemp ctype* ctype::New(void) const { \
918 return new ctype(); }
919 #define FAUDES_TYPE_TIMPLEMENTATION_COPY(ftype,ctype,cbase,ctemp) \
920 ctemp ctype* ctype::Copy(void) const { \
921 return new ctype(*this); }
922 #define FAUDES_TYPE_TIMPLEMENTATION_CAST(ftype,ctype,cbase,ctemp) \
923 ctemp const Type* ctype::Cast(const Type* pOther) const { \
924 return dynamic_cast< const ctype * >(pOther); }
925 #define FAUDES_TYPE_TIMPLEMENTATION_ASSIGN(ftype,ctype,cbase,ctemp) \
926 ctemp ctype& ctype::Assign(const Type& rSrc) { \
927 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
928 this->Clear(); DoAssign(*csattr);} \
930 cbase::Assign(rSrc);}; \
932 ctemp ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); DoAssign(rSrc); return *this; }
933 #define FAUDES_TYPE_TIMPLEMENTATION_EQUAL(ftype,ctype,cbase,ctemp) \
934 ctemp bool ctype::Equal(const Type& rOther) const { \
935 if(&rOther==this) return true; \
936 if(typeid(rOther) != typeid(*this)) return false; \
937 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
938 if(!csattr) return false; \
939 if(!DoEqual(*csattr)) return false; \
941 ctemp bool ctype::operator==(const ctype& rOther) const { return DoEqual(rOther); } \
942 ctemp bool ctype::operator!=(const ctype& rOther) const { return !DoEqual(rOther); }
946 #define FAUDES_TYPE_IMPLEMENTATION(ftype,ctype,cbase) \
947 ctype* ctype::New(void) const { \
948 return new ctype(); } \
949 ctype* ctype::Copy(void) const { \
950 return new ctype(*this); } \
951 const Type* ctype::Cast(const Type* pOther) const { \
952 return dynamic_cast< const ctype * >(pOther); } \
953 ctype& ctype::Assign(const Type& rSrc) { \
954 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
955 this->Clear(); this->DoAssign(*csattr);} \
957 cbase::Assign(rSrc);}; \
959 ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); this->DoAssign(rSrc); return *this; } \
960 bool ctype::Equal(const Type& rOther) const { \
961 if(&rOther==this) return true; \
962 if(typeid(rOther) != typeid(*this)) return false; \
963 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
964 if(!csattr) return false; \
965 if(!this->DoEqual(*csattr)) return false; \
967 bool ctype::operator==(const ctype& rOther) const { return this->DoEqual(rOther); } \
968 bool ctype::operator!=(const ctype& rOther) const { return !this->DoEqual(rOther); }
972 #define FAUDES_TYPE_TIMPLEMENTATION(ftype,ctype,cbase,ctemp) \
973 ctemp ctype* ctype::New(void) const { \
974 return new ctype(); } \
975 ctemp ctype* ctype::Copy(void) const { \
976 return new ctype(*this); } \
977 ctemp const Type* ctype::Cast(const Type* pOther) const { \
978 return dynamic_cast< const ctype * >(pOther); } \
979 ctemp ctype& ctype::Assign(const Type& rSrc) { \
980 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
981 this->Clear(); this->DoAssign(*csattr);} \
983 cbase::Assign(rSrc);}; \
985 ctemp ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); this->DoAssign(rSrc); return *this; } \
986 ctemp bool ctype::Equal(const Type& rOther) const { \
987 if(&rOther==this) return true; \
988 if(typeid(rOther) != typeid(*this)) return false; \
989 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
990 if(!csattr) return false; \
991 if(!this->DoEqual(*csattr)) return false; \
993 ctemp bool ctype::operator==(const ctype& rOther) const { return this->DoEqual(rOther); } \
994 ctemp bool ctype::operator!=(const ctype& rOther) const { return !this->DoEqual(rOther); }
1154 const std::string& Name( void) const;
1163 const std::string& PlugIn( void) const;
1171 const std::string& CType( void) const;
1177 const std::string& TextDoc( void) const;
1183 const std::string& HtmlDoc( void) const;
1189 const std::string& Keywords( void) const;
1201 std::string MatchKeyword( const std::string& rPattern) const;
1208 int KeywordsSize( void) const;
1216 std::string KeywordAt( int pos) const;
1227 bool AutoRegistered( void) const;
1235 bool ApplicationRegistered( void) const;
1249 virtual void MergeDocumentation( TokenReader& rTr);
1261 void Name( const std::string& name);
1269 void PlugIn( const std::string& plugin);
1277 void CType( const std::string& name);
1285 void TextDoc( const std::string& textdoc);
1295 void AutoRegistered( bool flag);
1305 void ApplicationRegistered( bool flag);
1313 void HtmlDoc( const std::string& fname);
1321 void AddKeyword( const std::string& rKeyword);
1360 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
1396 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
1433 static const char mDelim = ';';
1505 static TypeDefinition* Constructor( const std::string& rTypeName= "");
1551 const Type* Prototype( void) const;
1563 Type* NewObject( void) const;
1575 const std::string& XElementTag( void) const;
1583 void XElementTag( const std::string& rTag);
1625 virtual void Prototype( Type* pType);
1644 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
1676 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
1717 FD_DRTI( "TypeDefinition::Construct<" << typeid(T).name() << ">(" << rTypeName << ")");
1725 FD_DRTI( "TypeDefinition::FromFile<" << typeid(T).name() << ">()");
1729 td-> Read(rFileName);
libFAUDES 2.28a
--- 2016.09.13
--- c++ api documentaion by doxygen
|