How do you load various sensor code onto 1 .cpp file

I have various sensor, DHT-22,MQ-7 gas sensor , anenometer,wind vane and I would like to consolidate it onto 1 program file on Mbed studio I am currently running each sensor separately but now i wish to combine it how do i do this please assist with example too , thanks