Go to the documentation of this file.
64 #define DEF_OPS(name) \
66 const YCP##name##Rep *operator ->() const { \
67 return static_cast<const YCP##name##Rep *>(element); } \
68 YCP##name##Rep *operator ->() { \
69 return const_cast<YCP##name##Rep *>( \
70 static_cast<const YCP##name##Rep *>(element)); } \
72 int operator !() const; \
73 int operator ==(const YCPElement &) const;
77 #define DEF_MEMSIZE(name) \
78 virtual size_t mem_size () const { return sizeof (YCP##name); }
80 #define DEF_MEMSIZE(name)
83 #define DEF_COMMON(name, base) \
85 friend class YCP##base##Rep; \
88 YCP##name(const YCPNull &n) : YCP##base(n) {} \
90 YCP##name (const YCP##name##Rep *x) : YCP##base(x) {}
93 #define DEF_COW_OPS(name) \
95 const YCP##name *operator ->() const { \
96 return static_cast<const YCP##name *>(this); } \
97 YCP##name *operator ->() { \
98 return const_cast<YCP##name *>( \
99 static_cast<const YCP##name *>(this)); } \
101 int operator !() const; \
102 int operator ==(const YCPElement &) const;
104 #define DEF_COW_COMMON(name, base) \
105 friend class YCP##base##Rep; \
108 YCP##name(const YCPNull &n) : YCP##base(n) {} \
110 YCP##name (const YCP##name##Rep *x) : YCP##base(x) {} \
112 YCPOrder compare(const YCP##name x) const { \
113 return (static_cast<const YCP##name##Rep*>(element))->compare(x); \
115 string toString () const { return element->toString (); } \
116 std::ostream & toStream (std::ostream & str ) const { \
117 return element->toStream (str); \
119 std::ostream & toXml (std::ostream & str, int indent ) const { \
120 return element->toXml( str, indent ); \
122 YCPValueType valuetype () const { return (static_cast<const YCP##name##Rep*>(element))->valuetype (); }
275 virtual string toString()
const = 0;
280 virtual std::ostream &
toStream (std::ostream &
str)
const = 0;
281 virtual std::ostream &
toXml (std::ostream &
str,
int indent )
const = 0;
351 #endif // YCPElement_h
Generated on a sunny day for yast2-core by
1.8.2