[Clam-devel] Error Handling with Types

Francisco Tufró nictuku at gmail.com
Wed May 21 08:19:23 PDT 2008


Great, is done.
A question:
what about the callback interface for cascading events?
should we add that feature now or later??
Well, what's next?
Francisco

On Wed, May 21, 2008 at 5:19 AM, Pau Arumí <parumi at iua.upf.edu> wrote:

> On dt, 2008-05-20 at 20:02 -0300, Francisco Tufró wrote:
> > Hi, i have almost finished the Link test.
> > I have this question:
> > How do i (or what do i do to) handle errors with these functions, in
> > the first what should i do? make the function bool and return true if
> > it was connected?? or throw something with a special error class that
> > i ignore?
>
> Let's take the restrictive and easier path: just assert in the error
> case. Like we do in Ports. I say it's easier because we avoid dealing
> with exception handling.
> OutPort.hxx line 175
>

> And (doxygen) document this behavior, and explaining that before calling
> Link the user must check the likability with IsLinkable
>
> See ports unit tests for an example of how to test that an assert is
> triggered.
>

> Pau
>
>
>
> >
> >        void BaseTypedOutControl::Link(BaseTypedInControl& in)
> >        {
> >                if(IsLinkable(in)){
> >                        DoTypedLink(in);
> >                }
> >                /* Throw error with else! ? */
> >        }
> >
> > and:
> >
> >     template<class TypedControlData>
> >     void
> > TypedOutControl<TypedControlData>::DoTypedLink(BaseTypedInControl& in)
> >     {
> >         AddLink(dynamic_cast< ProperTypedInControl& >(in));
> >     }
> >
> > by the way i send the patch so you have the full code.
> > bye!
> > Francisco
> >
> > _______________________________________________
> > Clam-devel mailing list
> > Clam-devel at llistes.projectes.lafarga.org
> >
> https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel
>
>
> _______________________________________________
> Clam-devel mailing list
> Clam-devel at llistes.projectes.lafarga.org
> https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080521/ef03a737/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typed_controls_v7_AbstractClasses.patch
Type: application/octet-stream
Size: 4806 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080521/ef03a737/attachment-0003.obj>


More information about the clam-devel mailing list