# ApplicationFramework
TKLCAF
TDF

# TDF_Label Class Reference

This class provides basic operations to define
a label in a data structure.
A label is a feature in the feature hierarchy. A
label is always connected to a Data from TDF.
To a label is attached attributes containing the
software components information.
Label information:
It is possible to know the tag, the father, the
depth in the tree of the label, if the label is
root, null or equal to another label.
Comfort methods:
Some methods useful on a label.
Attributes:
It is possible to get an attribute in accordance
to an ID, or the yougest previous version of a
current attribute.
.

`#include <TDF_Label.hxx>`

## Public Member Functions

void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)
Standard_EXPORT | TDF_Label ()
| Constructs an empty label object. .
void | Nullify ()
| Nullifies the label. .
Handle_TDF_Data | Data () const
| Returns the Data owning <me>. .
Standard_Integer | Tag () const
| Returns the tag of the label. This is the integer assigned randomly to a label in a data framework. This integer is used to identify this label in an entry. .
const TDF_Label | Father () const
| Returns the label father. This label may be null if the label is root. .
Standard_Boolean | IsNull () const
| Returns True if the <alabel> is null, i.e. it has not been included in the data framework. .
Standard_EXPORT void | Imported (const Standard_Boolean aStatus) const
| Sets or unsets <me> and all its descendants as imported label, according to <astatus>. .
Standard_Boolean | IsImported () const
| Returns True if the <alabel> is imported. .
Standard_Boolean | IsEqual (const TDF_Label &aLabel) const
| Returns True if the <alabel> is equal to me (same LabelNode*). .
Standard_Boolean | operator== (const TDF_Label &aLabel) const
Standard_Boolean | IsDifferent (const TDF_Label &aLabel) const
Standard_Boolean | operator!= (const TDF_Label &aLabel) const
Standard_Boolean | IsRoot () const
Standard_EXPORT Standard_Boolean | IsAttribute (const Standard_GUID &anID) const
| Returns true if <me> owns an attribute with <anid> as ID. .
Standard_EXPORT void | AddAttribute (const Handle(TDF_Attribute)&anAttribute) const
| Adds an Attribute to the current label. Raises if there is already one. .
Standard_EXPORT void | ForgetAttribute (const Handle(TDF_Attribute)&anAttribute) const
| Forgets an Attribute from the current label, setting its forgotten status true and its valid status false. Raises if the attribute is not in the structure. .
Standard_EXPORT Standard_Boolean | ForgetAttribute (const Standard_GUID &aguid) const
| Forgets the Attribute of GUID <aguid> from the current label . If the attribute doesn't exist returns False. Otherwise returns True. .
Standard_EXPORT void | ForgetAllAttributes (const Standard_Boolean clearChildren=Standard_True) const
| Forgets all the attributes. Does it on also on the sub-labels if <clearchildren> is set to true. Of course, this method is compatible with Transaction & Delta mecanisms. .
Standard_EXPORT void | ResumeAttribute (const Handle(TDF_Attribute)&anAttribute) const
| Undo Forget action, setting its forgotten status false and its valid status true. Raises if the attribute is not in the structure. .
Standard_EXPORT Standard_Boolean | FindAttribute (const Standard_GUID &anID, Handle(TDF_Attribute)&anAttribute) const
| Finds an attribute of the current label, according to <anid>. If anAttribute is not a valid one, false is returned. The method returns True if found, False otherwise. A removed attribute cannot be found. .
Standard_EXPORT Standard_Boolean | FindAttribute (const Standard_GUID &anID, const Standard_Integer aTransaction, Handle(TDF_Attribute)&anAttribute) const
| Finds an attribute of the current label, according to <anid> and <atransaction>. This attribute has/had to be a valid one for the given transaction index . So, this attribute is not necessary a valid one. The method returns True if found, False otherwise. A removed attribute cannot be found nor a backuped attribute of a removed one. .
Standard_Boolean | MayBeModified () const
| Returns true if <me> or a DESCENDANT of <me> owns attributes not yet available in transaction 0. It means at least one of their attributes is new, modified or deleted. .
Standard_Boolean | AttributesModified () const
| Returns true if <me> owns attributes not yet available in transaction 0. It means at least one attribute is new, modified or deleted. .
Standard_EXPORT Standard_Boolean | HasAttribute () const
| Returns true if this label has at least one attribute. .
Standard_EXPORT Standard_Integer | NbAttributes () const
| Returns the number of attributes. .
Standard_EXPORT Standard_Integer | Depth () const
| Returns the depth of the label in the data framework. This corresponds to the number of fathers which this label has, and is used in determining whether a label is root, null or equivalent to another label. Exceptions: Standard_NullObject if this label is null. This is because a null object can have no depth. .
Standard_EXPORT Standard_Boolean | IsDescendant (const TDF_Label &aLabel) const
| Returns True if <me> is a descendant of <alabel>. Attention: every label is its own descendant. .
Standard_EXPORT const TDF_Label | Root () const
| Returns the root label Root of the data structure. This has a depth of 0. Exceptions: Standard_NullObject if this label is null. This is because a null object can have no depth. .
Standard_Boolean | HasChild () const
| Returns true if this label has at least one child. .
Standard_EXPORT Standard_Integer | NbChildren () const
| Returns the number of children. .
Standard_EXPORT TDF_Label | FindChild (const Standard_Integer aTag, const Standard_Boolean create=Standard_True) const
| Finds a child label having <atag> as tag. Creates The tag aTag identifies the label which will be the parent. If create is true and no child label is found, a new one is created. Example: //creating a label with tag 10 at Root TDF_Label lab1 = aDF->Root().FindChild(10); //creating labels 7 and 2 on label 10 TDF_Label lab2 = lab1.FindChild(7); TDF_Label lab3 = lab1.FindChild(2); .
TDF_Label | NewChild () const
| Create a new child label of me using autoamtic delivery tags provided by TagSource. .
Standard_EXPORT Standard_Integer | Transaction () const
| Returns the current transaction index. .
Standard_EXPORT Standard_Boolean | HasLowerNode (const TDF_Label &otherLabel) const
| Returns true if node address of <me> is lower than <otherlabel> one. Used to quickly sort labels (not on entry criterion). -C++: inline .
Standard_EXPORT Standard_Boolean | HasGreaterNode (const TDF_Label &otherLabel) const
| Returns true if node address of <me> is greater than <otherlabel> one. Used to quickly sort labels (not on entry criterion). -C++: inline .
Standard_EXPORT Standard_OStream & | Dump (Standard_OStream &anOS) const
| Dumps the minimum information about <me> on <astream>. .
Standard_OStream & | operator<< (Standard_OStream &anOS) const
Standard_EXPORT void | ExtendedDump (Standard_OStream &anOS, const TDF_IDFilter &aFilter, TDF_AttributeIndexedMap &aMap) const
| Dumps the label on <astream> and its attributes rank in <amap> if their IDs are kept by <idfilter>. .
Standard_EXPORT void | EntryDump (Standard_OStream &anOS) const
| Dumps the label entry. .

## Private Member Functions

Standard_EXPORT | TDF_Label (const TDF_LabelNodePtr &aNode)
| Reserved to the friends. .
Standard_EXPORT void | AddToNode (const TDF_LabelNodePtr &toNode, const Handle(TDF_Attribute)&anAttribute) const
| Adds an Attribute to <tonode>. Raises if there is already one. .
Standard_EXPORT void | ForgetFromNode (const TDF_LabelNodePtr &fromNode, const Handle(TDF_Attribute)&anAttribute) const
| Forgets an Attribute from <fromnode>. Raises if the attribute is not in the structure. .
Standard_EXPORT void | ResumeToNode (const TDF_LabelNodePtr &fromNode, const Handle(TDF_Attribute)&anAttribute) const
| Resumes a forgotten Attribute to <tonode>. Raises if the attribute is not in the structure. .
Standard_EXPORT TDF_LabelNodePtr | FindOrAddChild (const Standard_Integer aTag, const Standard_Boolean create) const
Standard_EXPORT void | InternalDump (Standard_OStream &anOS, const TDF_IDFilter &aFilter, TDF_AttributeIndexedMap &aMap, const Standard_Boolean extended) const

## Private Attributes

TDF_LabelNodePtr | myLabelNode

## Constructor & Destructor Documentation

Standard_EXPORT TDF_Label::TDF_Label | ( |  | ) |

Standard_EXPORT TDF_Label::TDF_Label | ( | const TDF_LabelNodePtr & | aNode | ) | `[private]`

## Member Function Documentation

Standard_EXPORT void TDF_Label::AddAttribute | ( | const Handle(TDF_Attribute)& | anAttribute | ) | const

Standard_EXPORT void TDF_Label::AddToNode | ( | const TDF_LabelNodePtr & | toNode,
|  | const Handle(TDF_Attribute)& | anAttribute
| ) | const`[private]`

Standard_Boolean TDF_Label::AttributesModified | ( |  | ) | const`[inline]`

Handle_TDF_Data TDF_Label::Data | ( |  | ) | const

Standard_EXPORT Standard_Integer TDF_Label::Depth | ( |  | ) | const

Standard_EXPORT Standard_OStream& TDF_Label::Dump | ( | Standard_OStream & | anOS | ) | const

Standard_EXPORT void TDF_Label::EntryDump | ( | Standard_OStream & | anOS | ) | const

Standard_EXPORT void TDF_Label::ExtendedDump | ( | Standard_OStream & | anOS,
|  | const TDF_IDFilter & | aFilter,
|  | TDF_AttributeIndexedMap & | aMap
| ) | const

const TDF_Label TDF_Label::Father | ( |  | ) | const`[inline]`

Standard_EXPORT Standard_Boolean TDF_Label::FindAttribute | ( | const Standard_GUID & | anID,
|  | const Standard_Integer | aTransaction,
|  | Handle(TDF_Attribute)& | anAttribute
| ) | const

Standard_EXPORT Standard_Boolean TDF_Label::FindAttribute | ( | const Standard_GUID & | anID,
|  | Handle(TDF_Attribute)& | anAttribute
| ) | const

Standard_EXPORT TDF_Label TDF_Label::FindChild | ( | const Standard_Integer | aTag,
|  | const Standard_Boolean | create = `Standard_True`
| ) | const

Standard_EXPORT TDF_LabelNodePtr TDF_Label::FindOrAddChild | ( | const Standard_Integer | aTag,
|  | const Standard_Boolean | create
| ) | const`[private]`

Standard_EXPORT void TDF_Label::ForgetAllAttributes | ( | const Standard_Boolean | clearChildren = `Standard_True` | ) | const

Standard_EXPORT Standard_Boolean TDF_Label::ForgetAttribute | ( | const Standard_GUID & | aguid | ) | const

Standard_EXPORT void TDF_Label::ForgetAttribute | ( | const Handle(TDF_Attribute)& | anAttribute | ) | const

Standard_EXPORT void TDF_Label::ForgetFromNode | ( | const TDF_LabelNodePtr & | fromNode,
|  | const Handle(TDF_Attribute)& | anAttribute
| ) | const`[private]`

Standard_EXPORT Standard_Boolean TDF_Label::HasAttribute | ( |  | ) | const

Standard_Boolean TDF_Label::HasChild | ( |  | ) | const`[inline]`

Standard_EXPORT Standard_Boolean TDF_Label::HasGreaterNode | ( | const TDF_Label & | otherLabel | ) | const

Standard_EXPORT Standard_Boolean TDF_Label::HasLowerNode | ( | const TDF_Label & | otherLabel | ) | const

Standard_EXPORT void TDF_Label::Imported | ( | const Standard_Boolean | aStatus | ) | const

Standard_EXPORT void TDF_Label::InternalDump | ( | Standard_OStream & | anOS,
|  | const TDF_IDFilter & | aFilter,
|  | TDF_AttributeIndexedMap & | aMap,
|  | const Standard_Boolean | extended
| ) | const`[private]`

Standard_EXPORT Standard_Boolean TDF_Label::IsAttribute | ( | const Standard_GUID & | anID | ) | const

Standard_EXPORT Standard_Boolean TDF_Label::IsDescendant | ( | const TDF_Label & | aLabel | ) | const

Standard_Boolean TDF_Label::IsDifferent | ( | const TDF_Label & | aLabel | ) | const`[inline]`

Standard_Boolean TDF_Label::IsEqual | ( | const TDF_Label & | aLabel | ) | const`[inline]`

Standard_Boolean TDF_Label::IsImported | ( |  | ) | const`[inline]`

Standard_Boolean TDF_Label::IsNull | ( |  | ) | const`[inline]`

Standard_Boolean TDF_Label::IsRoot | ( |  | ) | const`[inline]`

Standard_Boolean TDF_Label::MayBeModified | ( |  | ) | const`[inline]`

Standard_EXPORT Standard_Integer TDF_Label::NbAttributes | ( |  | ) | const

Standard_EXPORT Standard_Integer TDF_Label::NbChildren | ( |  | ) | const

TDF_Label TDF_Label::NewChild | ( |  | ) | const`[inline]`

void TDF_Label::Nullify | ( |  | ) | `[inline]`

void TDF_Label::operator delete | ( | void * | anAddress | ) | `[inline]`

void* TDF_Label::operator new | ( | size_t | size | ) | `[inline]`

void* TDF_Label::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

Standard_Boolean TDF_Label::operator!= | ( | const TDF_Label & | aLabel | ) | const`[inline]`

Standard_OStream& TDF_Label::operator<< | ( | Standard_OStream & | anOS | ) | const`[inline]`

Standard_Boolean TDF_Label::operator== | ( | const TDF_Label & | aLabel | ) | const`[inline]`

Standard_EXPORT void TDF_Label::ResumeAttribute | ( | const Handle(TDF_Attribute)& | anAttribute | ) | const

Standard_EXPORT void TDF_Label::ResumeToNode | ( | const TDF_LabelNodePtr & | fromNode,
|  | const Handle(TDF_Attribute)& | anAttribute
| ) | const`[private]`

Standard_EXPORT const TDF_Label TDF_Label::Root | ( |  | ) | const

Standard_Integer TDF_Label::Tag | ( |  | ) | const`[inline]`

Standard_EXPORT Standard_Integer TDF_Label::Transaction | ( |  | ) | const

## Field Documentation

TDF_LabelNodePtr TDF_Label::myLabelNode`[private]`

The documentation for this class was generated from the following files:

- TDF_Label.hxx
- TDF_Label.lxx