view usr/src/cmd/man/src/util/nsgmls.src/lib/Id.h @ 4:1a15d5aaf794

synchronized with onnv_86 (6202) in onnv-gate
author Koji Uno <koji.uno@sun.com>
date Mon, 31 Aug 2009 14:38:03 +0900
parents c9caec207d52
children
line wrap: on
line source

// Copyright (c) 1994 James Clark
// See the file COPYING for copying permission.
#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifndef Id_INCLUDED
#define Id_INCLUDED 1

#ifdef __GNUG__
#pragma interface
#endif

#include "Named.h"
#include "Location.h"
#include "Vector.h"

#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif

class Id : public Named {
public:
  Id(const StringC &);
  void define(const Location &);
  void addPendingRef(const Location &);
  Boolean defined() const;
  const Location &defLocation() const;
  const Vector<Location> &pendingRefs() const;
private:
  Location defLocation_;
  Vector<Location> pendingRefs_;
};

inline
Boolean Id::defined() const
{
  return !defLocation_.origin().isNull();
}

inline
const Location &Id::defLocation() const
{
  return defLocation_;
}

inline
const Vector<Location> &Id::pendingRefs() const
{
  return pendingRefs_;
}

inline
void Id::addPendingRef(const Location &loc)
{
  pendingRefs_.push_back(loc);
}

#ifdef SP_NAMESPACE
}
#endif

#endif /* not Id_INCLUDED */