0.5.4
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Public Member Functions | List of all members
clanguml::sequence_diagram::model::function_template Struct Reference

Participant model representing a function template. More...

Detailed Description

Participant model representing a function template.

Definition at line 517 of file participant.h.

#include <participant.h>

Public Member Functions

 function_template (const common::model::namespace_ &using_namespace)
 
 function_template (const function_template &)=delete
 
 function_template (function_template &&) noexcept=delete
 
function_templateoperator= (const function_template &)=delete
 
function_templateoperator= (function_template &&)=delete
 
std::string type_name () const override
 
std::string full_name (bool relative=true) const override
 
std::string full_name_no_ns () const override
 
std::string message_name (message_render_mode mode) const override
 Render function name as message label.
 
- Public Member Functions inherited from clanguml::sequence_diagram::model::function
 function (const common::model::namespace_ &using_namespace)
 
 function (const function &)=delete
 
 function (function &&) noexcept=delete
 
functionoperator= (const function &)=delete
 
functionoperator= (function &&)=delete
 
std::string type_name () const override
 
std::string full_name (bool relative=true) const override
 
std::string full_name_no_ns () const override
 
virtual std::string message_name (message_render_mode mode) const
 Render function name as message label.
 
bool is_const () const
 Check if function is const.
 
void is_const (bool c)
 Set whether the function is const.
 
bool is_void () const
 Check, if the function has no return value.
 
void is_void (bool v)
 Set whether the function has a return value.
 
bool is_static () const
 Check, if the function is static.
 
void is_static (bool s)
 Set whether the function is static.
 
bool is_operator () const
 Check, if the method is an operator.
 
void is_operator (bool o)
 Set whether the method is an operator.
 
bool is_cuda_kernel () const
 Check, if a functions is a call to CUDA Kernel.
 
void is_cuda_kernel (bool c)
 Set whether the method is a CUDA kernel call.
 
bool is_cuda_device () const
 Check, if a functions is a call to CUDA device.
 
void is_cuda_device (bool c)
 Set whether the method is a CUDA device call.
 
void return_type (const std::string &rt)
 Set functions return type.
 
const std::string & return_type () const
 Get function return type.
 
void add_parameter (const std::string &a)
 Add a function parameter.
 
const std::vector< std::string > & parameters () const
 Get the list of function parameters.
 
- Public Member Functions inherited from clanguml::sequence_diagram::model::participant
 participant (const participant &)=delete
 
 participant (participant &&) noexcept=delete
 
participantoperator= (const participant &)=delete
 
participantoperator= (participant &&)=delete
 
std::string type_name () const override
 
virtual std::string to_string () const
 Create a string representation of the participant.
 
- Public Member Functions inherited from clanguml::common::model::template_element
 ~template_element () override=default
 
bool is_template () const
 
void is_template (bool is_template)
 
int calculate_template_specialization_match (const template_element &other) const
 Calculate template specialization match with other class.
 
bool template_specialization_found () const
 
void template_specialization_found (bool found)
 
 element (namespace_ using_namespace, path_type pt=path_type::kNamespace)
 
- 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::template_trait
std::ostream & render_template_params (std::ostream &ostr, const common::model::namespace_ &using_namespace, bool relative) const
 
void add_template (template_parameter &&tmplt)
 
const std::vector< template_parameter > & template_params () const
 
int calculate_template_specialization_match (const template_trait &other) const
 Wrapper around calculate_template_params_specialization_match()
 
- Public Member Functions inherited from clanguml::common::model::stylable_element
void set_style (const std::string &style)
 
std::optional< std::string > style () const
 

Additional Inherited Members

- Public Types inherited from clanguml::sequence_diagram::model::function
enum class  message_render_mode { full , abbreviated , no_arguments }
 
- Public Types inherited from clanguml::sequence_diagram::model::participant
enum class  stereotype_t {
  participant = 0 , actor , boundary , control ,
  entity , database , collections , queue
}
 Enum representing stereotype of a participant. More...
 
- Public Attributes inherited from clanguml::sequence_diagram::model::participant
stereotype_t stereotype_ {stereotype_t::participant}
 

Constructor & Destructor Documentation

◆ function_template() [1/3]

clanguml::sequence_diagram::model::function_template::function_template ( const common::model::namespace_ using_namespace)

Definition at line 249 of file participant.cc.

252{
253}

◆ function_template() [2/3]

clanguml::sequence_diagram::model::function_template::function_template ( const function_template )
delete

◆ function_template() [3/3]

clanguml::sequence_diagram::model::function_template::function_template ( function_template &&  )
deletenoexcept

Member Function Documentation

◆ full_name()

std::string clanguml::sequence_diagram::model::function_template::full_name ( bool  relative = true) const
overridevirtual

Return elements full name.

Returns
Fully qualified elements name.

Reimplemented from clanguml::sequence_diagram::model::function.

Definition at line 255 of file participant.cc.

256{
257 using namespace clanguml::util;
259
260 std::ostringstream ostr;
261
262 ostr << name_and_ns();
263 render_template_params(ostr, using_namespace(), relative);
264
265 ostr << fmt::format(
266 "({}){}", fmt::join(parameters(), ","), is_const() ? " const" : "");
267
268 std::string res;
269
270 if (relative)
271 res = using_namespace().relative(ostr.str());
272 else
273 res = ostr.str();
274
275 if (res.empty())
276 return "<<anonymous>>";
277
278 return res;
279}

◆ full_name_no_ns()

std::string clanguml::sequence_diagram::model::function_template::full_name_no_ns ( ) const
overridevirtual

Return elements full name but without namespace.

Returns
Elements full name without namespace.

Reimplemented from clanguml::sequence_diagram::model::function.

Definition at line 281 of file participant.cc.

282{
283 using namespace clanguml::util;
284
285 std::ostringstream ostr;
286
287 ostr << name();
288
290
291 ostr << fmt::format(
292 "({}){}", fmt::join(parameters(), ","), is_const() ? " const" : "");
293
294 return ostr.str();
295}

◆ message_name()

std::string clanguml::sequence_diagram::model::function_template::message_name ( message_render_mode  mode) const
overridevirtual

Render function name as message label.

Parameters
modeFunction argument render mode
Returns
Message label

Reimplemented from clanguml::sequence_diagram::model::function.

Definition at line 297 of file participant.cc.

298{
299 constexpr auto kAbbreviatedMethodArgumentsLength{15};
300
301 std::ostringstream s;
303 const std::string template_params = s.str();
304
306 return fmt::format(
307 "{}{}(){}", name(), template_params, is_const() ? " const" : "");
308 }
310 return fmt::format("{}({}){}", name(),
312 fmt::format("{}", fmt::join(parameters(), ",")),
313 kAbbreviatedMethodArgumentsLength),
314 is_const() ? " const" : "");
315 }
316
317 return fmt::format("{}{}({}){}", name(), template_params,
318 fmt::join(parameters(), ","), is_const() ? " const" : "");
319}

◆ operator=() [1/2]

function_template & clanguml::sequence_diagram::model::function_template::operator= ( const function_template )
delete

◆ operator=() [2/2]

function_template & clanguml::sequence_diagram::model::function_template::operator= ( function_template &&  )
delete

◆ type_name()

std::string clanguml::sequence_diagram::model::function_template::type_name ( ) const
inlineoverridevirtual

Get the type name of the diagram element.

Returns
Type name of the diagram element.

Reimplemented from clanguml::sequence_diagram::model::function.

Definition at line 530 of file participant.h.

530{ return "function_template"; }

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