2
0

vector.cpp 509 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // Proxy support for Vector<SharedPtr<FOO>>
  3. //
  4. #include <stdio.h>
  5. #include <string.h>
  6. #ifndef _MSC_VER
  7. # include <unistd.h>
  8. #endif
  9. #include "AllUrho.h"
  10. #include "glue.h"
  11. using namespace Urho3D;
  12. extern "C" {
  13. DllExport
  14. int VectorSharedPtr_Count (Vector<SharedPtr<Object> > *vector)
  15. {
  16. return vector->Size ();
  17. }
  18. DllExport
  19. void *VectorSharedPtr_GetIdx (Vector<SharedPtr<Object> > *vector, int idx)
  20. {
  21. if (idx < 0 || idx > vector->Size ())
  22. return NULL;
  23. return (*vector) [idx].Get ();
  24. }
  25. }