0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
src
common
model
template_trait.h
Go to the documentation of this file.
1
/**
2
* @file src/common/model/template_trait.h
3
*
4
* Copyright (c) 2021-2025 Bartek Kryza <bkryza@gmail.com>
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
17
*/
18
#pragma once
19
20
#include "
common/model/element.h
"
21
#include "
common/model/template_parameter.h
"
22
23
#include <string>
24
#include <vector>
25
26
namespace
clanguml::common::model
{
27
28
/**
29
* @brief Common interface for template diagram elements.
30
*
31
* @embed{template_trait_hierarchy_class.svg}
32
*/
33
class
template_trait
{
34
public
:
35
/**
36
* Render the template parameters to a stream.
37
*
38
* @param ostr Output stream
39
* @param using_namespace Relative to namespace
40
* @param relative Whether to make template arguments relative to
41
* `using_namespace`
42
* @return Reference to output stream
43
*/
44
std::ostream &
render_template_params
(std::ostream &ostr,
45
const
common::model::namespace_
&using_namespace,
bool
relative)
const
;
46
47
/**
48
* Add template parameter
49
*
50
* @param tmplt Template parameter
51
*/
52
void
add_template
(
template_parameter
&&tmplt);
53
54
/**
55
* Get reference to template parameters.
56
*
57
* @return Reference to template parameters list.
58
*/
59
const
std::vector<template_parameter> &
template_params
()
const
;
60
61
/**
62
* @brief Wrapper around @ref
63
* calculate_template_params_specialization_match()
64
*
65
* @param other Other template diagram element
66
* @return Match value
67
*/
68
int
calculate_template_specialization_match
(
69
const
template_trait
&other)
const
;
70
71
private
:
72
std::vector<template_parameter>
templates_
;
73
};
74
75
}
// namespace clanguml::common::model
Copyright © 2022-present
Bartek Kryza
Generated by
1.9.7