113template<
class Type>
class GenericLocator :
public Locator<Type> {
119 public:
typedef Locator<Type> Inherit;
124 private: Locator<Type>* _locator;
129 public: GenericLocator()
139 _locator(locator.getClone())
146 _locator(genericLocator.getClone())
165 if (_locator)
delete _locator;
171 public: GenericLocator& operator=(
const Locator<Type>& locator)
174 if (_locator)
delete _locator;
179 public: GenericLocator& operator=(
const GenericLocator& genericLocator)
182 if (_locator)
delete _locator;
183 _locator = genericLocator.getClone();
187 public: GenericLocator& operator=(Locator<Type>* locator)
192 if (_locator)
delete _locator;
200 public:
virtual Type getElement() const
203 return ((_locator) ? _locator->getElement() : Type());
206 public:
virtual Locator<Type>* getClone() const
209 return ((_locator) ? _locator->getClone() : NULL);
212 public:
virtual Locator<Type>* getLocator()
215 return ( _locator->getLocator () );
222 public:
virtual bool isValid() const
225 return (_locator && _locator->isValid());
231 public:
virtual void progress()
234 if (_locator) _locator->progress();
240 public:
virtual string _getTypeName() const
243 return _TName(
"GenericLocator");
246 public:
virtual string _getString() const
250 return "<" + _getTypeName() +
" unbound>";
252 return "<" + _getTypeName() +
" " + getString(_locator) +
">";