convert enum P_TYPE into enum class