[Click] Problem with structure

Cliff Frey cliff at meraki.com
Wed Feb 10 12:24:00 EST 2010


The problem is that you defined a constructor method, but didn't give it a
body.

inline
VlanTables::PortInfo::PortInfo(bool _trunk,bool _active,VLANPORT_Table
_vlan)
   :trunk(_trunk),active(_active),vlan(_vlan) *{ /* must have empty body
here */ }*


In general though, you should probably practice writing c++ or using generic
c++ tutorials.

Cliff


On Wed, Feb 10, 2010 at 8:54 AM, David Sesmero Sáez <
deivid_sesme at hotmail.com> wrote:

>
>
> Hi!
>
> I'm trying to make one structure like this:
>
> typedef HashMap<int,int> VLANPORT_Table;
>
> struct PortInfo {
>        bool trunk;
>        bool active;
>        VLANPORT_Table vlan;
>        inline PortInfo(bool _trunk,bool _active,VLANPORT_Table _vlan);
>    };
>
>    Vector<PortInfo> ports;
>
> inline
> VlanTables::PortInfo::PortInfo(bool _trunk,bool _active,VLANPORT_Table
> _vlan)
>    :trunk(_trunk),active(_active),vlan(_vlan)
>
> But when I compile, I have this error:
>
> In file included from ../elements/local/VlanEncap.cc:24:
> ../include/click/confparse.hh: In constructor
> ‘VlanTables::PortInfo::PortInfo(bool, bool, HashMap<int, int>)’:
> ../include/click/confparse.hh:7: error: expected `{' before ‘struct’
>
> Someone knows where is the problem?
>
>
> ** Sorry for making a lot of questions but I'm doing one project for my
> university and I just started programing with click router.. (And a lot of
> thanks for your responses)
>
>
> Regards, David.
>
>
>
> _________________________________________________________________
> ¿Aún no sabes qué móvil eres? ¡Descúbrelo aquí!
> http://www.quemovileres.com/
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>


More information about the click mailing list