Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the STAG() macro used for? #22

Open
julianrendell opened this issue Oct 12, 2021 · 1 comment
Open

What is the STAG() macro used for? #22

julianrendell opened this issue Oct 12, 2021 · 1 comment

Comments

@julianrendell
Copy link

I'm working with a student to make an ArtNet service plugin...

We've come across the STAG macro- https://github.com/philbowles/h4plugins/search?q=STAG

Couple of questions:

  • what is it supposed to mean? (Service TAG?)
  • is every service plugin required to define a STAG?
  • where are the parameters to the usages of STAG in H4Service.h defined? e.g. STAG(age) - where is age defined? We've tried searching in files and not found a definition that we understand; I've also tried using Visual Studio Codes and it can't find the definition either ;-)
  • if a new service plugin should define a STAG, where should it declare it?

Thanks in advance!

@HamzaHajeir
Copy link

HamzaHajeir commented Aug 26, 2022

Hi
It's intended to define a function that returns the exact passed literals as c-string.

#define STAG(x) constexpr const char* x##Tag(){ return #x; }

So a STAG(all) call defined a function as following:

constexpr const char* allTag(){ return "all"; }

It's intended to standardize the tags used, and to raise a compilation error if one isn't spelled correctly.
so if happened that someone typed alTag(), it'll give a compilation error because it's not defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants