llpathfindingobjectlist.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /**
  2. * @file llpathfindingobjectlist.h
  3. * @brief Header file for llpathfindingobjectlist
  4. *
  5. * $LicenseInfo:firstyear=2012&license=viewergpl$
  6. *
  7. * Copyright (c) 2012, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLPATHFINDINGOBJECTLIST_H
  33. #define LL_LLPATHFINDINGOBJECTLIST_H
  34. #include <map>
  35. #include <memory>
  36. #include <string>
  37. #include "llpathfindingobject.h"
  38. class LLPathfindingCharacterList;
  39. class LLPathfindingLinksetList;
  40. class LLPathfindingObjectList
  41. {
  42. public:
  43. typedef std::shared_ptr<LLPathfindingObjectList> ptr_t;
  44. LLPathfindingObjectList();
  45. virtual ~LLPathfindingObjectList();
  46. LL_INLINE virtual LLPathfindingCharacterList* asCharacterList()
  47. {
  48. return NULL;
  49. }
  50. LL_INLINE virtual const LLPathfindingCharacterList* asCharacterList() const
  51. {
  52. return NULL;
  53. }
  54. LL_INLINE virtual LLPathfindingLinksetList* asLinksetList()
  55. {
  56. return NULL;
  57. }
  58. LL_INLINE virtual const LLPathfindingLinksetList* asLinksetList() const
  59. {
  60. return NULL;
  61. }
  62. void clear();
  63. LLPathfindingObject::ptr_t find(const LLUUID& obj_id) const;
  64. LL_INLINE bool isEmpty() const { return mObjectMap.empty(); }
  65. typedef LLPathfindingObject::map_t::const_iterator const_iterator;
  66. LL_INLINE const_iterator begin() const { return mObjectMap.begin(); }
  67. LL_INLINE const_iterator end() const { return mObjectMap.end(); }
  68. void update(LLPathfindingObject::ptr_t objectp);
  69. void update(ptr_t object_listp);
  70. protected:
  71. LL_INLINE LLPathfindingObject::map_t& getObjectMap()
  72. {
  73. return mObjectMap;
  74. }
  75. private:
  76. LLPathfindingObject::map_t mObjectMap;
  77. };
  78. #endif // LL_LLPATHFINDINGOBJECTLIST_H