YCPExternal.h

Go to the documentation of this file.
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 
00080     YCPValueType valuetype() const;
00081 };
00082 
00089 class YCPExternal : public YCPValue
00090 {
00091     DEF_COMMON(External, Value);
00092 public:
00093     YCPExternal(void * payload, string magic, void (*destructor)(void*, string) = 0) 
00094         : YCPValue(new YCPExternalRep(payload, magic, destructor)) {}
00095     YCPExternal(bytecodeistream & str);
00096 };
00097 
00098 #endif   // YCPExternal_h

Generated on Fri Jun 16 18:07:45 2006 for yast2-core by  doxygen 1.4.6