Open djromberg opened 6 years ago
Hi, This is the same as what I mentioned in #192 .Yes, we could change to use igtl::SmartPointer directly
@Sunderlandkyl , what do you think about changing IgtlMacro to
virtual const char *GetNameOfClass() const {return #thisClass;} typedef thisClass Self; typedef superclass Superclass; typedef igtl::SmartPointer Pointer; typedef igtl::SmartPointer ConstPointer;
Sounds good to me.
When defining own messages derived from
igtl::MessageBase
or other bases, theigtlTypeMacro
can only be used when the defining class is inside theigtl
namespace. The reason is the reference to theSmartPointer
template which is not fully qualified in the macro. A workaround is to use atemplate<typename T> using SmartPointer = igtl::SmartPointer<T>;
before using the macro, but in my opinion the macro should be changed to useigtl::SmartPointer
directly instead.