c l a s s S t o r a b l e {
p u b l i c :
v i r t u a l c o n s t c h a r * g e t _ f i l e () = 0 ;
v i r t u a l v o i d r e a d () = 0 ;
v i r t u a l v o i d w r i t e () = 0 ;
v i r t u a l ~S t o r a b l e () {w r i t e (); } // to be called from overriding destructors
};
c l a s s T r a n s m i t t e r : p u b l i c S t o r a b l e {
p u b l i c :
v o i d w r i t e ();
/ / ...
};
c l a s s R e c e i v e r : p u b l i c S t o r a b l e {
p u b l i c :
v o i d w r i t e ();
/ / ...
};
c l a s s R a d i o : p u b l i c T r a n s m i t t e r , p u b l i c R e c e i v e r {
p u b l i c :
c o n s t c h a r * g e t _ f i l e ();
v o i d r e a d ();
v o i d w r i t e ();
/ / ...
};
does write() act as a virtual function for radio fn too ???