arguments.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2015 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 
16 #ifndef ARGUMENTS_H
17 #define ARGUMENTS_H
18 
19 #include <qlist.h>
20 #include <qcstring.h>
21 
22 class StorageIntf;
23 
24 /*! \brief This class contains the information about the argument of a
25  * function or template
26  *
27  */
28 struct Argument
29 {
30  /*! Construct a new argument. */
31  Argument() {}
32  /*! Copy an argument (does a deep copy of all strings). */
34  {
35  attrib=a.attrib;
36  type=a.type;
37  name=a.name;
38  array=a.array;
39  defval=a.defval;
40  docs=a.docs;
42  }
43  /*! Assignment of an argument (does a deep copy of all strings). */
45  {
46  if (this!=&a)
47  {
48  attrib=a.attrib;
49  type=a.type;
50  name=a.name;
51  array=a.array;
52  defval=a.defval;
53  docs=a.docs;
55  }
56  return *this;
57  }
58  /*! return TRUE if this argument is documentation and the argument has a
59  * non empty name.
60  */
61  bool hasDocumentation() const
62  {
63  return !name.isEmpty() && !docs.isEmpty();
64  }
65 
66  QCString attrib; /*!< Argument's attribute (IDL only) */
67  QCString type; /*!< Argument's type */
68  QCString canType; /*!< Cached value of canonical type (after type resolution). Empty initially. */
69  QCString name; /*!< Argument's name (may be empty) */
70  QCString array; /*!< Argument's array specifier (may be empty) */
71  QCString defval; /*!< Argument's default value (may be empty) */
72  QCString docs; /*!< Argument's documentation (may be empty) */
73  QCString typeConstraint; /*!< Used for Java generics: <T extends C> */
74 };
75 
76 /*! \brief This class represents an function or template argument list.
77  *
78  * This class also stores some information about member that is typically
79  * put after the argument list, such as whether the member is const,
80  * volatile or pure virtual.
81  */
82 class ArgumentList : public QList<Argument>
83 {
84  public:
85  /*! Creates an empty argument list */
87  constSpecifier(FALSE),
88  volatileSpecifier(FALSE),
89  pureSpecifier(FALSE),
90  isDeleted(FALSE)
91  { setAutoDelete(TRUE); }
92  /*! Destroys the argument list */
94  /*! Makes a deep copy of this object */
95  ArgumentList *deepCopy() const;
96  /*! Does any argument of this list have documentation? */
97  bool hasDocumentation() const;
98  /*! Does the member modify the state of the class? default: FALSE. */
100  /*! Is the member volatile? default: FALSE. */
102  /*! Is this a pure virtual member? default: FALSE */
104  /*! C++11 style Trailing return type? */
106  /*! method with =delete */
107  bool isDeleted;
108 
109  static ArgumentList *unmarshal(StorageIntf *s);
110  static void marshal(StorageIntf *s,ArgumentList *argList);
111 };
112 
114 
115 #endif
QCString type
Definition: arguments.h:67
This class represents an function or template argument list.
Definition: arguments.h:82
bool isEmpty() const
Definition: qcstring.h:189
QCString defval
Definition: arguments.h:71
Argument(const Argument &a)
Definition: arguments.h:33
const bool FALSE
Definition: qglobal.h:370
Abstract interface for file based memory storage operations.
Definition: store.h:27
QListIterator< Argument > ArgumentListIterator
Definition: arguments.h:113
QCString canType
Definition: arguments.h:68
bool constSpecifier
Definition: arguments.h:99
QCString typeConstraint
Definition: arguments.h:73
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
bool volatileSpecifier
Definition: arguments.h:101
Argument()
Definition: arguments.h:31
const double a
Argument & operator=(const Argument &a)
Definition: arguments.h:44
bool pureSpecifier
Definition: arguments.h:103
QCString attrib
Definition: arguments.h:66
bool isDeleted
Definition: arguments.h:107
QCString name
Definition: arguments.h:69
QCString trailingReturnType
Definition: arguments.h:105
bool hasDocumentation() const
Definition: arguments.h:61
static QCString * s
Definition: config.cpp:1042
const bool TRUE
Definition: qglobal.h:371
Definition: qlist.h:54
QCString array
Definition: arguments.h:70
QCString docs
Definition: arguments.h:72