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::jinja::jinja_context< T, Tag > Class Template Reference

Jinja diagram element context wrapper. More...

Detailed Description

template<typename T, typename Tag>
class clanguml::common::jinja::jinja_context< T, Tag >

Jinja diagram element context wrapper.

This template allows to have custom adl serializers for JSON, which only work for Jinja templates, and not JSON generator.

Template Parameters
TDiagram model element

Definition at line 43 of file jinja_context.h.

#include <jinja_context.h>

Public Member Functions

 jinja_context (const T &e, const inja::json &diagram_context) noexcept
 
 jinja_context (const T &e) noexcept
 
const T & get () const noexcept
 
template<typename U >
const jinja_context< U, Tag > as () const
 
const inja::json & diagram_context () const
 

Private Attributes

const T & value_
 
const inja::json & diagram_context_
 

Constructor & Destructor Documentation

◆ jinja_context() [1/2]

template<typename T , typename Tag >
clanguml::common::jinja::jinja_context< T, Tag >::jinja_context ( const T &  e,
const inja::json &  diagram_context 
)
inlineexplicitnoexcept

Definition at line 45 of file jinja_context.h.

47 : value_{e}
49 {
50 }

◆ jinja_context() [2/2]

template<typename T , typename Tag >
clanguml::common::jinja::jinja_context< T, Tag >::jinja_context ( const T &  e)
inlineexplicitnoexcept

Definition at line 52 of file jinja_context.h.

53 : jinja_context(e, {})
54 {
55 }

Member Function Documentation

◆ as()

template<typename T , typename Tag >
template<typename U >
const jinja_context< U, Tag > clanguml::common::jinja::jinja_context< T, Tag >::as ( ) const
inline

Definition at line 59 of file jinja_context.h.

60 {
61 return jinja_context<U, Tag>(
62 dynamic_cast<const U &>(value_), diagram_context_);
63 }

◆ diagram_context()

template<typename T , typename Tag >
const inja::json & clanguml::common::jinja::jinja_context< T, Tag >::diagram_context ( ) const
inline

Definition at line 65 of file jinja_context.h.

65{ return diagram_context_; }

◆ get()

template<typename T , typename Tag >
const T & clanguml::common::jinja::jinja_context< T, Tag >::get ( ) const
inlinenoexcept

Definition at line 57 of file jinja_context.h.

57{ return value_; }

Member Data Documentation

◆ diagram_context_

template<typename T , typename Tag >
const inja::json& clanguml::common::jinja::jinja_context< T, Tag >::diagram_context_
private

Definition at line 69 of file jinja_context.h.

◆ value_

template<typename T , typename Tag >
const T& clanguml::common::jinja::jinja_context< T, Tag >::value_
private

Definition at line 68 of file jinja_context.h.


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