0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | Friends | List of all members
clanguml::config::inheritable_diagram_options Struct Reference

Represents subset of inheritable configuration options. More...

Detailed Description

Represents subset of inheritable configuration options.

This class contains a subset of configuration options, which are inherited from the top level of the configuration to the diagrams.

Definition at line 595 of file config.h.

#include <config.h>

Public Member Functions

virtual ~inheritable_diagram_options ()=default
 
void inherit (const inheritable_diagram_options &parent)
 
std::string simplify_template_type (std::string full_name) const
 
bool generate_fully_qualified_name () const
 Whether the diagram element should be fully qualified in diagram.
 
std::filesystem::path root_directory () const
 Returns absolute path of the relative_to option.
 
option< std::filesystem::path > & get_relative_to ()
 Get reference to relative_to diagram config option.
 

Public Attributes

option< glob_tglob {"glob"}
 
option< common::model::namespace_using_namespace {"using_namespace"}
 
option< std::string > using_module {"using_module"}
 
option< bool > include_relations_also_as_members
 
option< filter_mode_tfilter_mode {"filter_mode", filter_mode_t::basic}
 
option< bool > include_system_headers {"include_system_headers", false}
 
option< filterinclude {"include"}
 
option< filterexclude {"exclude"}
 
option< plantumlpuml {"plantuml", option_inherit_mode::kAppend}
 
option< struct mermaidmermaid {"mermaid", option_inherit_mode::kAppend}
 
option< struct graphmlgraphml {"graphml", option_inherit_mode::kAppend}
 
option< method_argumentsgenerate_method_arguments
 
option< bool > generate_concept_requirements
 
option< bool > group_methods {"group_methods", true}
 
option< member_order_tmember_order
 
option< bool > generate_packages {"generate_packages", false}
 
option< package_type_tpackage_type
 
option< bool > generate_template_argument_dependencies
 
option< bool > skip_redundant_dependencies
 
option< generate_links_configgenerate_links {"generate_links"}
 
option< git_configgit {"git"}
 
option< layout_hintslayout {"layout"}
 
option< std::filesystem::path > base_directory {"__parent_path"}
 
option< bool > generate_system_headers {"generate_system_headers", false}
 
option< relationship_hints_trelationship_hints {"relationship_hints"}
 
option< type_aliases_ttype_aliases
 
option< comment_parser_tcomment_parser
 
option< bool > combine_free_functions_into_file_participants
 
option< bool > inline_lambda_messages {"inline_lambda_messages", false}
 
option< bool > generate_return_types {"generate_return_types", false}
 
option< bool > generate_condition_statements
 
option< std::vector< std::string > > participants_order {"participants_order"}
 
option< bool > generate_message_comments {"generate_message_comments", false}
 
option< bool > fold_repeated_activities {"fold_repeated_activities", false}
 
option< unsigned > message_comment_width
 
option< bool > debug_mode {"debug_mode", false}
 
option< bool > generate_metadata {"generate_metadata", true}
 
option< bool > allow_empty_diagrams {"allow_empty_diagrams", false}
 
option< inja::json > user_data {"user_data", {}, option_inherit_mode::kAppend}
 

Protected Attributes

option< std::filesystem::path > relative_to {"relative_to"}
 

Friends

YAML::Emitter & operator<< (YAML::Emitter &out, const inheritable_diagram_options &c)
 

Constructor & Destructor Documentation

◆ ~inheritable_diagram_options()

virtual clanguml::config::inheritable_diagram_options::~inheritable_diagram_options ( )
virtualdefault

Member Function Documentation

◆ generate_fully_qualified_name()

bool clanguml::config::inheritable_diagram_options::generate_fully_qualified_name ( ) const

Whether the diagram element should be fully qualified in diagram.

This method determines whether an elements' name should include fully qualified namespace name (however relative to using_namespace), or whether it should just contain it's name. This depends on whether the diagram has packages and if they are based on namespaces or sth else.

Returns
True, if element should include it's namespace

Definition at line 349 of file config.cc.

350{
353}

◆ get_relative_to()

option< std::filesystem::path > & clanguml::config::inheritable_diagram_options::get_relative_to ( )
inline

Get reference to relative_to diagram config option.

This method is only to allow access to relative_to for loading and adjusting configuration file and for making test cases work.

Instead use

See also
config::diagram::root_directory() method.
Returns
Reference to relative_to config option.

Definition at line 631 of file config.h.

631{ return relative_to; }

◆ inherit()

void clanguml::config::inheritable_diagram_options::inherit ( const inheritable_diagram_options parent)

Definition at line 284 of file config.cc.

286{
287 glob.override(parent.glob);
288 using_namespace.override(parent.using_namespace);
289 using_module.override(parent.using_module);
291 parent.include_relations_also_as_members);
292 filter_mode.override(parent.filter_mode);
293 include_system_headers.override(parent.include_system_headers);
294 include.override(parent.include);
295 exclude.override(parent.exclude);
296 puml.override(parent.puml);
297 mermaid.override(parent.mermaid);
298 graphml.override(parent.graphml);
299 generate_method_arguments.override(parent.generate_method_arguments);
300 fold_repeated_activities.override(parent.fold_repeated_activities);
302 parent.generate_concept_requirements);
303 generate_packages.override(parent.generate_packages);
305 parent.generate_template_argument_dependencies);
306 package_type.override(parent.package_type);
308 parent.generate_template_argument_dependencies);
309 skip_redundant_dependencies.override(parent.skip_redundant_dependencies);
310 generate_links.override(parent.generate_links);
311 generate_system_headers.override(parent.generate_system_headers);
312 git.override(parent.git);
313 base_directory.override(parent.base_directory);
314 relative_to.override(parent.relative_to);
315 comment_parser.override(parent.comment_parser);
317 parent.combine_free_functions_into_file_participants);
318 inline_lambda_messages.override(parent.inline_lambda_messages);
319 generate_return_types.override(parent.generate_return_types);
321 parent.generate_condition_statements);
322 debug_mode.override(parent.debug_mode);
323 generate_metadata.override(parent.generate_metadata);
324 allow_empty_diagrams.override(parent.allow_empty_diagrams);
325 type_aliases.override(parent.type_aliases);
326 user_data.override(parent.user_data);
327}

◆ root_directory()

std::filesystem::path clanguml::config::inheritable_diagram_options::root_directory ( ) const

Returns absolute path of the relative_to option.

Returns
Absolute path of relative_to

Definition at line 279 of file config.cc.

280{
281 return weakly_canonical(absolute(base_directory() / relative_to()));
282}

◆ simplify_template_type()

std::string clanguml::config::inheritable_diagram_options::simplify_template_type ( std::string  full_name) const

Definition at line 329 of file config.cc.

331{
333 aliases.insert(type_aliases().begin(), type_aliases().end());
334
335 bool matched{true};
336 while (matched) {
337 auto matched_in_iteration{false};
338 for (const auto &[pattern, replacement] : aliases) {
339 matched_in_iteration =
340 util::replace_all(full_name, pattern, replacement) ||
341 matched_in_iteration;
342 }
343 matched = matched_in_iteration;
344 }
345
346 return full_name;
347}

Friends And Related Symbol Documentation

◆ operator<<

YAML::Emitter & operator<< ( YAML::Emitter &  out,
const inheritable_diagram_options c 
)
friend

Definition at line 410 of file yaml_emitters.cc.

412{
413 // Common options
414 out << c.base_directory;
415 out << c.comment_parser;
416 out << c.debug_mode;
417 out << c.exclude;
418 out << c.generate_links;
419 out << c.git;
420 out << c.glob;
421 out << c.include;
422 out << c.puml;
423 out << c.mermaid;
424 out << c.graphml;
425 out << c.relative_to;
426 out << c.using_namespace;
427 out << c.using_module;
428 out << c.generate_metadata;
429 out << c.user_data;
430
431 if (const auto *cd = dynamic_cast<const class_diagram *>(&c);
432 cd != nullptr) {
433 out << cd->title;
434 out << c.generate_method_arguments;
435 out << c.generate_concept_requirements;
436 out << c.generate_packages;
437 out << c.include_relations_also_as_members;
438 if (c.relationship_hints) {
439 out << YAML::Key << "relationship_hints" << YAML::Value
440 << c.relationship_hints();
441 }
442
443 if (c.type_aliases) {
444 out << YAML::Key << "type_aliases" << YAML::Value
445 << c.type_aliases();
446 }
447 out << c.member_order;
448 out << c.package_type;
449 out << c.generate_template_argument_dependencies;
450 out << c.skip_redundant_dependencies;
451 }
452 else if (const auto *sd = dynamic_cast<const sequence_diagram *>(&c);
453 sd != nullptr) {
454 out << sd->title;
455 out << c.combine_free_functions_into_file_participants;
456 out << c.inline_lambda_messages;
457 out << c.generate_condition_statements;
458 out << c.generate_method_arguments;
459 out << c.generate_return_types;
460 out << c.participants_order;
461 out << c.generate_message_comments;
462 out << c.fold_repeated_activities;
463 out << c.message_comment_width;
464 }
465 else if (const auto *pd = dynamic_cast<const package_diagram *>(&c);
466 pd != nullptr) {
467 out << pd->title;
468 out << c.generate_packages;
469 out << c.package_type;
470 }
471 else if (const auto *id = dynamic_cast<const include_diagram *>(&c);
472 id != nullptr) {
473 out << id->title;
474 out << c.generate_system_headers;
475 }
476
477 return out;
478}

Member Data Documentation

◆ allow_empty_diagrams

option<bool> clanguml::config::inheritable_diagram_options::allow_empty_diagrams {"allow_empty_diagrams", false}

Definition at line 684 of file config.h.

◆ base_directory

option<std::filesystem::path> clanguml::config::inheritable_diagram_options::base_directory {"__parent_path"}

Definition at line 664 of file config.h.

◆ combine_free_functions_into_file_participants

option<bool> clanguml::config::inheritable_diagram_options::combine_free_functions_into_file_participants
Initial value:
{
"combine_free_functions_into_file_participants", false}

Definition at line 671 of file config.h.

◆ comment_parser

option<comment_parser_t> clanguml::config::inheritable_diagram_options::comment_parser
Initial value:
{
"comment_parser", comment_parser_t::plain}

Definition at line 669 of file config.h.

◆ debug_mode

option<bool> clanguml::config::inheritable_diagram_options::debug_mode {"debug_mode", false}

Definition at line 682 of file config.h.

◆ exclude

option<filter> clanguml::config::inheritable_diagram_options::exclude {"exclude"}

Definition at line 641 of file config.h.

◆ filter_mode

option<filter_mode_t> clanguml::config::inheritable_diagram_options::filter_mode {"filter_mode", filter_mode_t::basic}

Definition at line 638 of file config.h.

◆ fold_repeated_activities

option<bool> clanguml::config::inheritable_diagram_options::fold_repeated_activities {"fold_repeated_activities", false}

Definition at line 679 of file config.h.

◆ generate_concept_requirements

option<bool> clanguml::config::inheritable_diagram_options::generate_concept_requirements
Initial value:
{
"generate_concept_requirements", true}

Definition at line 647 of file config.h.

◆ generate_condition_statements

option<bool> clanguml::config::inheritable_diagram_options::generate_condition_statements
Initial value:
{
"generate_condition_statements", false}

Definition at line 675 of file config.h.

◆ generate_links

option<generate_links_config> clanguml::config::inheritable_diagram_options::generate_links {"generate_links"}

Definition at line 659 of file config.h.

◆ generate_message_comments

option<bool> clanguml::config::inheritable_diagram_options::generate_message_comments {"generate_message_comments", false}

Definition at line 678 of file config.h.

◆ generate_metadata

option<bool> clanguml::config::inheritable_diagram_options::generate_metadata {"generate_metadata", true}

Definition at line 683 of file config.h.

◆ generate_method_arguments

option<method_arguments> clanguml::config::inheritable_diagram_options::generate_method_arguments
Initial value:
{
"generate_method_arguments", method_arguments::full}

Definition at line 645 of file config.h.

◆ generate_packages

option<bool> clanguml::config::inheritable_diagram_options::generate_packages {"generate_packages", false}

Definition at line 652 of file config.h.

◆ generate_return_types

option<bool> clanguml::config::inheritable_diagram_options::generate_return_types {"generate_return_types", false}

Definition at line 674 of file config.h.

◆ generate_system_headers

option<bool> clanguml::config::inheritable_diagram_options::generate_system_headers {"generate_system_headers", false}

Definition at line 665 of file config.h.

◆ generate_template_argument_dependencies

option<bool> clanguml::config::inheritable_diagram_options::generate_template_argument_dependencies
Initial value:
{
"generate_template_argument_dependencies", true}

Definition at line 655 of file config.h.

◆ git

option<git_config> clanguml::config::inheritable_diagram_options::git {"git"}

Definition at line 660 of file config.h.

◆ glob

option<glob_t> clanguml::config::inheritable_diagram_options::glob {"glob"}

Definition at line 633 of file config.h.

◆ graphml

option<struct graphml> clanguml::config::inheritable_diagram_options::graphml {"graphml", option_inherit_mode::kAppend}

Definition at line 644 of file config.h.

◆ group_methods

option<bool> clanguml::config::inheritable_diagram_options::group_methods {"group_methods", true}

Definition at line 649 of file config.h.

◆ include

option<filter> clanguml::config::inheritable_diagram_options::include {"include"}

Definition at line 640 of file config.h.

◆ include_relations_also_as_members

option<bool> clanguml::config::inheritable_diagram_options::include_relations_also_as_members
Initial value:
{
"include_relations_also_as_members", true}

Definition at line 636 of file config.h.

◆ include_system_headers

option<bool> clanguml::config::inheritable_diagram_options::include_system_headers {"include_system_headers", false}

Definition at line 639 of file config.h.

◆ inline_lambda_messages

option<bool> clanguml::config::inheritable_diagram_options::inline_lambda_messages {"inline_lambda_messages", false}

Definition at line 673 of file config.h.

◆ layout

option<layout_hints> clanguml::config::inheritable_diagram_options::layout {"layout"}

Definition at line 661 of file config.h.

◆ member_order

option<member_order_t> clanguml::config::inheritable_diagram_options::member_order
Initial value:
{
"member_order", member_order_t::lexical}

Definition at line 650 of file config.h.

◆ mermaid

option<struct mermaid> clanguml::config::inheritable_diagram_options::mermaid {"mermaid", option_inherit_mode::kAppend}

Definition at line 643 of file config.h.

◆ message_comment_width

option<unsigned> clanguml::config::inheritable_diagram_options::message_comment_width
Initial value:
{

Definition at line 680 of file config.h.

◆ package_type

option<package_type_t> clanguml::config::inheritable_diagram_options::package_type
Initial value:
{
"package_type", package_type_t::kNamespace}

Definition at line 653 of file config.h.

◆ participants_order

option<std::vector<std::string> > clanguml::config::inheritable_diagram_options::participants_order {"participants_order"}

Definition at line 677 of file config.h.

◆ puml

option<plantuml> clanguml::config::inheritable_diagram_options::puml {"plantuml", option_inherit_mode::kAppend}

Definition at line 642 of file config.h.

◆ relationship_hints

option<relationship_hints_t> clanguml::config::inheritable_diagram_options::relationship_hints {"relationship_hints"}

Definition at line 666 of file config.h.

◆ relative_to

option<std::filesystem::path> clanguml::config::inheritable_diagram_options::relative_to {"relative_to"}
protected

Definition at line 694 of file config.h.

◆ skip_redundant_dependencies

option<bool> clanguml::config::inheritable_diagram_options::skip_redundant_dependencies
Initial value:
{
"skip_redundant_dependencies", true}

Definition at line 657 of file config.h.

◆ type_aliases

option<type_aliases_t> clanguml::config::inheritable_diagram_options::type_aliases
Initial value:
{

Definition at line 667 of file config.h.

◆ user_data

option<inja::json> clanguml::config::inheritable_diagram_options::user_data {"user_data", {}, option_inherit_mode::kAppend}

Definition at line 685 of file config.h.

◆ using_module

option<std::string> clanguml::config::inheritable_diagram_options::using_module {"using_module"}

Definition at line 635 of file config.h.

◆ using_namespace

option<common::model::namespace_> clanguml::config::inheritable_diagram_options::using_namespace {"using_namespace"}

Definition at line 634 of file config.h.


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