|
Go to the documentation of this file.
23 #ifndef FAUDES_RTITYPES_H
24 #define FAUDES_RTITYPES_H
176 class TypeDefinition;
271 virtual Type* New( void) const;
285 virtual Type* Copy( void) const;
300 virtual const Type* Cast( const Type* pOther) const;
306 virtual void Clear( void);
314 virtual bool IsDefault( void) const;
333 virtual Type& Assign( const Type& rSrc);
372 virtual bool Equal( const Type& rOther) const;
390 bool operator==( const Type& rOther) const;
406 bool operator!=( const Type& rOther) const;
418 virtual void Name( const std::string& rName);
429 virtual const std::string& Name( void) const;
442 virtual const std::string& TypeName( void) const;
453 void Write( const Type* pContext=0) const;
472 void Write( const std::string& pFileName, const std::string& rLabel= "",
473 const Type* pContext=0, std::ios::openmode openmode = std::ios::out|std::ios::trunc) const;
488 void Write( const std::string& pFileName, std::ios::openmode openmode) const;
505 void Write( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
523 virtual void XWrite( const std::string& pFileName, const std::string& rLabel= "",
524 const Type* pContext=0) const;
535 void XWrite( const Type* pContext=0) const;
552 void XWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
568 std::string ToString( const std::string& rLabel= "", const Type* pContext=0) const;
586 std::string ToText( const std::string& rLabel= "", const Type* pContext=0) const;
597 void DWrite( const Type* pContext=0) const;
616 void DWrite( const std::string& pFileName, const std::string& rLabel= "",
617 const Type* pContext=0, std::ios::openmode openmode = std::ios::out|std::ios::trunc) const;
634 void DWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
655 void SWrite( void) const;
667 std::string ToSText( void) const;
685 void Read( const std::string& rFileName, const std::string& rLabel = "", const Type* pContext=0);
702 void FromString( const std::string& rString, const std::string& rLabel= "", const Type* pContext=0);
720 void Read( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
735 void DoAssign( const Type& rSrc);
747 bool DoEqual( const Type& rOther) const;
766 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
784 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
804 virtual void DoXWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
822 virtual void DoDWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
866 virtual Token XBeginTag( const std::string& rLabel= "", const std::string& rFallbackLabel= "") const;
880 #define FAUDES_TYPE_DECLARATION(ftype,ctype,cbase) \
881 public: virtual ctype* New(void) const; \
882 public: virtual ctype* Copy(void) const; \
883 public: virtual const Type* Cast(const Type* pOther) const; \
884 public: virtual ctype& Assign(const Type& rSrc); \
885 public: virtual bool Equal(const Type& rOther) const; \
886 public: ctype& operator=(const ctype& rSrc); \
887 public: bool operator==(const ctype& rOther) const; \
888 public: bool operator!=(const ctype& rOther) const;
891 #define FAUDES_TYPE_TDECLARATION(ftype,ctype,cbase) \
892 public: virtual ctype* New(void) const; \
893 public: virtual ctype* Copy(void) const; \
894 public: virtual const Type* Cast(const Type* pOther) const; \
895 public: virtual ctype& Assign(const Type& rSrc); \
896 public: virtual bool Equal(const Type& rOther) const; \
897 public: ctype& operator=(const ctype& rSrc); \
898 public: bool operator==(const ctype& rOther) const; \
899 public: bool operator!=(const ctype& rOther) const;
902 #define FAUDES_TYPE_IMPLEMENTATION_NEW(ftype,ctype,cbase) \
903 ctype* ctype::New(void) const { return new ctype(); }
904 #define FAUDES_TYPE_IMPLEMENTATION_COPY(ftype,ctype,cbase) \
905 ctype* ctype::Copy(void) const { return new ctype(*this); }
906 #define FAUDES_TYPE_IMPLEMENTATION_CAST(ftype,ctype,cbase) \
907 const Type* ctype::Cast(const Type* pOther) const { \
908 return dynamic_cast< const ctype * >(pOther); }
909 #define FAUDES_TYPE_IMPLEMENTATION_ASSIGN(ftype,ctype,cbase) \
910 ctype& ctype::Assign(const Type& rSrc) { \
911 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
912 this->Clear(); DoAssign(*csattr);} \
914 cbase::Assign(rSrc);}; \
916 ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); DoAssign(rSrc); return *this; }
917 #define FAUDES_TYPE_IMPLEMENTATION_EQUAL(ftype,ctype,cbase) \
918 bool ctype::Equal(const Type& rOther) const { \
919 if(&rOther==this) return true; \
920 if(typeid(rOther) != typeid(*this)) return false; \
921 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
922 if(!csattr) return false; \
923 if(!DoEqual(*csattr)) return false; \
925 bool ctype::operator==(const ctype& rOther) const { return DoEqual(rOther); } \
926 bool ctype::operator!=(const ctype& rOther) const { return !DoEqual(rOther); }
929 #define FAUDES_TYPE_TIMPLEMENTATION_NEW(ftype,ctype,cbase,ctemp) \
930 ctemp ctype* ctype::New(void) const { \
931 return new ctype(); }
932 #define FAUDES_TYPE_TIMPLEMENTATION_COPY(ftype,ctype,cbase,ctemp) \
933 ctemp ctype* ctype::Copy(void) const { \
934 return new ctype(*this); }
935 #define FAUDES_TYPE_TIMPLEMENTATION_CAST(ftype,ctype,cbase,ctemp) \
936 ctemp const Type* ctype::Cast(const Type* pOther) const { \
937 return dynamic_cast< const ctype * >(pOther); }
938 #define FAUDES_TYPE_TIMPLEMENTATION_ASSIGN(ftype,ctype,cbase,ctemp) \
939 ctemp ctype& ctype::Assign(const Type& rSrc) { \
940 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
941 this->Clear(); DoAssign(*csattr);} \
943 cbase::Assign(rSrc);}; \
945 ctemp ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); DoAssign(rSrc); return *this; }
946 #define FAUDES_TYPE_TIMPLEMENTATION_EQUAL(ftype,ctype,cbase,ctemp) \
947 ctemp bool ctype::Equal(const Type& rOther) const { \
948 if(&rOther==this) return true; \
949 if(typeid(rOther) != typeid(*this)) return false; \
950 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
951 if(!csattr) return false; \
952 if(!DoEqual(*csattr)) return false; \
954 ctemp bool ctype::operator==(const ctype& rOther) const { return DoEqual(rOther); } \
955 ctemp bool ctype::operator!=(const ctype& rOther) const { return !DoEqual(rOther); }
959 #define FAUDES_TYPE_IMPLEMENTATION(ftype,ctype,cbase) \
960 ctype* ctype::New(void) const { \
961 return new ctype(); } \
962 ctype* ctype::Copy(void) const { \
963 return new ctype(*this); } \
964 const Type* ctype::Cast(const Type* pOther) const { \
965 return dynamic_cast< const ctype * >(pOther); } \
966 ctype& ctype::Assign(const Type& rSrc) { \
967 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
968 this->Clear(); this->DoAssign(*csattr);} \
970 cbase::Assign(rSrc);}; \
972 ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); this->DoAssign(rSrc); return *this; } \
973 bool ctype::Equal(const Type& rOther) const { \
974 if(&rOther==this) return true; \
975 if(typeid(rOther) != typeid(*this)) return false; \
976 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
977 if(!csattr) return false; \
978 if(!this->DoEqual(*csattr)) return false; \
980 bool ctype::operator==(const ctype& rOther) const { return this->DoEqual(rOther); } \
981 bool ctype::operator!=(const ctype& rOther) const { return !this->DoEqual(rOther); }
985 #define FAUDES_TYPE_TIMPLEMENTATION(ftype,ctype,cbase,ctemp) \
986 ctemp ctype* ctype::New(void) const { \
987 return new ctype(); } \
988 ctemp ctype* ctype::Copy(void) const { \
989 return new ctype(*this); } \
990 ctemp const Type* ctype::Cast(const Type* pOther) const { \
991 return dynamic_cast< const ctype * >(pOther); } \
992 ctemp ctype& ctype::Assign(const Type& rSrc) { \
993 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
994 this->Clear(); this->DoAssign(*csattr);} \
996 cbase::Assign(rSrc);}; \
998 ctemp ctype& ctype::operator=(const ctype& rSrc) { this->Clear(); this->DoAssign(rSrc); return *this; } \
999 ctemp bool ctype::Equal(const Type& rOther) const { \
1000 if(&rOther==this) return true; \
1001 if(typeid(rOther) != typeid(*this)) return false; \
1002 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
1003 if(!csattr) return false; \
1004 if(!this->DoEqual(*csattr)) return false; \
1006 ctemp bool ctype::operator==(const ctype& rOther) const { return this->DoEqual(rOther); } \
1007 ctemp bool ctype::operator!=(const ctype& rOther) const { return !this->DoEqual(rOther); }
1015 template<class T, bool = std::is_polymorphic<T>::value>
1062 using Type::operator=;
1063 using Type::operator==;
1064 using Type::operator!=;
1114 using AttrType::operator=;
1115 using AttrType::operator==;
1116 using AttrType::operator!=;
1137 const std::string& Name( void) const;
1145 void Name( const std::string& rName);
1156 virtual const std::string& TypeName( void) const;
1167 virtual void TypeName( const std::string& rType);
1178 virtual const std::string& ElementTag( void) const;
1190 virtual void ElementTag( const std::string& rTag);
1200 virtual const std::string& ElementType( void) const;
1270 using Type::operator=;
1271 using Type::operator==;
1272 using Type::operator!=;
1295 const std::string& Name( void) const;
1304 const std::string& PlugIn( void) const;
1312 const std::string& CType( void) const;
1318 const std::string& TextDoc( void) const;
1324 const std::string& HtmlDoc( void) const;
1330 const std::string& Keywords( void) const;
1342 std::string MatchKeyword( const std::string& rPattern) const;
1349 int KeywordsSize( void) const;
1357 std::string KeywordAt( int pos) const;
1368 bool AutoRegistered( void) const;
1376 bool ApplicationRegistered( void) const;
1390 virtual void MergeDocumentation( TokenReader& rTr);
1402 void Name( const std::string& name);
1410 void PlugIn( const std::string& plugin);
1418 void CType( const std::string& name);
1426 void TextDoc( const std::string& textdoc);
1436 void AutoRegistered( bool flag);
1446 void ApplicationRegistered( bool flag);
1454 void HtmlDoc( const std::string& fname);
1462 void AddKeyword( const std::string& rKeyword);
1500 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
1536 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
1573 static const char mDelim = ';';
1649 static TypeDefinition* Constructor( const std::string& rTypeName= "");
1695 const Type* Prototype( void) const;
1707 Type* NewObject( void) const;
1719 const std::string& ElementTag( void) const;
1727 void ElementTag( const std::string& rTag);
1738 const std::string& ElementType( void) const;
1746 void ElementType( const std::string& rEype);
1787 virtual void Prototype( Type* pType);
1806 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
1838 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
1882 FD_DRTI( "TypeDefinition::Construct<" << typeid(T).name() << ">(" << rTypeName << ")");
1895 FD_DRTI( "TypeDefinition::FromFile<" << typeid(T).name() << ">()");
1899 td-> Read(rFileName);
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
void DoAssign(const AttrType &rSrc)
virtual bool IsDefault(void) const
bool DoEqual(const AttrType &rOther) const
static const Type * ConstPointer(const T *ptr)
static Type * Pointer(T *ptr)
static const Type * ConstPointer(const T *ptr)
static Type * Pointer(T *ptr)
virtual ~Documentation(void)
bool mApplicationRegistered
std::string mElementTagDef
std::string mFaudesTypeName
const TypeDefinition * pTypeDefinition
virtual ~TypeDefinition(void)
static TypeDefinition * FromFile(const std::string &rFileName)
TypeDefinition(const TypeDefinition &rOther)
static TypeDefinition * Constructor(const std::string &rTypeName="")
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
static std::string msStringEmpty
static std::string msStringVoid
libFAUDES 2.33h
--- 2025.06.18
--- c++ api documentaion by doxygen
|