end
end
-# The project’s graph.
+# A project’s graph.
class ProjectGraph
super NeoGraph
+ # The project’s name.
+ var project_name: String
+
# The node reperesenting the project.
#
# Once the project’s graph is initialized, this node must not be edited.
# Initialize a new project graph using the specified project name.
#
# The specified name will label all nodes of the project’s graph.
- init(name: String) do
- project.labels.add(name)
+ init do
+ project.labels.add(project_name)
project.labels.add("MEntity")
project.labels.add("MProject")
- project["name"] = name
+ project["name"] = project_name
all_nodes.add(project)
var root = new RootNamespace(self)
var doc = new JsonArray is writable
init do
- self.labels.add(graph.project["name"].to_s)
+ self.labels.add(graph.project_name)
self.labels.add("MEntity")
end
# Set the full name using the current name and the specified parent name.
fun parent_name=(parent_name: String) do
- self["full_name"] = parent_name + name_separator + self["name"].as(not null).to_s
+ if parent_name.is_empty then
+ self["full_name"] = name
+ else
+ self["full_name"] = parent_name + name_separator + name
+ end
end
# Set the location of the entity in the source code.
# Declare an inner namespace.
#
# Note: Althought Doxygen indicates that the name is optional,
- # declarations with an empty name are not supported yet.
+ # declarations with an empty name are not supported yet, except for the root
+ # namespace. For the root namespace, both arguments are empty.
#
# Parameters:
#
# * `id`: `model_id` of the inner namespace. May be empty.
- # * `full_name`: qualified name of the inner namespace.
+ # * `full_name`: qualified name of the inner namespace. Use an empty name
+ # for the root namespace.
fun declare_namespace(id: String, full_name: String) do end
# Declare an inner class.