This project is an Object-Oriented Programming application written in C++ that simulates the management system of a tourism agency.
It demonstrates advanced OOP concepts such as inheritance, polymorphism, operator overloading, templates, exception handling, STL containers and design patterns.
The application models the main components of a tourism agency system including:
- clients
- tourist packages
- hotels
- transport services
- accommodation services
- travel destinations
- premium travel destinations
- tourism agency management
The system allows adding, displaying, sorting and managing travel destinations and tourism services using an interactive console menu.
The project demonstrates multiple OOP principles:
All classes use private attributes and provide getters and setters for controlled access.
Multiple inheritance hierarchies are implemented:
Destinatie
↓
DestinatieTuristica
↓
DestinatiePremium
Another hierarchy implements diamond inheritance:
IServiciuTuristic
/ \
Transport Cazare
\ /
PachetTuristic
Virtual methods allow dynamic dispatch when working with base class pointers.
Example:
virtual void afiseazaDetalii() const = 0;Several operators are overloaded, including:
<<and>>for input/output streams+,-,*for modifying prices++and--==,!=,<[]for indexed access
Each class implements:
- default constructors
- parameterized constructors
- copy constructors
- destructors
- assignment operators
The project also includes more advanced C++ programming concepts.
A generic repository class is implemented using templates:
template<typename T>
class Repository
{
private:
vector<T> items;
};Template functions are also used for:
- sorting collections
- finding maximum elements
Custom exception classes are implemented:
TourismExceptionInvalidDataExceptionFileExceptionNotFoundException
Example:
class InvalidDataException : public TourismException
{
public:
InvalidDataException(const string& msg)
: TourismException("Date invalide: " + msg) {}
};The project uses multiple STL containers:
vectorsetlistmap
Example:
vector<shared_ptr<Destinatie>> destinatii;
set<string> tari;
list<string> rezervari;
map<string, int> statisticiTari;These containers are used for storing destinations, reservations and country statistics.
The Singleton pattern is implemented for the tourism agency management class.
class AgentieTurism
{
private:
static AgentieTurism* instance;
};This ensures that only one instance of the tourism agency exists in the program.
- C++
- Object-Oriented Programming
- STL Containers
- Templates
- Exception Handling
- Smart Pointers
- Design Patterns (Singleton)