[VSDK] kFBL_AssertionNULL exception

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Nov 26 10:32:33 CST 2003


on 11/26/03 6:51 AM, Eric Forget at forgete at cafederic.com wrote:

Hi Eric,

> I've lost a few hours to figure out why Valentina was throwing
> kFBL_AssertionNULL.
> 
> 1) kFBL_AssertionNULL is completely meaningless to the user (of the API).
> You should try to figure better name of the exception (at least for v2).

Yes, in 2.0 this removed.

Usually this means some very bad internal error


 
> 2) The problem was caused because I wrote something like this:
> 
>   mTable.mField1 = mTable.Field2;
> 
> Both were VDK_String. You have not overloaded the operator= (const
> VDK_String &), so it was a copy, byte by byte, that was happening. Since you
> are making an API, not just some classes for you, you should either:


> a) Declare the operator as private to prohibit its usage

        you mean 

      private:
            operator= ( VDK_Field& inField )



> b) Implement it inline, which should be fairly easy:
> 
> FBL_EXP virtual void               operator= ( const VDK_String & inValue )
>                                   {
>                                       *this = (const char *)inValue;
>                                   }
> 
> And that for each of the fields.

Well, in 2.0 this can be more easier

    I_Field_Imp::operator=( I_Field_Ptr inField )
    {
        mValue->Assign( inField->get_Value() );
    }

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list