C++ project to track trasport system of factory. This document lists important design aspects of project.
- Location class
- Factory class
- Branch class
- Warehouse class
- Vehicle class
- Truck class
- Container class
- Item class
The location class provides location to objects. The location MUST be a member of City enum. This class provides simple getter and setter methods for location. The location MUST be specified for Factory, Branch and Vehicle class.
-
Locationclass provides method to calculate distance between two objects. -
Locationclass also provides estimated time to travel between places.class Location{ public: inline City getLocation(){ return current_location; }; int getDistance(const Location &dest); protected: City current_location; };
TODO ::
Add support for GPS location
Add support for google maps
The factory class holds information about the company. Basic factory information such as name, registered address will be stored here (and can't be changed once set). All the assets ( including Branches and Vehicles are owned by Factory.)
-
One
Factoryhas manyBranches. -
One
Factoryhas manyVehiclees. -
One
Factoryhas oneLocation.class Factory : public Location{ public: Factory(const string name, City location); bool addVehicle(Vehicle vehicle); inline Vehicle getVehicle (const int vehicle_number){ // Give the vehicle of number 'vehicle_number' to the requester. return vehicles[vehicle_number]; }; inline string getCompanyName(){ // The business name once set during initialization can't be changed. // Give the name of this business to requester. return businessName; }; string getDetails(); protected: static map<string, Vehicle> vehicles; private: string businessName; };
The Branch class holds information about branch and warehouses. Branch is a kind of Factory. Branch can add/remove vehicles on behalf of a Factory. Although branch can add/remove Vehicle, The records of vehicles owned by Factory will be kept at Factory.
- A
Branchcan load/unloadVehicles. - A
Branchmaintains records of items inWarehouse. - A
BranchinstructsVehicleto carry goods fromWarehouseto anotherBranch. - One
Branchhas manyWarehouses.
This class holds all the Items, that this Factory owns. Warehouses are controlled by the respective Branches. Warehouse stores basic name/address information with it.
TODO:: Add notification system for alerts and information.
