Re: What is the replacement of bonobo_persist_stream_new ?



Hi Paolo,

On Tue, 2002-03-26 at 08:28, Paolo Bacchilega wrote:
> bonobo_persist_stream_new is tagged as deprecated, what is the new way
> of adding a Bonobo::PersistStream interface to an object ?

	The 'right' way to do it in Bonobo 2.0 is to simply inherit from the
BonoboPersist object - ie. copy the libbonobo/samples/echo/echo.[ch] but
instead sub-class BonoboPersist, and switch Sample_Echo ->
Persist_Stream.

	Then in the class_init method you need to override the:

   typedef struct
   {
      void *_private;
      void (*load) (PortableServer_Servant _servant,
		    const Bonobo_Stream stream, const CORBA_char * type,
		    CORBA_Environment * ev);
      void (*save) (PortableServer_Servant _servant,
		    const Bonobo_Stream stream, const CORBA_char * type,
		    CORBA_Environment * ev);
   }
   POA_Bonobo_PersistStream__epv;

	Methods.

	ie. the wrapper is just totally obsoleted by BonoboObject - so there is
no point in it, and it just encourages somewhat acute ugliness - IMHO
;-)

	Let me know how you get on - quite possibly we need some sample code
for this.

	Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]