0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
clanguml::class_diagram::model::enum_ Class Reference

Detailed Description

Definition at line 30 of file enum.h.

#include <enum.h>

Public Member Functions

 enum_ (const common::model::namespace_ &using_namespaces)
 
 enum_ (const enum_ &)=delete
 
 enum_ (enum_ &&)=delete
 
enum_operator= (const enum_ &)=delete
 
enum_operator= (enum_ &&)=delete
 
std::string type_name () const override
 
std::string full_name (bool relative=true) const override
 
std::vector< std::string > & constants ()
 Get the enums constants.
 
const std::vector< std::string > & constants () const
 Get the enums constants.
 
std::optional< std::string > doxygen_link () const override
 Get Doxygen link to documentation page for this element.
 
- Public Member Functions inherited from clanguml::common::model::element
 element (namespace_ using_namespace, path_type pt=path_type::kNamespace)
 
 ~element () override=default
 
std::string name_and_ns () const
 
void set_namespace (const namespace_ &ns)
 
namespace_ get_namespace () const
 
namespace_ get_relative_namespace () const
 
const namespace_path () const
 
void set_module (const std::string &module)
 
std::optional< std::string > module () const
 
void set_module_private (const bool module_private)
 
bool module_private () const
 
std::string full_name (bool relative) const override
 
virtual std::string full_name_no_ns () const
 
const namespace_using_namespace () const
 
inja::json context () const override
 
- Public Member Functions inherited from clanguml::common::model::diagram_element
 diagram_element ()
 
 ~diagram_element () override=default
 
const eid_tid () const
 Returns diagram element id.
 
void set_id (eid_t id)
 
std::optional< eid_tparent_element_id () const
 
void set_parent_element_id (eid_t id)
 
virtual std::string alias () const
 Return elements' diagram alias.
 
void set_name (const std::string &name)
 
std::string name () const
 
virtual std::string type_name () const
 
virtual std::string full_name (bool) const
 Return the elements fully qualified name.
 
std::vector< relationship > & relationships ()
 
const std::vector< relationship > & relationships () const
 
void add_relationship (relationship &&cr)
 
void append (const decorated_element &e)
 
virtual inja::json context () const
 
bool is_nested () const
 
void nested (bool nested)
 
bool complete () const
 
void complete (bool completed)
 
virtual void apply_filter (const diagram_filter &filter, const std::set< eid_t > &removed)
 
- Public Member Functions inherited from clanguml::common::model::decorated_element
virtual ~decorated_element ()=default
 
bool skip () const
 
bool skip_relationship () const
 
std::pair< relationship_t, std::string > get_relationship () const
 
std::string style_spec () const
 
const std::vector< std::shared_ptr< decorators::decorator > > & decorators () const
 
void add_decorators (const std::vector< std::shared_ptr< decorators::decorator > > &decorators)
 
void append (const decorated_element &de)
 
std::optional< comment_tcomment () const
 
void set_comment (const comment_t &c)
 
virtual std::optional< std::string > doxygen_link () const
 
- Public Member Functions inherited from clanguml::common::model::source_location
 source_location ()=default
 
 source_location (std::string f, unsigned int l)
 
const std::string & file () const
 
void set_file (const std::string &file)
 
const std::string & file_relative () const
 
void set_file_relative (const std::string &file)
 
const std::string & translation_unit () const
 
void set_translation_unit (const std::string &translation_unit)
 
unsigned int line () const
 
void set_line (const unsigned line)
 
unsigned int column () const
 
void set_column (const unsigned column)
 
unsigned int location_id () const
 
void set_location_id (unsigned int h)
 
- Public Member Functions inherited from clanguml::common::model::stylable_element
void set_style (const std::string &style)
 
std::optional< std::string > style () const
 

Private Attributes

std::vector< std::string > constants_
 

Friends

bool operator== (const enum_ &l, const enum_ &r)
 

Constructor & Destructor Documentation

◆ enum_() [1/3]

clanguml::class_diagram::model::enum_::enum_ ( const common::model::namespace_ using_namespaces)

Definition at line 27 of file enum.cc.

29{
30}

◆ enum_() [2/3]

clanguml::class_diagram::model::enum_::enum_ ( const enum_ )
delete

◆ enum_() [3/3]

clanguml::class_diagram::model::enum_::enum_ ( enum_ &&  )
delete

Member Function Documentation

◆ constants() [1/2]

std::vector< std::string > & clanguml::class_diagram::model::enum_::constants ( )

Get the enums constants.

Returns
Enums constants names list.

Definition at line 53 of file enum.cc.

53{ return constants_; }

◆ constants() [2/2]

const std::vector< std::string > & clanguml::class_diagram::model::enum_::constants ( ) const

Get the enums constants.

Returns
Enums constants names list.

Definition at line 55 of file enum.cc.

55{ return constants_; }

◆ doxygen_link()

std::optional< std::string > clanguml::class_diagram::model::enum_::doxygen_link ( ) const
overridevirtual

Get Doxygen link to documentation page for this element.

Returns
Doxygen link for this element.

Reimplemented from clanguml::common::model::decorated_element.

Definition at line 57 of file enum.cc.

58{
59 auto name = name_and_ns();
60 util::replace_all(name, "_", "__");
61 util::replace_all(name, "::", "_1_1");
62 return fmt::format("enum{}.html", name);
63}

◆ full_name()

std::string clanguml::class_diagram::model::enum_::full_name ( bool  relative = true) const
overridevirtual

Return elements full name.

Returns
Fully qualified elements name.

Reimplemented from clanguml::common::model::element.

Definition at line 37 of file enum.cc.

38{
39 using namespace clanguml::util;
41
42 std::ostringstream ostr;
43 if (relative)
44 ostr << namespace_{name_and_ns()}
45 .relative_to(using_namespace())
46 .to_string();
47 else
48 ostr << name_and_ns();
49
50 return ostr.str();
51}

◆ operator=() [1/2]

enum_ & clanguml::class_diagram::model::enum_::operator= ( const enum_ )
delete

◆ operator=() [2/2]

enum_ & clanguml::class_diagram::model::enum_::operator= ( enum_ &&  )
delete

◆ type_name()

std::string clanguml::class_diagram::model::enum_::type_name ( ) const
inlineoverridevirtual

Return the type name of the diagram element.

Returns
Diagrams element type name.

Reimplemented from clanguml::common::model::diagram_element.

Definition at line 40 of file enum.h.

40{ return "enum"; }

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const enum_ l,
const enum_ r 
)
friend

Definition at line 32 of file enum.cc.

33{
34 return (l.get_namespace() == r.get_namespace()) && (l.name() == r.name());
35}

Member Data Documentation

◆ constants_

std::vector<std::string> clanguml::class_diagram::model::enum_::constants_
private

Definition at line 68 of file enum.h.


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