DiscussionsIssue archiveOCCT:Application Framework

Archived issue #0028689

add attribute to serialize Standard_Boolean

CommunityOCCT:Application Frameworkclosed2 public notes

Search issues

Description

In previous version Standard_Boolean was actually integer type, In OCCT current version, Standard_Boolean is c++ bool type. It's not convinient to use TDataStd_Integer to handle Standard_Boolean any more, it is necessary to write a new attribute to save or retrieve Standard_Boolean value. The class name can be TDataStd_Boolean or TDataStd_Byte i think.

Public activity

2 archived notes

Participants are labeled by their role within this record.

01Commenter 1
There is no need in such attribute. Normally Boolean flag is managed by presense of attribute at some label or not.

The attribute TDataStd_Tick is created for this. The method label.IsAttribute(TDataStd_Tick::GetID()) will provide the needed Boolean value (if attribute has been set, it returns true, otherwise - false). Use label.ForgetAttribute to make this flag "False".

Or any other attribute may be used in the same way. For an example, TDataStd_UAttribute allows to set as many different Booleans as you want at the same label, identified by GUIDs.
02Author
Dear mpv,
You're right, i wasn't aware that TDataStd_Tick and TDataStd_UAttribute can be used to represent boolean value. So this issue can be closed without any action.
Thank you for your information, my problem is resolved.