Bug 48 - Create function and parameters that are from virtual classes
Create function and parameters that are from virtual classes
Status: RESOLVED INVALID
Product: ns-3
Classification: Unclassified
Component: core
pre-release
PC Linux
: P3 major
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-13 11:52 EDT by Emmanuelle Laprise
Modified: 2008-06-05 12:44 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuelle Laprise 2007-07-13 11:52:32 EDT
Is it normal that the Create function works only if ontime and offtime are not from a class that has virtual functions? That is, if I define them as ConstantVariable, then it compiles, but if I define than as RandomVariable (virtual base class) and pass in a ConstantVariable (derived class), then it won't compile telling me that the RandomVariable class has some pure virtual functions.

FunctionXX(const  RandomVariable& ontime, const  RandomVariable& offtime)
{
  m_onOffGenerator = Create<OnOffGenerator> (ontime, offtime);
}

Thanks,

Emmanuelle
Comment 1 Mathieu Lacage 2007-07-14 11:42:54 EDT
(In reply to comment #0)
> Is it normal that the Create function works only if ontime and offtime are not
> from a class that has virtual functions? That is, if I define them as
> ConstantVariable, then it compiles, but if I define than as RandomVariable
> (virtual base class) and pass in a ConstantVariable (derived class), then it
> won't compile telling me that the RandomVariable class has some pure virtual
> functions.
> 
> FunctionXX(const  RandomVariable& ontime, const  RandomVariable& offtime)
> {
>   m_onOffGenerator = Create<OnOffGenerator> (ontime, offtime);
> }

Could you provide a reduced test case without OnOffGenerator ?

Comment 2 Tom Henderson 2008-06-05 10:57:13 EDT
mark as INVALID?  (no test case provided)
Comment 3 Mathieu Lacage 2008-06-05 12:44:18 EDT
ok.