Problem getting a layer in the network

when a network has been defined, I can use network->getLayer(3) which return type is ILayer to get a specific layer. If the layer is a Activation layer, how can I get the activationtype of the layer?
thanks in advance for any help.

sample code:
layer = network->getLayer(3);
std::cout << layer->getName() << static_cast(layer->getType())<< std::endl;

nvinfer1::ILayer *layer0 = network->getLayer(3);
nvinfer1::IActivationLayer layer1 = (nvinfer1::IActivationLayer)layer0;
std::cout << static_cast(layer1->getActivationType()) << std::endl;