Blame src/arguments.h

Packit 1c1d7e
/******************************************************************************
Packit 1c1d7e
 *
Packit 1c1d7e
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Permission to use, copy, modify, and distribute this software and its
Packit 1c1d7e
 * documentation under the terms of the GNU General Public License is hereby 
Packit 1c1d7e
 * granted. No representations are made about the suitability of this software 
Packit 1c1d7e
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit 1c1d7e
 * See the GNU General Public License for more details.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Documents produced by Doxygen are derivative works derived from the
Packit 1c1d7e
 * input used in their production; they are not affected by this license.
Packit 1c1d7e
 *
Packit 1c1d7e
 */
Packit 1c1d7e
Packit 1c1d7e
#ifndef ARGUMENTS_H
Packit 1c1d7e
#define ARGUMENTS_H
Packit 1c1d7e
Packit 1c1d7e
#include <qlist.h>
Packit 1c1d7e
#include <qcstring.h>
Packit 1c1d7e
Packit 1c1d7e
class StorageIntf;
Packit 1c1d7e
Packit 1c1d7e
/*! \brief This class contains the information about the argument of a
Packit 1c1d7e
 *         function or template
Packit 1c1d7e
 *
Packit 1c1d7e
 */
Packit 1c1d7e
struct Argument
Packit 1c1d7e
{
Packit 1c1d7e
  /*! Construct a new argument. */
Packit 1c1d7e
  Argument() {}
Packit 1c1d7e
  /*! Copy an argument (does a deep copy of all strings). */
Packit 1c1d7e
  Argument(const Argument &a)
Packit 1c1d7e
  {
Packit 1c1d7e
    attrib=a.attrib;
Packit 1c1d7e
    type=a.type;
Packit 1c1d7e
    name=a.name;
Packit 1c1d7e
    array=a.array;
Packit 1c1d7e
    defval=a.defval;
Packit 1c1d7e
    docs=a.docs;
Packit 1c1d7e
    typeConstraint=a.typeConstraint;
Packit 1c1d7e
  }
Packit 1c1d7e
  /*! Assignment of an argument (does a deep copy of all strings). */
Packit 1c1d7e
  Argument &operator=(const Argument &a)
Packit 1c1d7e
  {
Packit 1c1d7e
    if (this!=&a)
Packit 1c1d7e
    {
Packit 1c1d7e
      attrib=a.attrib;
Packit 1c1d7e
      type=a.type;
Packit 1c1d7e
      name=a.name;
Packit 1c1d7e
      array=a.array;
Packit 1c1d7e
      defval=a.defval;
Packit 1c1d7e
      docs=a.docs;
Packit 1c1d7e
      typeConstraint=a.typeConstraint;
Packit 1c1d7e
    }
Packit 1c1d7e
    return *this;
Packit 1c1d7e
  }
Packit 1c1d7e
  /*! return TRUE if this argument is documentation and the argument has a
Packit 1c1d7e
   *  non empty name.
Packit 1c1d7e
   */
Packit 1c1d7e
  bool hasDocumentation() const
Packit 1c1d7e
  {
Packit 1c1d7e
    return !name.isEmpty() && !docs.isEmpty();
Packit 1c1d7e
  }
Packit 1c1d7e
Packit 1c1d7e
  QCString attrib;   /*!< Argument's attribute (IDL only) */
Packit 1c1d7e
  QCString type;     /*!< Argument's type */
Packit 1c1d7e
  QCString canType;  /*!< Cached value of canonical type (after type resolution). Empty initially. */
Packit 1c1d7e
  QCString name;     /*!< Argument's name (may be empty) */
Packit 1c1d7e
  QCString array;    /*!< Argument's array specifier (may be empty) */
Packit 1c1d7e
  QCString defval;   /*!< Argument's default value (may be empty) */
Packit 1c1d7e
  QCString docs;     /*!< Argument's documentation (may be empty) */
Packit 1c1d7e
  QCString typeConstraint;  /*!< Used for Java generics: \<T extends C\> */
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
enum RefQualifierType
Packit 1c1d7e
{
Packit 1c1d7e
  RefQualifierNone,
Packit 1c1d7e
  RefQualifierLValue,
Packit 1c1d7e
  RefQualifierRValue
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
/*! \brief This class represents an function or template argument list. 
Packit 1c1d7e
 *
Packit 1c1d7e
 *  This class also stores some information about member that is typically
Packit 1c1d7e
 *  put after the argument list, such as whether the member is const, 
Packit 1c1d7e
 *  volatile or pure virtual.
Packit 1c1d7e
 */
Packit 1c1d7e
class ArgumentList : public QList<Argument> 
Packit 1c1d7e
{
Packit 1c1d7e
  public:
Packit 1c1d7e
    /*! Creates an empty argument list */
Packit 1c1d7e
    ArgumentList() : QList<Argument>(), 
Packit 1c1d7e
                     constSpecifier(FALSE),
Packit 1c1d7e
                     volatileSpecifier(FALSE),
Packit 1c1d7e
                     pureSpecifier(FALSE),
Packit 1c1d7e
                     isDeleted(FALSE),
Packit 1c1d7e
                     refQualifier(RefQualifierNone)
Packit 1c1d7e
                     { setAutoDelete(TRUE); }
Packit 1c1d7e
    /*! Destroys the argument list */
Packit 1c1d7e
   ~ArgumentList() {}
Packit 1c1d7e
    /*! Makes a deep copy of this object */
Packit 1c1d7e
    ArgumentList *deepCopy() const;
Packit 1c1d7e
    /*! Does any argument of this list have documentation? */
Packit 1c1d7e
    bool hasDocumentation() const;
Packit 1c1d7e
    /*! Does the member modify the state of the class? default: FALSE. */
Packit 1c1d7e
    bool constSpecifier;
Packit 1c1d7e
    /*! Is the member volatile? default: FALSE. */
Packit 1c1d7e
    bool volatileSpecifier;
Packit 1c1d7e
    /*! Is this a pure virtual member? default: FALSE */
Packit 1c1d7e
    bool pureSpecifier;
Packit 1c1d7e
    /*! C++11 style Trailing return type? */
Packit 1c1d7e
    QCString trailingReturnType;
Packit 1c1d7e
    /*! method with =delete */
Packit 1c1d7e
    bool isDeleted;
Packit 1c1d7e
    /*! C++11 ref qualifier */
Packit 1c1d7e
    RefQualifierType refQualifier;
Packit 1c1d7e
Packit 1c1d7e
    static ArgumentList *unmarshal(StorageIntf *s);
Packit 1c1d7e
    static void marshal(StorageIntf *s,ArgumentList *argList);
Packit 1c1d7e
};
Packit 1c1d7e
Packit 1c1d7e
typedef QListIterator<Argument> ArgumentListIterator;
Packit 1c1d7e
Packit 1c1d7e
#endif