Blame src/arguments.h

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