{"id":20944621,"url":"https://github.com/braintwister/record","last_synced_at":"2025-08-08T05:06:20.828Z","repository":{"id":81000728,"uuid":"131901882","full_name":"BrainTwister/record","owner":"BrainTwister","description":"A heterogeneous data structure for C++","archived":false,"fork":false,"pushed_at":"2023-01-26T15:00:43.000Z","size":76,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-13T04:16:59.021Z","etag":null,"topics":["cpp","data-structures","heterogeneous","polymorphism"],"latest_commit_sha":null,"homepage":"https://braintwister.eu/posts/record.html","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/BrainTwister.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-05-02T20:21:12.000Z","updated_at":"2023-01-25T21:58:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea1d9360-d124-4f55-b48e-5ce86b995bd3","html_url":"https://github.com/BrainTwister/record","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/BrainTwister/record","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Frecord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Frecord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Frecord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Frecord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrainTwister","download_url":"https://codeload.github.com/BrainTwister/record/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainTwister%2Frecord/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269366853,"owners_count":24405250,"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-08-08T02:00:09.200Z","response_time":72,"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","data-structures","heterogeneous","polymorphism"],"created_at":"2024-11-18T23:44:32.058Z","updated_at":"2025-08-08T05:06:20.807Z","avatar_url":"https://github.com/BrainTwister.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/BrainTwister/record/actions/workflows/cmake.yml/badge.svg)](https://github.com/BrainTwister/record/actions/workflows/cmake.yml)\n\nBrainTwister record\n===================\n\nA heterogeneous data structure for C++\n\nCopyright (C) 2018 Bernd Doser, \u003cbernd.doser@braintwister.eu\u003e\n\nAll rights reserved.\n\nBrainTwister record is free software made available under the\n[MIT License](http://opensource.org/licenses/MIT). For details see [LICENSE](LICENSE.md).\n\nconan.io\n--------\n\nC++ conan.io package is available at https://bintray.com/braintwister/conan\n\n\nDescription\n-----------\n\nBrainTwister record is a linear, direct-accessible, heterogeneous\ndata structure, which is defined by\n\n```\nBRAINTWISTER_RECORD( record_name, \\\n  (( entry_type, entry_name, entry_default_value )) \\\n     ... \\\n)\n```\n\nFor instance, a database connection can be defined as\n\n```\nBRAINTWISTER_RECORD( Database, \\\n  (( uint16_t, port, 3306 )) \\\n  (( std::string, database, \"\" )) \\\n  (( std::string, table, \"\" )) \\\n)\n```\n\nThe entries are statically typed and are directly accessible using the dot operator\n\n```\nDatabase db;\nstd::cout \u003c\u003c db.database \u003c\u003c std::endl;\n```\n\nA record can be initialized with a build pattern\n\n```\nDatabase db.set_port(9876);\n```\n\nor with JSON/XML\n\n```\n{\n  \"port\": 9876,\n  \"database\": \"staff\",\n  \"table\": \"employees\"\n}\n```\n\nNested records and std::vector are supported.\n\n\nPolymorphic record\n------------------\n\nFor a polymorphic record a macro for the base class and for\nthe derived classes have to be defined by\n\n```\nBRAINTWISTER_RECORD_BASE( base_recor_name, \\\n (( base_entry_type, base_entry_name, base_entry_default_value )) \\\n ..., \\\n virtual function \\\n)\n\nBRAINTWISTER_RECORD_DERIVED( derived_record_name, \\\n (( derived_entry_type, derived_entry_name, derived_entry_default_value )) \\\n ..., \\\n virtual function \\\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraintwister%2Frecord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbraintwister%2Frecord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbraintwister%2Frecord/lists"}