|
yast2-core
|
00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: YCPExternal.h 00014 00015 Author: Stanislav Visnovsky <visnov@suse.cz> 00016 Maintainer: Stanislav Visnovsky <visnov@suse.cz> 00017 00018 /-*/ 00019 // -*- c++ -*- 00020 00021 #ifndef YCPExternal_h 00022 #define YCPExternal_h 00023 00024 00025 #include "YCPValue.h" 00026 00027 00033 class YCPExternalRep : public YCPValueRep 00034 { 00035 void * m_payload; 00036 string m_magic; 00037 void (*m_destructor)(void *, string); 00038 00039 protected: 00040 friend class YCPExternal; 00041 00049 YCPExternalRep(void * payload, string magic, void (*destructor)(void *, string) = 0); 00050 00054 ~YCPExternalRep(); 00055 00056 public: 00059 void * payload() const; 00060 00063 string magic () const; 00064 00068 string toString() const; 00069 00075 std::ostream & toStream (std::ostream & str) const; 00076 std::ostream & toXml (std::ostream & str, int indent ) const; 00077 00081 YCPValueType valuetype() const; 00082 }; 00083 00090 class YCPExternal : public YCPValue 00091 { 00092 DEF_COMMON(External, Value); 00093 public: 00094 YCPExternal(void * payload, string magic, void (*destructor)(void*, string) = 0) 00095 : YCPValue(new YCPExternalRep(payload, magic, destructor)) {} 00096 YCPExternal(bytecodeistream & str); 00097 }; 00098 00099 #endif // YCPExternal_h
1.7.3