|
|
Go to the documentation of this file.
23#ifndef FAUDES_RTITYPES_H
24#define FAUDES_RTITYPES_H
272 virtual Type* New( void) const;
286 virtual Type* NewCpy( void) const;
301 virtual const Type* Cast( const Type* pOther) const;
307 virtual void Clear( void);
315 virtual bool IsDefault( void) const;
333 virtual Type& Copy( const Type& rSrc);
400 virtual bool Equal( const Type& rOther) const;
418 bool operator==( const Type& rOther) const;
434 bool operator!=( const Type& rOther) const;
446 virtual void Name( const std::string& rName);
457 virtual const std::string& Name( void) const;
470 virtual const std::string& TypeName( void) const;
481 void Write( const Type* pContext=0) const;
500 void Write( const std::string& pFileName, const std::string& rLabel= "",
501 const Type* pContext=0, std::ios::openmode openmode = std::ios::out|std::ios::trunc) const;
516 void Write( const std::string& pFileName, std::ios::openmode openmode) const;
533 void Write( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
551 virtual void XWrite( const std::string& pFileName, const std::string& rLabel= "",
552 const Type* pContext=0) const;
563 void XWrite( const Type* pContext=0) const;
580 void XWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
596 std::string ToString( const std::string& rLabel= "", const Type* pContext=0) const;
614 std::string ToText( const std::string& rLabel= "", const Type* pContext=0) const;
625 void DWrite( const Type* pContext=0) const;
644 void DWrite( const std::string& pFileName, const std::string& rLabel= "",
645 const Type* pContext=0, std::ios::openmode openmode = std::ios::out|std::ios::trunc) const;
662 void DWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
683 void SWrite( void) const;
695 std::string ToSText( void) const;
713 void Read( const std::string& rFileName, const std::string& rLabel = "", const Type* pContext=0);
730 void FromString( const std::string& rString, const std::string& rLabel= "", const Type* pContext=0);
748 void Read( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
763 void DoCopy( const Type& rSrc);
774 void DoMove( Type& rSrc);
786 bool DoEqual( const Type& rOther) const;
805 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
823 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
843 virtual void DoXWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
861 virtual void DoDWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
904 virtual Token XBeginTag( const std::string& rLabel= "", const std::string& rFallbackLabel= "") const;
918#define FAUDES_TYPE_DECLARATION(ftype,ctype,cbase) \
919 public: virtual ctype* New(void) const; \
920 public: virtual ctype* NewCpy(void) const; \
921 public: virtual const Type* Cast(const Type* pOther) const; \
922 public: virtual ctype& Copy(const Type& rSrc); \
923 public: virtual ctype& Move(Type& rSrc); \
924 public: virtual bool Equal(const Type& rOther) const; \
925 public: ctype& operator=(const ctype& rSrc); \
926 public: ctype& operator=(ctype&& rSrc); \
927 public: bool operator==(const ctype& rOther) const; \
928 public: bool operator!=(const ctype& rOther) const;
931#define FAUDES_TYPE_TDECLARATION(ftype,ctype,cbase) \
932 public: virtual ctype* New(void) const; \
933 public: virtual ctype* NewCpy(void) const; \
934 public: virtual const Type* Cast(const Type* pOther) const; \
935 public: virtual ctype& Copy(const Type& rSrc); \
936 public: virtual ctype& Move(Type& rSrc); \
937 public: virtual bool Equal(const Type& rOther) const; \
938 public: ctype& operator=(const ctype& rSrc); \
939 public: ctype& operator=(ctype&& rSrc); \
940 public: bool operator==(const ctype& rOther) const; \
941 public: bool operator!=(const ctype& rOther) const;
944#define FAUDES_TYPE_IMPLEMENTATION_NEW(ftype,ctype,cbase) \
945 ctype* ctype::New(void) const { return new ctype(); }
946#define FAUDES_TYPE_IMPLEMENTATION_NEWCOPY(ftype,ctype,cbase) \
947 ctype* ctype::NewCpy(void) const { return new ctype(*this); }
948#define FAUDES_TYPE_IMPLEMENTATION_CAST(ftype,ctype,cbase) \
949 const Type* ctype::Cast(const Type* pOther) const { \
950 return dynamic_cast< const ctype * >(pOther); }
951#define FAUDES_TYPE_IMPLEMENTATION_ASSIGN(ftype,ctype,cbase) \
952 ctype& ctype::Copy(const Type& rSrc) { \
953 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
956 cbase::Copy(rSrc);}; \
958 ctype& ctype::operator=(const ctype& rSrc) { DoCopy(rSrc); return *this; }
959#define FAUDES_TYPE_IMPLEMENTATION_MOVE(ftype,ctype,cbase) \
960 ctype& ctype::Move(Type& rSrc) { \
961 if(ctype* csattr=dynamic_cast< ctype * >(&rSrc)) { \
964 cbase::Move(rSrc);}; \
966 ctype& ctype::operator=(ctype&& rSrc) { DoMove(rSrc); return *this; }
967#define FAUDES_TYPE_IMPLEMENTATION_EQUAL(ftype,ctype,cbase) \
968 bool ctype::Equal(const Type& rOther) const { \
969 if(&rOther==this) return true; \
970 if(typeid(rOther) != typeid(*this)) return false; \
971 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
972 if(!csattr) return false; \
973 if(!DoEqual(*csattr)) return false; \
975 bool ctype::operator==(const ctype& rOther) const { return DoEqual(rOther); } \
976 bool ctype::operator!=(const ctype& rOther) const { return !DoEqual(rOther); }
979#define FAUDES_TYPE_TIMPLEMENTATION_NEW(ftype,ctype,cbase,ctemp) \
980 ctemp ctype* ctype::New(void) const { \
981 return new ctype(); }
982#define FAUDES_TYPE_TIMPLEMENTATION_NEWCOPY(ftype,ctype,cbase,ctemp) \
983 ctemp ctype* ctype::NewCpy(void) const { \
984 return new ctype(*this); }
985#define FAUDES_TYPE_TIMPLEMENTATION_CAST(ftype,ctype,cbase,ctemp) \
986 ctemp const Type* ctype::Cast(const Type* pOther) const { \
987 return dynamic_cast< const ctype * >(pOther); }
988#define FAUDES_TYPE_TIMPLEMENTATION_ASSIGN(ftype,ctype,cbase,ctemp) \
989 ctemp ctype& ctype::Copy(const Type& rSrc) { \
990 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
993 cbase::Copy(rSrc);}; \
995 ctemp ctype& ctype::operator=(const ctype& rSrc) { DoCopy(rSrc); return *this; }
996#define FAUDES_TYPE_TIMPLEMENTATION_MOVE(ftype,ctype,cbase,ctemp) \
997 ctemp ctype& ctype::Move(Type& rSrc) { \
998 if(ctype* csattr=dynamic_cast< ctype * >(&rSrc)) { \
1001 cbase::Move(rSrc);}; \
1003 ctemp ctype& ctype::operator=(ctype&& rSrc) { DoMove(rSrc); return *this; }
1004#define FAUDES_TYPE_TIMPLEMENTATION_EQUAL(ftype,ctype,cbase,ctemp) \
1005 ctemp bool ctype::Equal(const Type& rOther) const { \
1006 if(&rOther==this) return true; \
1007 if(typeid(rOther) != typeid(*this)) return false; \
1008 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
1009 if(!csattr) return false; \
1010 if(!DoEqual(*csattr)) return false; \
1012 ctemp bool ctype::operator==(const ctype& rOther) const { return DoEqual(rOther); } \
1013 ctemp bool ctype::operator!=(const ctype& rOther) const { return !DoEqual(rOther); }
1017#define FAUDES_TYPE_IMPLEMENTATION(ftype,ctype,cbase) \
1018 ctype* ctype::New(void) const { \
1019 return new ctype(); } \
1020 ctype* ctype::NewCpy(void) const { \
1021 return new ctype(*this); } \
1022 const Type* ctype::Cast(const Type* pOther) const { \
1023 return dynamic_cast< const ctype * >(pOther); } \
1024 ctype& ctype::Copy(const Type& rSrc) { \
1025 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
1026 this->DoCopy(*csattr);} \
1028 cbase::Copy(rSrc);}; \
1030 ctype& ctype::operator=(const ctype& rSrc) { this->DoCopy(rSrc); return *this; } \
1031 ctype& ctype::Move(Type& rSrc) { \
1032 if(ctype* csattr=dynamic_cast< ctype * >(&rSrc)) { \
1033 this->DoMove(*csattr);} \
1035 cbase::Move(rSrc);}; \
1037 ctype& ctype::operator=(ctype&& rSrc) { this->DoMove(rSrc); return *this; } \
1038 bool ctype::Equal(const Type& rOther) const { \
1039 if(&rOther==this) return true; \
1040 if(typeid(rOther) != typeid(*this)) return false; \
1041 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
1042 if(!csattr) return false; \
1043 if(!this->DoEqual(*csattr)) return false; \
1045 bool ctype::operator==(const ctype& rOther) const { return this->DoEqual(rOther); } \
1046 bool ctype::operator!=(const ctype& rOther) const { return !this->DoEqual(rOther); }
1050#define FAUDES_TYPE_TIMPLEMENTATION(ftype,ctype,cbase,ctemp) \
1051 ctemp ctype* ctype::New(void) const { \
1052 return new ctype(); } \
1053 ctemp ctype* ctype::NewCpy(void) const { \
1054 return new ctype(*this); } \
1055 ctemp const Type* ctype::Cast(const Type* pOther) const { \
1056 return dynamic_cast< const ctype * >(pOther); } \
1057 ctemp ctype& ctype::Copy(const Type& rSrc) { \
1058 if(const ctype* csattr=dynamic_cast< const ctype * >(&rSrc)) { \
1059 this->DoCopy(*csattr);} \
1061 cbase::Copy(rSrc);}; \
1063 ctemp ctype& ctype::operator=(const ctype& rSrc) { this->DoCopy(rSrc); return *this; } \
1064 ctemp ctype& ctype::Move(Type& rSrc) { \
1065 if(ctype* csattr=dynamic_cast< ctype * >(&rSrc)) { \
1066 this->DoMove(*csattr);} \
1068 cbase::Move(rSrc);}; \
1070 ctemp ctype& ctype::operator=(ctype&& rSrc) { this->DoMove(rSrc); return *this; } \
1071 ctemp bool ctype::Equal(const Type& rOther) const { \
1072 if(&rOther==this) return true; \
1073 if(typeid(rOther) != typeid(*this)) return false; \
1074 const ctype* csattr=dynamic_cast<const ctype*>(&rOther); \
1075 if(!csattr) return false; \
1076 if(!this->DoEqual(*csattr)) return false; \
1078 ctemp bool ctype::operator==(const ctype& rOther) const { return this->DoEqual(rOther); } \
1079 ctemp bool ctype::operator!=(const ctype& rOther) const { return !this->DoEqual(rOther); }
1087template<class T, bool = std::is_polymorphic<T>::value>
1134 using Type::operator=;
1135 using Type::operator==;
1136 using Type::operator!=;
1186 using AttrType::operator=;
1187 using AttrType::operator==;
1188 using AttrType::operator!=;
1209 const std::string& Name( void) const;
1217 void Name( const std::string& rName);
1228 virtual const std::string& TypeName( void) const;
1239 virtual void TypeName( const std::string& rType);
1250 virtual const std::string& ElementTag( void) const;
1261 virtual void ElementTag( const std::string& rTag);
1271 virtual const std::string& ElementType( void) const;
1341 using Type::operator=;
1342 using Type::operator==;
1343 using Type::operator!=;
1366 const std::string& Name( void) const;
1375 const std::string& PlugIn( void) const;
1383 const std::string& CType( void) const;
1389 const std::string& TextDoc( void) const;
1395 const std::string& HtmlDoc( void) const;
1401 const std::string& Keywords( void) const;
1413 std::string MatchKeyword( const std::string& rPattern) const;
1420 int KeywordsSize( void) const;
1428 std::string KeywordAt( int pos) const;
1439 bool AutoRegistered( void) const;
1447 bool ApplicationRegistered( void) const;
1461 virtual void MergeDocumentation( TokenReader& rTr);
1473 void Name( const std::string& name);
1481 void PlugIn( const std::string& plugin);
1489 void CType( const std::string& name);
1497 void TextDoc( const std::string& textdoc);
1507 void AutoRegistered( bool flag);
1517 void ApplicationRegistered( bool flag);
1525 void HtmlDoc( const std::string& fname);
1533 void AddKeyword( const std::string& rKeyword);
1571 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
1607 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
1644 static const char mDelim = ';';
1720 static TypeDefinition* Constructor( const std::string& rTypeName= "");
1766 const Type* Prototype( void) const;
1778 Type* NewObject( void) const;
1790 const std::string& ElementTag( void) const;
1798 void ElementTag( const std::string& rTag);
1809 const std::string& ElementType( void) const;
1817 void ElementType( const std::string& rEype);
1858 virtual void Prototype( Type* pType);
1877 virtual void DoRead( TokenReader& rTr, const std::string& rLabel = "", const Type* pContext=0);
1909 virtual void DoWrite( TokenWriter& rTw, const std::string& rLabel= "", const Type* pContext=0) const;
1953 FD_DRTI( "TypeDefinition::Construct<" << typeid(T).name() << ">(" << rTypeName << ")");
1966 FD_DRTI( "TypeDefinition::FromFile<" << typeid(T).name() << ">()");
1970 td-> Read(rFileName);
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
void DoCopy(const AttrType &rSrc)
virtual bool IsDefault(void) const
bool DoEqual(const AttrType &rOther) const
static Type * Pointer(T *ptr)
static const Type * ConstPointer(const 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.34d
--- 2026.03.11
--- c++ api documentaion by doxygen
|