I have a generic class
public class Decoder<SIGNAL> where SIGNAL : signalType, new()
signalType is a abstract class. How do I declare a dynamic field to store it? The following code will throw a compile error saying that Decoder must be a non abstract type generic.
public class DecoderParent
{
private Decoder<signalType> decoder;
public DecoderParent(keys key)
{
switch(key)
{
case keys.SignalOne:
{
decoder = new Decoder<signalONE>();
break;
}
case keys.signalTwo:
{
decoder = new Decoder<signalTWO>();
}
}
}
}