xref: /onnv-gate/usr/src/cmd/man/src/util/nsgmls.src/lib/Id.h (revision 0:68f95e015346)
1 // Copyright (c) 1994 James Clark
2 // See the file COPYING for copying permission.
3 #pragma ident	"%Z%%M%	%I%	%E% SMI"
4 
5 #ifndef Id_INCLUDED
6 #define Id_INCLUDED 1
7 
8 #ifdef __GNUG__
9 #pragma interface
10 #endif
11 
12 #include "Named.h"
13 #include "Location.h"
14 #include "Vector.h"
15 
16 #ifdef SP_NAMESPACE
17 namespace SP_NAMESPACE {
18 #endif
19 
20 class Id : public Named {
21 public:
22   Id(const StringC &);
23   void define(const Location &);
24   void addPendingRef(const Location &);
25   Boolean defined() const;
26   const Location &defLocation() const;
27   const Vector<Location> &pendingRefs() const;
28 private:
29   Location defLocation_;
30   Vector<Location> pendingRefs_;
31 };
32 
33 inline
defined()34 Boolean Id::defined() const
35 {
36   return !defLocation_.origin().isNull();
37 }
38 
39 inline
defLocation()40 const Location &Id::defLocation() const
41 {
42   return defLocation_;
43 }
44 
45 inline
pendingRefs()46 const Vector<Location> &Id::pendingRefs() const
47 {
48   return pendingRefs_;
49 }
50 
51 inline
addPendingRef(const Location & loc)52 void Id::addPendingRef(const Location &loc)
53 {
54   pendingRefs_.push_back(loc);
55 }
56 
57 #ifdef SP_NAMESPACE
58 }
59 #endif
60 
61 #endif /* not Id_INCLUDED */
62