File: 105_using.cpp

package info (click to toggle)
doxygen 1.15.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 25,384 kB
  • sloc: cpp: 223,248; lex: 45,536; python: 32,394; ansic: 26,761; xml: 16,962; javascript: 8,627; yacc: 582; f90: 455; php: 427; perl: 384; makefile: 201; sh: 24; objc: 14; cs: 5; java: 1
file content (106 lines) | stat: -rw-r--r-- 1,797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// objective: test type resolution with combinations of using/namespace/template
// check: namespacebb.xml
// check: namespaceitpp.xml

//! namespace itpp
namespace itpp
{
  //! Vector
  template<class Num_T>
  class Vec {
    //! Set the vector equal to the values in the \c str string
    bool set(const char *str);
  };

  //! Fixed complex data type
  class CFix {};

  //! Typedef for complex fixed-point vector type
  typedef Vec<CFix> cfixvec;

  //! setter
  template<>
  bool cfixvec::set(const char *values)
  {
    return true;
  }

} // namespace itpp

//! namespace aa
namespace aa
{
  /**
   * @brief Struct1
   */
  struct Struct1
  {
    int struct1_0; //!< field 1_0
    int struct1_1; //!< field 1_1
  };

  /**
   * @brief Struct2
   */
  struct Struct2
  {
    int struct2_0; //!< field 2_0
    int struct2_1; //!< field 2_1
  };

} // namespace aa

//! namespace bb
namespace bb {

/**
 * @brief TemplateStruct
 */
template <typename T>
struct TemplateStruct
{
    T data;             //!< data
};

/**
 * @brief alias of Structt1 in bb
 */
 using Struct1 = aa::Struct1;

 /**
 * @brief alias of Structt2 in bb
 */
 using Struct2 = aa::Struct2;

 /**
  * @brief Struct1Type
  */
 using Struct1Type = TemplateStruct<aa::Struct1>;

 /**
  * @brief Struct2Type
  */
 using Struct2Type = TemplateStruct<aa::Struct2>;

 /**
    * @brief   FunctionExample (overload 1)
    *
    * @param[out] arg1 Struct1Type argument
    * @param[in] arg2 int argument
    *
    * @return return value
  */
int FunctionExample(Struct1Type arg1, int arg2);

/**
    * @brief   FunctionExample (overload 2)
    *
    * @param[out] arg1 Struct2Type argument
    * @param[in] arg2 int argument
    *
    * @return return value
  */
int FunctionExample(Struct2Type arg1, int arg2);

} // namespace bb