{"id":25243042,"url":"https://github.com/0x0c/value_bag","last_synced_at":"2025-10-08T12:33:58.630Z","repository":{"id":142906784,"uuid":"178709792","full_name":"0x0c/value_bag","owner":"0x0c","description":"Put a value into the bag and take it functionally.","archived":false,"fork":false,"pushed_at":"2019-04-02T09:41:50.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-23T18:55:27.437Z","etag":null,"topics":["cpp"],"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/0x0c.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":"2019-03-31T15:57:20.000Z","updated_at":"2019-04-02T09:41:52.000Z","dependencies_parsed_at":"2023-04-22T04:13:04.743Z","dependency_job_id":null,"html_url":"https://github.com/0x0c/value_bag","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0x0c/value_bag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2Fvalue_bag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2Fvalue_bag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2Fvalue_bag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2Fvalue_bag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0x0c","download_url":"https://codeload.github.com/0x0c/value_bag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x0c%2Fvalue_bag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278945827,"owners_count":26073616,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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"],"created_at":"2025-02-12T00:45:16.891Z","updated_at":"2025-10-08T12:33:58.620Z","avatar_url":"https://github.com/0x0c.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# value_bag\n\nPut a value into the bag and take it functionally.\n\n## Usage\n\nSee `main.cpp`.\n\nA result of the sample code is as follows:\n\n```\ndefault peek : 100\ndefault take : 100\ndefault take : 0\ndefault set : 200\ndefault take : 200\ndefault take : 0\n----\ntoggle : value1 = 100, value2 = 200\ntoggle peek : 100\ntoggle take : 100\ntoggle take : 200\ntoggle take : 100\ntoggle : the value becomes 00.\ntoggle take : 100\n----\nonce peek : 100\nonce take : 100\nonce take : 0\nonce set : 200\nonce take : 0\n----\n```\n\nHere is an example for Arduino to prevent chattering of a switch.\n\n```\nauto d = m2d::default_value_bag\u003cint\u003e(LOW, LOW);\n...\n\nint pin = digitalRead(10);\nif (pin != d.peek() \u0026\u0026 pin == HIGH) {\n\td.set(pin);\n}\n...\n\nif (d.take() == HIGH) {\n// Do something, called once after pin 10 becomes HIGH.\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x0c%2Fvalue_bag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0x0c%2Fvalue_bag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x0c%2Fvalue_bag/lists"}