1 ###############################################################################
3 # Package: NaturalDocs::SymbolTable::SymbolDefinition
5 ###############################################################################
7 # A class representing a symbol definition. This does not store the definition symbol, class, or file.
9 ###############################################################################
11 # This file is part of Natural Docs, which is Copyright © 2003-2010 Greg Valure
12 # Natural Docs is licensed under version 3 of the GNU Affero General Public License (AGPL)
13 # Refer to License.txt for the complete details
18 package NaturalDocs::SymbolTable::SymbolDefinition;
21 ###############################################################################
22 # Group: Implementation
27 # The class is implemented as a blessed arrayref. The following constants are its members.
29 # TYPE - The symbol <TopicType>.
30 # PROTOTYPE - The symbol's prototype, if applicable. Will be undef otherwise.
31 # SUMMARY - The symbol's summary, if applicable. Will be undef otherwise.
33 use constant TYPE => 0;
34 use constant PROTOTYPE => 1;
35 use constant SUMMARY => 2;
36 # New depends on the order of the constants.
39 ###############################################################################
45 # Creates and returns a new object.
49 # type - The symbol <TopicType>.
50 # prototype - The symbol prototype, if applicable. Undef otherwise.
51 # summary - The symbol's summary, if applicable. Undef otherwise.
53 sub New #(type, prototype, summary)
55 # This depends on the parameter list being the same as the constant order.
60 bless $object, $package;
67 # Returns the definition's <TopicType>.
69 { return $_[0]->[TYPE]; };
72 # Changes the <TopicType>.
74 { $_[0]->[TYPE] = $_[1]; };
77 # Returns the definition's prototype, or undef if it doesn't have one.
79 { return $_[0]->[PROTOTYPE]; };
81 # Function: SetPrototype
82 # Changes the prototype.
83 sub SetPrototype #(prototype)
84 { $_[0]->[PROTOTYPE] = $_[1]; };
87 # Returns the definition's summary, or undef if it doesn't have one.
89 { return $_[0]->[SUMMARY]; };
91 # Function: SetSummary
92 # Changes the summary.
93 sub SetSummary #(summary)
94 { $_[0]->[SUMMARY] = $_[1]; };