NaturalDocs::ClassHierarchy::Class

An object that stores information about a class in the hierarchy.  It does not store its SymbolString; it assumes that it will be stored in a hashref where the key is the SymbolString.

Summary
NaturalDocs::ClassHierarchy::ClassAn object that stores information about a class in the hierarchy.
MembersThe class is implemented as a blessed arrayref.
Modification Functions
NewCreates and returns a new class.
AddDefinitionAdds a rew definition of this class and returns if that was the first definition.
DeleteDefinitionRemoves the definition of this class and returns if there are no more definitions.
AddParentReferenceAdds a parent reference to the class and return whether it resulted in a new parent class.
DeleteParentReferenceDeletes a parent reference from the class and return whether it resulted in a loss of a parent class.
AddChildAdds a child SymbolString to the class.
DeleteChildDeletes a child SymbolString from the class.
Information Functions
DefinitionsReturns an array of the FileNames that define this class, or an empty array if none.
IsDefinedInReturns whether the class is defined in the passed FileName.
IsDefinedReturns whether the class is defined in any files.
ParentReferencesReturns an array of the parent ReferenceStrings, or an empty array if none.
HasParentReferenceReturns whether the class has the passed parent ReferenceString.
HasParentReferencesReturns whether the class has any parent ReferenceStrings.
ParentsReturns an array of the parent SymbolStrings, or an empty array if none.
HasParentsReturns whether the class has any parent SymbolStrings defined.
ChildrenReturns an array of the child SymbolStrings, or an empty array if none.
HasChildrenReturns whether any child SymbolStrings are defined.
ParentReferenceDefinitionsReturns an array of the FileNames which define the passed parent ReferenceString, or an empty array if none.

Members

The class is implemented as a blessed arrayref.  The keys are the constants below.

DEFINITIONSAn existence hashref of all the FileNames which define this class.  Undef if none.
PARENTSAn existence hashref of the SymbolStrings of all the parents this class has.
CHILDRENAn existence hashref of the SymbolStrings of all the children this class has.
PARENT_REFERENCESA hashref of the parent ReferenceStrings this class has.  The keys are the ReferenceStrings, and the values are existence hashrefs of all the FileNames that define them.  Undef if none.

Modification Functions

New

sub New

Creates and returns a new class.

AddDefinition

sub AddDefinition #(file)

Adds a rew definition of this class and returns if that was the first definition.

Parameters

fileThe FileName the definition appears in.

Returns

Whether this was the first definition of this class.

DeleteDefinition

sub DeleteDefinition #(file)

Removes the definition of this class and returns if there are no more definitions.  Note that if there are no more definitions, you may still want to keep the object around if HasChildren() returns true.

Parameters

fileThe FileName the definition appears in.

Returns

Whether this deleted the last definition of this class.

AddParentReference

sub AddParentReference #(reference,
file,
referenceTranslations)

Adds a parent reference to the class and return whether it resulted in a new parent class.

Parameters

referenceThe ReferenceString used to determine the parent.
fileThe FileName the parent reference is in.
referenceTranslationsA hashref of what each reference currently resolves to.  The keys are the ReferenceStrings and the values are class SymbolStrings.  It should include an entry for the reference parameter above.

Returns

If the reference adds a new parent, it will return that parent’s SymbolString.  Otherwise it will return undef.

DeleteParentReference

sub DeleteParentReference #(reference,
file,
referenceTranslations)

Deletes a parent reference from the class and return whether it resulted in a loss of a parent class.

Parameters

referenceThe ReferenceString used to determine the parent.
fileThe FileName the parent declaration is in.
referenceTranslationsA hashref of what each reference currently resolves to.  The keys are the ReferenceStrings and the values are class SymbolStrings.  It should include an entry for the reference parameter above.

Returns

If this causes a parent class to be lost, it will return that parent’s SymbolString.  Otherwise it will return undef.

AddChild

sub AddChild #(child)

Adds a child SymbolString to the class.  Unlike AddParentReference(), this does not keep track of anything other than whether it has it or not.

Parameters

childThe SymbolString to add.

DeleteChild

sub DeleteChild #(child)

Deletes a child SymbolString from the class.  Unlike DeleteParentReference(), this does not keep track of anything other than whether it has it or not.

Parameters

childThe SymbolString to delete.

Information Functions

Definitions

sub Definitions

Returns an array of the FileNames that define this class, or an empty array if none.

IsDefinedIn

sub IsDefinedIn #(file)

Returns whether the class is defined in the passed FileName.

IsDefined

sub IsDefined

Returns whether the class is defined in any files.

ParentReferences

sub ParentReferences

Returns an array of the parent ReferenceStrings, or an empty array if none.

HasParentReference

sub HasParentReference #(reference)

Returns whether the class has the passed parent ReferenceString.

HasParentReferences

sub HasParentReferences

Returns whether the class has any parent ReferenceStrings.

Parents

sub Parents

Returns an array of the parent SymbolStrings, or an empty array if none.

HasParents

sub HasParents

Returns whether the class has any parent SymbolStrings defined.

Children

sub Children

Returns an array of the child SymbolStrings, or an empty array if none.

HasChildren

sub HasChildren

Returns whether any child SymbolStrings are defined.

ParentReferenceDefinitions

sub ParentReferenceDefinitions #(reference)

Returns an array of the FileNames which define the passed parent ReferenceString, or an empty array if none.

sub New
Creates and returns a new class.
sub AddDefinition #(file)
Adds a rew definition of this class and returns if that was the first definition.
sub DeleteDefinition #(file)
Removes the definition of this class and returns if there are no more definitions.
sub AddParentReference #(reference,
file,
referenceTranslations)
Adds a parent reference to the class and return whether it resulted in a new parent class.
sub DeleteParentReference #(reference,
file,
referenceTranslations)
Deletes a parent reference from the class and return whether it resulted in a loss of a parent class.
sub AddChild #(child)
Adds a child SymbolString to the class.
A scalar which encodes a normalized array of identifier strings representing a full or partially-resolved symbol.
sub DeleteChild #(child)
Deletes a child SymbolString from the class.
sub Definitions
Returns an array of the FileNames that define this class, or an empty array if none.
A string representing the absolute, platform-dependent path to a file.
sub IsDefinedIn #(file)
Returns whether the class is defined in the passed FileName.
sub IsDefined
Returns whether the class is defined in any files.
sub ParentReferences
Returns an array of the parent ReferenceStrings, or an empty array if none.
All the information about a reference that makes it unique encoded into a string.
sub HasParentReference #(reference)
Returns whether the class has the passed parent ReferenceString.
sub HasParentReferences
Returns whether the class has any parent ReferenceStrings.
sub Parents
Returns an array of the parent SymbolStrings, or an empty array if none.
sub HasParents
Returns whether the class has any parent SymbolStrings defined.
sub Children
Returns an array of the child SymbolStrings, or an empty array if none.
sub HasChildren
Returns whether any child SymbolStrings are defined.
sub ParentReferenceDefinitions #(reference)
Returns an array of the FileNames which define the passed parent ReferenceString, or an empty array if none.
Close