0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
clanguml::common::generators::graphml::property_keymap_t Class Reference

Detailed Description

Mapping of GraphML node properties and their keys. Necessary to generate the <key> property definition elements at the beginning of GraphML document.

Definition at line 69 of file generator.h.

#include <generator.h>

Public Member Functions

 property_keymap_t (std::string prefix)
 
std::pair< std::string, property_typeadd (const std::string &name, property_type pt=property_type::kString)
 
std::optional< std::pair< std::string, property_type > > get (const std::string &name) const
 

Private Attributes

uint64_t next_data_key_id_ {0}
 
std::string prefix_
 
key_property_map_t map_
 

Constructor & Destructor Documentation

◆ property_keymap_t()

clanguml::common::generators::graphml::property_keymap_t::property_keymap_t ( std::string  prefix)

Definition at line 44 of file generator.cc.

45 : prefix_{std::move(prefix)}
46{
47}

Member Function Documentation

◆ add()

std::pair< std::string, property_type > clanguml::common::generators::graphml::property_keymap_t::add ( const std::string &  name,
property_type  pt = property_type::kString 
)

Definition at line 49 of file generator.cc.

51{
52 map_[name] = {fmt::format("{}{}", prefix_, next_data_key_id_++), pt};
53 return map_[name];
54}

◆ get()

auto clanguml::common::generators::graphml::property_keymap_t::get ( const std::string &  name) const

Definition at line 56 of file generator.cc.

58{
59 if (map_.count(name) == 0)
60 return {};
61
62 return map_.at(name);
63}

Member Data Documentation

◆ map_

key_property_map_t clanguml::common::generators::graphml::property_keymap_t::map_
private

Definition at line 83 of file generator.h.

◆ next_data_key_id_

uint64_t clanguml::common::generators::graphml::property_keymap_t::next_data_key_id_ {0}
private

Definition at line 80 of file generator.h.

◆ prefix_

std::string clanguml::common::generators::graphml::property_keymap_t::prefix_
private

Definition at line 82 of file generator.h.


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