René's URL Explorer Experiment


Title: Template programming for schema independent code · Issue #1333 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Template programming for schema independent code · Issue #1333 · IfcOpenShell/IfcOpenShell

X Title: Template programming for schema independent code · Issue #1333 · IfcOpenShell/IfcOpenShell

Description: If you case to IfcBaseEntity, you can use the latebound attribute access: IfcBaseEntity* space; auto attr = space->get("Name"); if (!attr->isNull()) { std::string name = *attr; } Otherwise you can do some sort of if statement (but it's u...

Open Graph Description: If you case to IfcBaseEntity, you can use the latebound attribute access: IfcBaseEntity* space; auto attr = space->get("Name"); if (!attr->isNull()) { std::string name = *attr; } Otherwise you can ...

X Description: If you case to IfcBaseEntity, you can use the latebound attribute access: IfcBaseEntity* space; auto attr = space->get("Name"); if (!attr->isNull()) { std::string name = *attr; } Ot...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/1333

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Template programming for schema independent code","articleBody":"If you case to IfcBaseEntity, you can use the latebound attribute access:\r\n\r\n```\r\nIfcBaseEntity* space;\r\nauto attr = space->get(\"Name\");\r\nif (!attr->isNull()) {\r\n    std::string name = *attr; \r\n}\r\n```\r\n\r\nOtherwise you can do some sort of if statement (but it's ugly) either with\r\n\r\n`dynamic_cast\u003cIfc2x3::IfcSpace>`  or `dynamic_cast\u003cIfc4::IfcSpace>` \r\n\r\nOr with `space->declaration().schema()` (I think)\r\n\r\nWe could also think of some sort of visitor:\r\n\r\n```\r\ntemplate \u003ctypename Schema>\r\nstd::string get_name(typename Schema::IfcSpace*) {\r\n...\r\n}\r\n\r\ntemplate \u003ctypename Fn>\r\nstd::string apply_visitor(IfcBaseEntity* x, Fn fn) {\r\n    if (dynamic_cast\u003cIfc2x3::IfcSpace>(x)) {\r\n        fn(dynamic_cast\u003cIfc2x3::IfcSpace>(x))\r\n    } else (dynamic_cast\u003cIfc4::IfcSpace>(x)) { ...\r\n}\r\n\r\nIfcBaseEntity* space;\r\napply_visitor(space, get_name);\r\n```\r\n\r\nBut in that last approach it would be nice to be able to reuse it to other classes not only IfcSpace but I haven't found a way yet to do that.;\r\n\r\nMaybe the only way is to create some sort of meta schema that unifies all IFC schemas so that you have a \r\n\r\n`meta::IfcSpace` that is maybe a `boost::mpl::list` of (`Ifc2x3::IfcSpace`, `Ifc4::IfcSpace`, ...) so that you do a compile time iteration.\r\n\r\nhttps://sourceforge.net/p/ifcopenshell/discussion/1782717/thread/cc4c489825/?limit=25\r\n\r\nSee also http://blog.ifcopenshell.org/2019/12/v060.html","author":{"url":"https://github.com/aothms","@type":"Person","name":"aothms"},"datePublished":"2021-02-20T10:10:18Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/1333"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c39000c3-73a0-b2fc-1b61-50ef086f77ce
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC6DA:10AF43:7BB9F7:A9987D:6B04AAFA
html-safe-noncec4de3512961a5ff299f519af7bbd2db9af82517deea0e1974c98f4271bfc810a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkRBOjEwQUY0Mzo3QkI5Rjc6QTk5ODdEOjZCMDRBQUZBIiwidmlzaXRvcl9pZCI6IjIyMjQ3MzY3MjgzMzI0MTM2OTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac471965e33eb484c93110269958e7dd76a53b827bf79b8ddd4ac31db39c67a439
hovercard-subject-tagissue:812571172
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/1333/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9dbb8581879a69a5fa836ece95545ddfd4cc1a3a8037aa7e8a8098dfaed7c08b/IfcOpenShell/IfcOpenShell/issues/1333
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9dbb8581879a69a5fa836ece95545ddfd4cc1a3a8037aa7e8a8098dfaed7c08b/IfcOpenShell/IfcOpenShell/issues/1333
og:image:altIf you case to IfcBaseEntity, you can use the latebound attribute access: IfcBaseEntity* space; auto attr = space->get("Name"); if (!attr->isNull()) { std::string name = *attr; } Otherwise you can ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameaothms
hostnamegithub.com
expected-hostnamegithub.com
Nonef1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/1333#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F1333
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F1333
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/1333
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/1333
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/1333
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests937 (937)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/1333
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/1333
Template programming for schema independent codehttps://github.com/IfcOpenShell/IfcOpenShell/issues/1333#top
IfcOpenShell-Corehttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Core%22
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
0.8.0 releasehttps://github.com/IfcOpenShell/IfcOpenShell/milestone/5
https://github.com/aothms
aothmshttps://github.com/aothms
on Feb 20, 2021https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#issue-812571172
https://sourceforge.net/p/ifcopenshell/discussion/1782717/thread/cc4c489825/?limit=25https://sourceforge.net/p/ifcopenshell/discussion/1782717/thread/cc4c489825/?limit=25
http://blog.ifcopenshell.org/2019/12/v060.htmlhttp://blog.ifcopenshell.org/2019/12/v060.html
aothmshttps://github.com/aothms
0.7.0 releasehttps://github.com/IfcOpenShell/IfcOpenShell/milestone/4
on Feb 20, 2021https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#event-4355137787
https://github.com/aothms
aothmshttps://github.com/aothms
on Feb 20, 2021https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#issuecomment-782601375
@Vertexwahnhttps://github.com/Vertexwahn
https://github.com/tumcms/OpenInfraPlatform/blob/master/EMTCodeGen/CodeGen/EMTIfcEntityTypes.hhttps://github.com/tumcms/OpenInfraPlatform/blob/master/EMTCodeGen/CodeGen/EMTIfcEntityTypes.h
aothmshttps://github.com/aothms
0.7.0 releasehttps://github.com/IfcOpenShell/IfcOpenShell/milestone/4
0.8.0 releasehttps://github.com/IfcOpenShell/IfcOpenShell/milestone/5
on Jan 12, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#event-8210567758
Moulthttps://github.com/Moult
IfcOpenShell-Corehttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Core%22
on Feb 14, 2023https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#event-8510943774
https://github.com/petruconduraru
petruconduraruhttps://github.com/petruconduraru
on Jul 19, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#issuecomment-5015950442
@aothmshttps://github.com/aothms
#8766https://github.com/IfcOpenShell/IfcOpenShell/pull/8766
petruconduraruhttps://github.com/petruconduraru
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
on Jul 19, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#event-28180547026
petruconduraruhttps://github.com/petruconduraru
on Jul 25, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/1333#event-28468452362
Add generic cross-schema apply_visitor prototype for IfcOpenShell#1333https://github.com/BIMvoice/IfcOpenShell/commit/1233d701eef548912e9e06bf6dd0de993e7d4387
IfcOpenShell#1333https://github.com/IfcOpenShell/IfcOpenShell/issues/1333
1233d70https://github.com/BIMvoice/IfcOpenShell/commit/1233d701eef548912e9e06bf6dd0de993e7d4387
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/1333
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/1333
IfcOpenShell-Corehttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Core%22
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
0.8.0 releaseNo due datehttps://github.com/IfcOpenShell/IfcOpenShell/milestone/5
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.