#include <y2util/MemUsage.h>
#include <iosfwd>
#include <string>
#include <vector>
#include <map>
#include "toString.h"
Go to the source code of this file.
Classes | |
class | YCPNull |
class | YCPElementRep |
Abstract base class of all YCP elements. More... | |
class | YCPElement |
Wrapper for YCPElementRep This class realizes an automatic memory management via YCPElement. Access the functionality of YCPElementRep with the arrow operator. See YCPElementRep. More... | |
Defines | |
#define | DEF_OPS(name) |
#define | DEF_MEMSIZE(name) |
#define | DEF_COMMON(name, base) |
#define | DEF_COW_OPS(name) |
#define | DEF_COW_COMMON(name, base) |
#define DEF_COMMON | ( | name, | |||
base | ) |
Value:
DEF_OPS(name) \ friend class YCP##base##Rep; \ public: \ DEF_MEMSIZE(name) \ YCP##name(const YCPNull &n) : YCP##base(n) {} \ protected: \ YCP##name (const YCP##name##Rep *x) : YCP##base(x) {}
#define DEF_COW_COMMON | ( | name, | |||
base | ) |
Value:
friend class YCP##base##Rep; \ DEF_COW_OPS(name) \ public: \ YCP##name(const YCPNull &n) : YCP##base(n) {} \ protected: \ YCP##name (const YCP##name##Rep *x) : YCP##base(x) {} \ public: \ YCPOrder compare(const YCP##name x) const { \ return (static_cast<const YCP##name##Rep*>(element))->compare(x); \ } \ string toString () const { return element->toString (); } \ std::ostream & toStream (std::ostream & str ) const { \ return element->toStream (str); \ } \ std::ostream & toXml (std::ostream & str, int indent ) const { \ return element->toXml( str, indent ); \ } \ YCPValueType valuetype () const { return (static_cast<const YCP##name##Rep*>(element))->valuetype (); }
#define DEF_COW_OPS | ( | name | ) |
Value:
public: \ const YCP##name *operator ->() const { \ return static_cast<const YCP##name *>(this); } \ YCP##name *operator ->() { \ return const_cast<YCP##name *>( \ static_cast<const YCP##name *>(this)); } \ private: \ int operator !() const; \ int operator ==(const YCPElement &) const;
#define DEF_MEMSIZE | ( | name | ) |
#define DEF_OPS | ( | name | ) |
Value:
public: \ const YCP##name##Rep *operator ->() const { \ return static_cast<const YCP##name##Rep *>(element); } \ YCP##name##Rep *operator ->() { \ return const_cast<YCP##name##Rep *>( \ static_cast<const YCP##name##Rep *>(element)); } \ private: \ int operator !() const; \ int operator ==(const YCPElement &) const;