What is DEFINE_HSEQUENCE good for?

Hi,

 

I have been using DEFINE_HSEQUENCE and IMPLEMENT_HSEQUENCE to define individual sequences like that:

DEFINE_HSEQUENCE(AttributeHandleSequence, NCollection_Sequence<Handle(TDF_Attribute)>)

IMPLEMENT_HSEQUENCE(AttributeHandleSequence)

but the more I think about it, the more I wonder why I have done it like that. Can you tell me? ;-)

 

I seem to have assumed, that this is necessary for creating sequences that store handles. But a simple

typedef NCollection_Sequence<Handle(TDF_Attribute)> AttributeHandleSequence;

also does it, doesn't it?

Or is DEFINE_HSEQUENCE meant for defining sequence handles - that means that not the sequence stores handles, but a handle of the sequence is used? So actually my question is: what is DEFINE_HSEQUENCE good for?

 

Thank you!

Benjamin

 

 

Benjamin Bihler's picture

To me it seems as if DEFINE_HSEQUENCE was a deprecated macro which is not necessary (anymore?). It also has a disadvantage: http://www.opencascade.com/content/definehsequence-dll-how-define-declspec, that I had overcome by duplicating the macro in my library and adapting it by inserting the right __declspec. But all of that seems unnecessary to me.

typedef NCollection_Sequence<Handle()> ...Sequence;

is the better solution and it is anyway used a lot in OCCT. I would have reported that as a bug, but since I got no confirmation, I will just stop using it myself.