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

igtlTypeMacro not working outside igtl namespace #195

Open
djromberg opened this issue Sep 24, 2018 · 3 comments
Open

igtlTypeMacro not working outside igtl namespace #195

djromberg opened this issue Sep 24, 2018 · 3 comments

Comments

@djromberg
Copy link

When defining own messages derived from igtl::MessageBase or other bases, the igtlTypeMacro can only be used when the defining class is inside the igtl namespace. The reason is the reference to the SmartPointer template which is not fully qualified in the macro. A workaround is to use a template<typename T> using SmartPointer = igtl::SmartPointer<T>; before using the macro, but in my opinion the macro should be changed to use igtl::SmartPointer directly instead.

@leochan2009
Copy link
Contributor

Hi, This is the same as what I mentioned in #192 .Yes, we could change to use igtl::SmartPointer directly

@leochan2009
Copy link
Contributor

@Sunderlandkyl , what do you think about changing IgtlMacro
to
#define igtlTypeMacro(thisClass,superclass)
virtual const char *GetNameOfClass() const {return #thisClass;}
typedef thisClass Self;
typedef superclass Superclass;
typedef igtl::SmartPointer Pointer;
typedef igtl::SmartPointer ConstPointer;

@Sunderlandkyl
Copy link
Contributor

Sounds good to me.

leochan2009 pushed a commit to leochan2009/OpenIGTLink that referenced this issue Sep 25, 2018
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

3 participants