46 #include "EST_Handleable.h"
47 #include "EST_THandle.h"
49 #include "EST_String.h"
72 cout <<
"[create-" << name <<
"]\n";
75 ~HandleableThing(
void)
76 { cout <<
"[destroy-" << p_name <<
"]\n"; }
80 friend ostream& operator << (ostream &st,
const HandleableThing &t);
82 HandleableThing *object_ptr() {
return this; }
83 const HandleableThing *object_ptr()
const {
return this; }
86 ostream &operator << (ostream &st,
const HandleableThing &t)
88 return st <<
"<<" << (
const char *)t.name() <<
"/" << t.refcount() <<
">>";
105 cout <<
"[create-" << name <<
"]\n";
109 { cout <<
"[destroy-" << p_name <<
"]\n"; }
111 EST_String name(
void)
const {
return p_name; }
113 friend ostream& operator << (ostream &st, const EST_TBox<Thing> &t);
114 friend ostream& operator << (ostream &st,
const Thing &t);
116 Thing *object_ptr() {
return this; }
117 const Thing *object_ptr()
const {
return this; }
120 ostream &operator << (ostream &st, const EST_TBox<Thing> &t)
122 return st <<
"<<[[" << t.c()->name() <<
"/" << t.refcount() <<
"]]>>";
125 ostream &operator << (ostream &st,
const Thing &t)
127 return st <<
"{" << t.name() <<
"}";
135 cout <<
"\n\nUnboxed Examples\n";
139 pa =
new HandleableThing(
"apple");
140 pb =
new HandleableThing(
"banana");
141 HandleableThingP pc =
new HandleableThing(
"cherry");
165 pa =
new HandleableThing(
"pie");
170 pb =
new HandleableThing(
"split");
171 pc =
new HandleableThing(
"cheesecake");
181 cout <<
"\n\nBoxed Examples\n";
185 pa =
new BoxedThing(
new Thing(
"aubergene"));
186 pb =
new BoxedThing(
new Thing(
"brocoli"));
187 BoxedThingP pc =
new BoxedThing(
new Thing(
"cauliflower"));
211 pa =
new BoxedThing(
new Thing(
"pate"));
216 pb =
new BoxedThing(
new Thing(
"quiche"));
217 pc =
new BoxedThing(
new Thing(
"cheese"));
232 #ifdef INSTANTIATE_TEMPLATES