daeRawResolver.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2006 Sony Computer Entertainment Inc.
  3. *
  4. * Licensed under the MIT Open Source License, for details please see license.txt or the website
  5. * http://www.opensource.org/licenses/mit-license.php
  6. *
  7. */
  8. #ifndef __DAE_RAWRESOLVER_H__
  9. #define __DAE_RAWRESOLVER_H__
  10. #include <string>
  11. #include <map>
  12. #include <dae/daeURI.h>
  13. class DAE;
  14. /**
  15. * The @c daeRawResolver class derives from @c daeURIResolver and implements
  16. * the .raw backend resolver for raw binary data.
  17. */
  18. class DLLSPEC daeRawResolver : public daeURIResolver
  19. {
  20. public:
  21. /**
  22. * Constructor.
  23. */
  24. daeRawResolver(DAE& dae);
  25. /**
  26. * Destructor.
  27. */
  28. ~daeRawResolver();
  29. public: // Abstract Interface
  30. virtual daeElement* resolveElement(const daeURI& uri);
  31. virtual daeString getName();
  32. };
  33. // A simple class to make speed up the process of resolving a .raw URI.
  34. // The result of the resolve is cached for future use.
  35. // This is meant for DOM internal use only.
  36. class DLLSPEC daeRawRefCache {
  37. public:
  38. daeRawRefCache() { lookupTable = new std::map<std::string, daeElement*>(); }
  39. ~daeRawRefCache() { delete lookupTable; }
  40. daeElement* lookup(const daeURI& uri);
  41. void add(const daeURI& uri, daeElement* elt);
  42. void remove(const daeURI& uri);
  43. void clear();
  44. private:
  45. std::map<std::string, daeElement*> * lookupTable;
  46. };
  47. #endif