~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/src/infos/CEnumeratorInfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef __CEnumeratorInfo_h__
20
20
#define __CEnumeratorInfo_h__
21
21
 
22
 
// enumeration constant (enumerator) info
23
 
// knows its enumeration and its constant value
 
22
/** \file 
 
23
 *  Semantic information about an enumeration constant. */
24
24
 
25
25
#include "Puma/CAttributeInfo.h"
26
26
#include "Puma/CTypeInfo.h"
33
33
class CT_Enumerator;
34
34
class CT_ExprList;
35
35
 
36
 
/** \file 
37
 
 *  Representation of an enumerator constant.
38
 
 *  \see Puma::CEnumeratorInfo */
39
 
 
40
 
/** \class CEnumeratorInfo CEnumeratorInfo.h Puma/infos/CEnumeratorInfo.h
41
 
 *  A CEnumeratorInfo object represents an enumerator constant. */
 
36
/** \class CEnumeratorInfo CEnumeratorInfo.h Puma/CEnumeratorInfo.h
 
37
 *  Semantic information about an enumeration constant. 
 
38
 *  An enumeration constant also is called enumerator. */
42
39
class CEnumeratorInfo : public CAttributeInfo {
43
40
  CEnumInfo *_Enum;
44
41
  LONG_LONG _Value;
45
42
 
46
43
public: 
47
 
  /** Construct a new enumerator info. */
 
44
  /** Constructor. */
48
45
  CEnumeratorInfo ();
49
 
  /** Destruct the enumerator info. If the object id is 
50
 
   *  \c ENUMERATOR_INFO, Puma::CObjectInfo::CleanUp() is called. */
 
46
  /** Destructor. If the object type is CObjectInfo::ENUMERATOR_INFO, 
 
47
   *  then CObjectInfo::CleanUp() is called. */
51
48
  ~CEnumeratorInfo ();
52
49
  
53
 
  /** Get the base info object of the info object. <b>The 
54
 
   *  corresponding information is not yet set!</b>
55
 
   *  \return This method always returns \c NULL.
56
 
   *  \warning Do not use this method. */
57
 
  CEnumeratorInfo *BaseObject () const;
58
50
  /** Get the syntax tree node of the enumerator constant. */
59
51
  CT_Enumerator *Tree () const;
60
52
  /** Get the initialization expression syntax tree node of
61
53
   *  the enumerator. 
62
 
   *  \return The syntax tree node or \c NULL if no initializer. */
 
54
   *  \return The syntax tree node or NULL if no initializer. */
63
55
  CT_ExprList *Init () const;
64
56
  
65
 
  /** Get the underlying value type. */
 
57
  /** Get the underlying value type. This is implementation-defined
 
58
   *  and defaults to \e int.*/
66
59
  CTypeInfo *UnderlyingType () const;
67
60
 
68
 
  /** Get the corresponding enumeration info. */
 
61
  /** Get the enumeration containing this enumerator. */
69
62
  CEnumInfo *Enum () const;
70
 
  /** Set the enumeration info.
71
 
   *  \param ei The corresponding enumeration info. */
 
63
  /** Set the enumeration containing this enumerator.
 
64
   *  \param ei The enumeration. */
72
65
  void Enum (CEnumInfo *ei);
73
66
 
74
 
  /** Get the constant value of the enumerator. */
 
67
  /** Get the value of the enumerator. */
75
68
  LONG_LONG Value () const;
76
 
  /** Set the value of the enumerator constant. 
77
 
   *  \param v The value of the enumerator. */
 
69
  /** Set the value of the enumerator. 
 
70
   *  \param v The value. */
78
71
  void Value (LONG_LONG v);
79
72
};
80
73
 
94
87
inline LONG_LONG CEnumeratorInfo::Value () const 
95
88
 { return _Value; }
96
89
 
97
 
inline CEnumeratorInfo *CEnumeratorInfo::BaseObject () const
98
 
 { return (CEnumeratorInfo*)CObjectInfo::BaseObject (); }
99
90
 
100
91
} // namespace Puma
101
92