CrystalSpace

Public API Reference

csutil/scfstrset.h
Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2003 by Anders Stenberg
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_SCFSTRSET_H__
00020 #define __CS_SCFSTRSET_H__
00021 
00026 #include "csextern.h"
00027 #include "csutil/scf_implementation.h"
00028 #include "csutil/strset.h"
00029 #include "iutil/strset.h"
00030 
00031 // For Clear()
00032 #include "csutil/deprecated_warn_off.h"
00033 
00034 namespace CS
00035 {
00047 template<typename IF>
00048 class ScfStringSet : public scfImplementation1<ScfStringSet<IF>, IF>
00049 {
00050 private:
00051   Utility::StringSet<typename IF::TagType, true> set;
00052   typedef StringID<typename IF::TagType> StringIDType;
00053 
00054   typedef scfImplementation1<ScfStringSet<IF>, IF> scfImplementationType_;
00055 public:
00057   ScfStringSet (size_t size = 23) 
00058     : scfImplementationType_ (this), set(size)
00059   { }
00060 
00062   virtual ~ScfStringSet()
00063   { }
00064 
00071   virtual StringIDType Request(const char* s)
00072   { return set.Request(s); }
00073 
00079   virtual const char* Request(StringIDType id) const
00080   { return set.Request(id); }
00081 
00085   virtual bool Contains(char const* s) const
00086   { return set.Contains(s); }
00087 
00093   virtual bool Contains(StringIDType id) const
00094   { return set.Contains(id); }
00095 
00100   virtual bool Delete(char const* s)
00101   { return set.Delete(s); }
00102 
00107   virtual bool Delete(StringIDType id)
00108   { return set.Delete(id); }
00109 
00114   virtual void Empty()
00115   { set.Empty(); }
00116 
00120   virtual void Clear()
00121   { Empty(); }
00122 
00124   virtual size_t GetSize () const
00125   { return set.GetSize(); }
00126 
00132   virtual bool IsEmpty() const
00133   { return set.IsEmpty(); }
00134 
00141   typename Utility::StringSet<typename IF::TagType, true>::GlobalIterator GetIterator () const
00142   { return set.GetIterator(); }
00143 };
00144 } // namespace CS
00145 
00146 typedef CS::ScfStringSet<iStringSet> csScfStringSet;
00147 
00148 #include "csutil/deprecated_warn_on.h"
00149 
00150 #endif // __CS_SCFSTRSET_H__

Generated for Crystal Space 2.0 by doxygen 1.7.6.1