Bug 48

Summary: Create function and parameters that are from virtual classes
Product: ns-3 Reporter: Emmanuelle Laprise <emmanuelle.laprise>
Component: coreAssignee: ns-bugs <ns-bugs>
Status: RESOLVED INVALID    
Severity: major    
Priority: P3    
Version: pre-release   
Hardware: PC   
OS: Linux   

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.