forked from Nayan-Kute21/CDN-Optimization
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCDN_Node.hpp
More file actions
29 lines (22 loc) · 764 Bytes
/
CDN_Node.hpp
File metadata and controls
29 lines (22 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef CDNNODE_H
#define CDNNODE_H
#include <string>
#include "SkipList.hpp"
class CDNNode {
private:
double x, y; // Coordinates of the CDN node
SkipList popularMovies;
public:
// Constructor
CDNNode(double x, double y, int skipListMaxLevel = 4, float skipListProbability = 0.5f);
// Getters
double getX() const;
double getY() const;
// Movie management
void storePopularMovie(Movie* movie); // Stores a popular movie in the CDNNode
Movie* fetchMovie(const std::string& movieName); // Fetches a movie if it's popular
std::vector<std::string> get_movie_names ();
bool isFull(); // returns boolean about skip List is full or not
void remove_mov(const std::string& moviename);
};
#endif // CDNNODE_H