{"id":20982691,"url":"https://github.com/johannes/jsring","last_synced_at":"2025-12-28T10:58:23.151Z","repository":{"id":66765030,"uuid":"127580055","full_name":"johannes/jsring","owner":"johannes","description":"A toy ring buffer in C++14","archived":false,"fork":false,"pushed_at":"2018-05-05T01:36:01.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T06:46:53.362Z","etag":null,"topics":["cpp14","ring-buffer","toy-project"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johannes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2018-03-31T23:40:57.000Z","updated_at":"2018-05-05T01:36:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"efbcf67f-cc13-4e46-9f87-76352ab2001b","html_url":"https://github.com/johannes/jsring","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannes%2Fjsring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannes%2Fjsring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannes%2Fjsring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johannes%2Fjsring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johannes","download_url":"https://codeload.github.com/johannes/jsring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243385114,"owners_count":20282504,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp14","ring-buffer","toy-project"],"created_at":"2024-11-19T05:46:22.271Z","updated_at":"2025-12-28T10:58:23.095Z","avatar_url":"https://github.com/johannes.png","language":"C++","readme":"jsring - A toy ring buffer\n==========================\n\n[![Build Status](https://travis-ci.org/johannes/jsring.svg?branch=master)](https://travis-ci.org/johannes/jsring)\n\nThis is a simple implementation of a ring buffer with a compile-time defined size. This is an saturday afternoon hack and not supposed to be used in production and maybe wll never be touched again. There certainly are more robust/efficient/... implementations.\n\nUsage\n-----\n\n```c++\n#include \u003cjsring.h\u003e\n#include \u003ciostream\u003e\n\njsring::ring\u003cint, 10\u003e ring{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};\nring.push_back(11);\nring.push_back(12);\nring.push_front(0);\n\nfor (auto i : ring) {\n  std::cout \u003c\u003c i \u003c\u003c \" \";\n}\nstd::cout \u003c\u003c '\\n';\n```\n\nThis will print\n\n    0 3 4 5 6 7 8 9 10 11\n\nSee the [tests](test/main.cpp) for more examples.\n\nInstallation\n------------\n\nAll code is included in `include/jsring.h`. Also a `CMakeLists.txt` is provided which allows installation using CMake. After installing other projects can add a dependency via\n\nAssuming you have cmake and a C++14 compiler you could install it like this:\n```sh\ngit clone git@github.com:johannes/jsring.git\ncd jsring\ncmake .\nmake install\n```\n\nIn a different project you can include it from your `CMakeLists.txt` like this:\n\n```cmake\nfind_package(jsring CONFIG REQUIRED)\ntarget_link_libraries(YourApp jsring)\n```\n\nTests are using GTest. CMake will load this dependency when needed. For testing you can use either `ctest` or run the more vebose test binary `testjsring` after running `make`.\n\nLicense\n-------\n\nThis library is licensed under the terms of the MIT License.\n\n\u003e Copyright 2018 Johannes Schlüter\n\u003e \n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\u003e\n\u003e The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\u003e\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohannes%2Fjsring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohannes%2Fjsring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohannes%2Fjsring/lists"}