75 cout <<
"[create-" << name <<
"]\n";
78 ~HandleableThing(
void)
79 { cout <<
"[destroy-" << p_name <<
"]\n"; }
83 friend ostream&
operator << (ostream &st,
const HandleableThing &t);
85 HandleableThing *object_ptr() {
return this; }
86 const HandleableThing *object_ptr()
const {
return this; }
91 return st <<
"<<" << (
const char *)t.name() <<
"/" << t.refcount() <<
">>";
108 cout <<
"[create-" << name <<
"]\n";
112 { cout <<
"[destroy-" << p_name <<
"]\n"; }
114 EST_String name(
void)
const {
return p_name; }
116 friend ostream& operator << (ostream &st, const EST_TBox<Thing> &t);
117 friend ostream&
operator << (ostream &st,
const Thing &t);
119 Thing *object_ptr() {
return this; }
120 const Thing *object_ptr()
const {
return this; }
123 ostream &operator << (ostream &st, const EST_TBox<Thing> &t)
125 return st <<
"<<[[" << t.c()->name() <<
"/" << t.refcount() <<
"]]>>";
130 return st <<
"{" << t.name() <<
"}";
138 cout <<
"\n\nUnboxed Examples\n";
142 pa =
new HandleableThing(
"apple");
143 pb =
new HandleableThing(
"banana");
168 pa =
new HandleableThing(
"pie");
173 pb =
new HandleableThing(
"split");
174 pc =
new HandleableThing(
"cheesecake");
184 cout <<
"\n\nBoxed Examples\n";
235 #ifdef INSTANTIATE_TEMPLATES
Reference Counting Interface.
EST_THandle< HandleableThing, HandleableThing > HandleableThingP
EST_TBox< Thing > BoxedThing
ostream & operator<<(ostream &st, const HandleableThing &t)
EST_THandle< BoxedThing, Thing > BoxedThingP