| 727 | |
| 728 | template <typename T> |
| 729 | RefPtr<T> translateHandle(GlobalPtr<GenericMap<Pair<NonPooled<FB_API_HANDLE, T*> > > >& map, |
| 730 | FB_API_HANDLE* handle) |
| 731 | { |
| 732 | if (!handle) |
| 733 | status_exception::raise(Arg::Gds(T::ERROR_CODE)); |
| 734 | |
| 735 | ReadLockGuard sync(handleMappingLock, FB_FUNCTION); |
| 736 | |
| 737 | T** obj = map->get(*handle); |
| 738 | |
| 739 | if (!obj) |
| 740 | status_exception::raise(Arg::Gds(T::ERROR_CODE)); |
| 741 | |
| 742 | return RefPtr<T>(*obj); |
| 743 | } |
| 744 | |
| 745 | //------------------------------------- |
| 746 |
no test coverage detected