{"id":28414584,"url":"https://github.com/aminezouitine/volumelist-cpp","last_synced_at":"2026-03-02T17:36:35.046Z","repository":{"id":134044158,"uuid":"474502684","full_name":"AmineZouitine/VolumeList-Cpp","owner":"AmineZouitine","description":"🗄Make a list that has a notion of volume 🗄","archived":false,"fork":false,"pushed_at":"2022-04-06T03:05:41.000Z","size":8099,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-25T06:42:44.267Z","etag":null,"topics":["cpp","data-structures"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AmineZouitine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-27T00:59:20.000Z","updated_at":"2023-01-21T01:49:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a0460ba-491a-4e25-80af-f64b3f0e413e","html_url":"https://github.com/AmineZouitine/VolumeList-Cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AmineZouitine/VolumeList-Cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmineZouitine%2FVolumeList-Cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmineZouitine%2FVolumeList-Cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmineZouitine%2FVolumeList-Cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmineZouitine%2FVolumeList-Cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmineZouitine","download_url":"https://codeload.github.com/AmineZouitine/VolumeList-Cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmineZouitine%2FVolumeList-Cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30012001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T17:00:27.440Z","status":"ssl_error","status_checked_at":"2026-03-02T17:00:03.402Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","data-structures"],"created_at":"2025-06-03T08:16:03.050Z","updated_at":"2026-03-02T17:36:35.029Z","avatar_url":"https://github.com/AmineZouitine.png","language":"C++","readme":"# 🗄 VolumeList-Cpp 🗄\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/53370597/160875178-bfe364e0-2aa9-42e6-950d-c69c6b6ddc5f.png\"\u003e\n\u003c/p\u003e\n\n## What this is ?\nThis project allows to add a notion of **volume** in contiguous containers in memory. \nAn interesting example of use would be a timetable application.\n\n\n## Usage 📜\n\n### Essential methods ⭐\n```cc\nVolumeList(size_t max_volume, bool is_dynamic_size = false); // Constructor\nvoid append(T\u0026 element, size_t volume);\nvoid insert(T\u0026 element, size_t min_position, size_t volume);\nvoid remove(size_t index);\n```\n\n### Creation\n\u003cp\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/53370597/160877316-bbba1936-3a2e-4535-99af-57e182ce8208.png\"\u003e\n\u003c/p\u003e\n\nCreation of a **VolumeList** of type string, with a maximum volume of **100** units and a **non dynamics size**.\n\n```cc\nauto volume_list = VolumeList\u003cstd::string\u003e{100};  // type can be anything.\n```\n\n### Append\n\u003cp\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/53370597/160879926-d8811b5e-80dd-48e2-8a82-02754987667e.png\"\u003e\n\u003c/p\u003e\n\nThe **append** method takes the **element** to be added at the **end** of the list and its **volume**.\nHere we add a string with a volume of **10** to our list and a string with a volume of **20**.\n\n**Exemple**\n```cc\nauto elem1 = std::string(\"Hi there!\");\nauto elem2 = std::string(\"I hope you enjoy it\");\nvolume_list.append(elem1, 10);\nvolume_list.append(elem2, 20);\n```\n\n**List status** *(std::cout \u003c\u003c volume_list)*:\n\n```\n-------[0]-------\nElement: Hi there!\nPosition: [0, 9]\nVolume: 10\n-------[1]-------\nElement: I hope you enjoy it\nPosition: [9, 29]\nVolume: 20\n```\n\n### Insert\n![Webp net-gifmaker](https://user-images.githubusercontent.com/53370597/160888183-ae9e7842-086b-43d1-9a8c-6906d3d13a54.gif)\n\nThe **insert** method takes the **element** to insert, its **volume**, and the place where it **starts** in the volume list.\nIf there is already an element at this position, it is **shifted**.\n\n**Exemple**\n```cc\nauto elem1 = std::string(\"First\");\nauto elem2 = std::string(\"Second\");\nauto elem3 = std::string(\"Third\");\nauto elem4 = std::string(\"Fourth\");\n\nvolune_list.insert(elem1, 0, 10);\nvolume_list.insert(elem2, 2, 7);\nvolume_list.insert(elem3, 2, 9);\nvolune_list.insert(elem4, 0, 5);\n```\n\n**List status** *(std::cout \u003c\u003c volume_list)*:\n```\n-------[0]-------\nElement: Fourth\nPosition: [0, 4]\nVolume: 5\n-------[1]-------\nElement: Third\nPosition: [4, 13]\nVolume: 9\n-------[2]-------\nElement: Second\nPosition: [13, 20]\nVolume: 7\n-------[3]-------\nElement: First\nPosition: [20, 30]\nVolume: 10\n```\n\n### Remove\n![Webp net-gifmaker (1)](https://user-images.githubusercontent.com/53370597/160889767-08bfc2a5-6bf2-440b-975c-d0b7ae9cc85d.gif)\n\nThe **remove** function allows to remove an element from the list with its **index**, **it works like a classic remove**.\n\n***Exemple***\n```cc\nauto elem1 = std::string(\"Bye you :c\");\nauto elem2 = std::string(\"Hi there !\");\n    \nvolume_list.append(elem1, 10);\nvolune_list.append(elem2, 10);\n\nvolume_list.remove(0);\n```\n\n**List status** *(std::cout \u003c\u003c volume_list)*:\n```\n-------[0]-------\nElement: Hi there !\nPosition: [9, 19]\nVolume: 10\n```\n\n### Methods that may be useful to you 🌟\n\n```cc\nT\u0026 operator[](size_t index);\nVolumeWrapper\u003cT\u003e\u0026 get_volume_at(size_t index);\n\nsize_t get_max_volume() const;\nsize_t get_current_volume() const;\nsize_t get_element_number() const;\nsize_t get_remaining_volume() const;\nbool get_is_dynamic_size() const;\n\nstd::vector\u003cVolumeWrapper\u003cT\u003e\u003e::const_iterator begin() const;\nstd::vector\u003cVolumeWrapper\u003cT\u003e\u003e::iterator begin();\nstd::vector\u003cVolumeWrapper\u003cT\u003e\u003e::const_iterator end() const;\nstd::vector\u003cVolumeWrapper\u003cT\u003e\u003e::iterator end();\n```\n## Essential Methods -- VolumeWrapper ⭐\n\n```cc\nVolumeWrapper(std::shared_ptr\u003cT\u003e element, size_t min_position, size_t volume);\nT\u0026 get_element() const;\nsize_t get_min_position() const;\nsize_t get_max_position() const;\nsize_t get_volume() const;\n```\n\n## Code documentation -- WORK IN PROGRESS 👨‍💻\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminezouitine%2Fvolumelist-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminezouitine%2Fvolumelist-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminezouitine%2Fvolumelist-cpp/lists"}