Re: [Crystal-cvs] SF.net SVN: crystal:[38126] CS/branches/soc2012/editor
Mat Sutcliffe <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.devel |
|---|---|
| Message-ID | <CACE5BzJEHuLW3UNYetxrh_qu-ytUOi_gyJXfbbE3y8BF1YTX8g@mail.gmail.com> |
To clarify, I understand this to mean: csBasicModifiableDescription should not store an array of parameters as a data member. Instead, csBasicModifiableDescription::GetParameter and ::GetParameterByIndex should return newly constructed parameters. csTestModifiable should not store a description as a data member. Instead, csTestModifiable::GetDescription should return a newly constructed description. Please correct me if I've misunderstood, Chrisitian. Also Andrei, I notice you have some concrete classes called iModifiableString and iModifiableLong. Only abstract classes should begin with the "i" prefix. Hope this helps. :) I haven't been paying much attention to this stuff, but Christian's post about csPtr piqued my interest. On 5 June 2012 15:32, Christian Van Brussel < [email protected]> wrote: > Hi Andrei, > > Unfortunately, all the changes you made in modifiable.h around the > conversion from a csPtr to a csRef for the returned value where not > desired. > > The goal of using a csPtr was that the object was allocated only if > necessary. The ownership of the object is also transfered through the > caller of the methods, and that caller should deallocate the objects > once he doesn't need them anymore. > > You can find more information about CS's smart pointers at > http://www.crystalspace3d.org/docs/online/manual/Smart-Pointers.html > > > > On Mon, 2012-06-04 at 18:27 +0000, [email protected] > wrote: > > Modified: CS/branches/soc2012/editor/include/iutil/modifiable.h > > =================================================================== > > --- CS/branches/soc2012/editor/include/iutil/modifiable.h 2012-06-04 > 13:24:53 UTC (rev 38125) > > +++ CS/branches/soc2012/editor/include/iutil/modifiable.h 2012-06-04 > 18:27:11 UTC (rev 38126) > > @@ -71,13 +71,13 @@ > > * Returns char* entry for the parameter's name > > * to be processed by the translator. > > */ > > - virtual char* GetName () const = 0; > > + virtual const char* GetName () const = 0; > > > > /** > > * Returns char* entry for the parameter's textual description > > * to be processed by the translator. > > */ > > - virtual char* GetDescription () const = 0; > > + virtual const char* GetDescription () const = 0; > > > > /** > > * Returns the type of this parameter > */ > > @@ -107,8 +107,10 @@ > > > > virtual size_t GetParameterCount () const = 0; > > > > - virtual csPtr<iModifiableParameter> GetParameter (csStringID id) > const = 0; > > - virtual csPtr<iModifiableParameter> GetParameterByIndex (size_t > index) const = 0; > > + virtual csRef<iModifiableParameter> GetParameter (csStringID id) > const = 0; > > + virtual csRef<iModifiableParameter> GetParameterByIndex (size_t > index) const = 0; > > + > > + virtual void Push(iModifiableParameter* param) = 0; > > }; > > > > > > @@ -119,7 +121,7 @@ > > SCF_INTERFACE(iModifiable, 1, 0 ,0); > > > > virtual const csStringID GetID () const = 0; > > - virtual csPtr<iModifiableDescription> GetDescription () const = 0; > > + virtual csRef<iModifiableDescription> GetDescription () const = 0; > > > > virtual void GetParameterValue (csStringID id, const csVariant& > value) const = 0; > > virtual bool SetParameterValue (csStringID id, const csVariant& > value) = 0; > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Crystal-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crystal-develop > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Crystal-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-develop