0

I have a superclass NetworkTest and 3 derived classes PingTest, Pop3Test, SMTPTest. I want to create a big list of all the tests, like this:

Dim Tests As New List(Of NetworkTest)

        Dim PingTests As List(Of PingTest) = ReadPingTestsFromFile(PingFile)
        Tests.AddRange(PingTests)

        Dim Pop3TestResults As List(Of Pop3Test) = ReadPOP3TestsFromFile(POP3File)
        Tests.AddRange(Pop3TestResults)

        Dim SMPTTests As List(Of SMTPTest) = ReadSMTPTestsFromFile(SMTPFile)
        Tests.AddRange(SMPTTests)

In c++ you can make a vector of pointers of type NetworkTest and then it will let you use all of the function defined for the particular type of subclass that is in a position in the vector. Is there a similar concept in vb.net?

Thanks,

Dave

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by daviddoria
0

hm I don't see how inheritance shows me how to make a List(of abstractClass) and fill it with DerivedClass and then use DerivedClass operatons?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.