PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/android/jni/List.cpp

http://github.com/xbmc/xbmc
C++ | 46 lines | 22 code | 5 blank | 19 comment | 0 complexity | ba6cacfd9e8c9f6809e501016393eb5c MD5 | raw file
Possible License(s): GPL-3.0, CC-BY-SA-3.0, LGPL-2.0, 0BSD, Unlicense, GPL-2.0, AGPL-1.0, BSD-3-Clause, LGPL-2.1, LGPL-3.0
  1. /*
  2. * Copyright (C) 2013 Team XBMC
  3. * http://xbmc.org
  4. *
  5. * This Program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2, or (at your option)
  8. * any later version.
  9. *
  10. * This Program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with XBMC; see the file COPYING. If not, see
  17. * <http://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #include "List.h"
  21. #include "jutils/jutils-details.hpp"
  22. #include "ScanResult.h"
  23. #include "WifiConfiguration.h"
  24. #include "ApplicationInfo.h"
  25. using namespace jni;
  26. template <typename T>
  27. T CJNIList<T>::get(int index)
  28. {
  29. return (T)call_method<jhobject>(m_object,
  30. "get", "(I)Ljava/lang/Object;",
  31. index);
  32. }
  33. template <typename T>
  34. int CJNIList<T>::size()
  35. {
  36. return m_object.get() ? call_method<jint>(m_object,
  37. "size", "()I") : 0;
  38. }
  39. template class CJNIList<CJNIScanResult>;
  40. template class CJNIList<CJNIWifiConfiguration>;
  41. template class CJNIList<CJNIApplicationInfo>;