#pragma once #include "q3common.h" #include #include "BargingCheckBridge.h" using namespace std; #if defined( MC ) // Mutex/Cond Soln class Bridge { // YOU ADD DECLARATIONS AND MEMBERS #elif defined( SEM ) // Semaphore Soln #include class Bridge { // YOU ADD DECLARATIONS AND MEMBERS #else #error unsupported bridge type #endif BCHECK_DECL; void startNorth( unsigned int id ); void startSouth( unsigned int id ); void endNorth( unsigned int id ); void endSouth( unsigned int id ); // YOU ADD COMMON PRIVATE DECLARATIONS AND MEMBERS public: // common interface enum Direction { NORTH = 'N', SOUTH = 'S' }; void cross( unsigned int id, Direction dir ) { // YOU WRITE THIS CODE } // cross }; // Bridge // Local Variables: // // tab-width: 4 // // mode: c++ // // compile-command: "make bridge BIMPL=EXT" // // End: //