| 1737 | } |
| 1738 | |
| 1739 | void store_instance_data(unique_ptr<MessageTypeWithAllocator> instance_data, |
| 1740 | DDS::InstanceHandle_t publication_handle, |
| 1741 | const OpenDDS::DCPS::DataSampleHeader& header, |
| 1742 | OpenDDS::DCPS::SubscriptionInstance_rch& instance_ptr, |
| 1743 | bool& just_registered, |
| 1744 | bool& filtered) |
| 1745 | { |
| 1746 | ACE_UNUSED_ARG(publication_handle); |
| 1747 | |
| 1748 | const bool is_dispose_msg = |
| 1749 | header.message_id_ == OpenDDS::DCPS::DISPOSE_INSTANCE || |
| 1750 | header.message_id_ == OpenDDS::DCPS::DISPOSE_UNREGISTER_INSTANCE; |
| 1751 | const bool is_unregister_msg = |
| 1752 | header.message_id_ == OpenDDS::DCPS::UNREGISTER_INSTANCE || |
| 1753 | header.message_id_ == OpenDDS::DCPS::DISPOSE_UNREGISTER_INSTANCE; |
| 1754 | |
| 1755 | if (!store_instance_data_check(instance_data, publication_handle, header, instance_ptr)) { |
| 1756 | return; |
| 1757 | } |
| 1758 | |
| 1759 | // not filtering any data, except what is specifically identified as filtered below |
| 1760 | filtered = false; |
| 1761 | |
| 1762 | DDS::InstanceHandle_t handle(DDS::HANDLE_NIL); |
| 1763 | |
| 1764 | //!!! caller should already have the sample_lock_ |
| 1765 | //We will unlock it before calling into listeners |
| 1766 | |
| 1767 | typename InstanceMap::const_iterator const it = instance_map_.find(*instance_data); |
| 1768 | |
| 1769 | if (it == instance_map_.end()) { |
| 1770 | if (is_dispose_msg || is_unregister_msg) { |
| 1771 | return; |
| 1772 | } |
| 1773 | |
| 1774 | std::size_t instances_size = 0; |
| 1775 | { |
| 1776 | ACE_GUARD(ACE_Recursive_Thread_Mutex, instance_guard, instances_lock_); |
| 1777 | instances_size = instances_.size(); |
| 1778 | } |
| 1779 | if ((qos_.resource_limits.max_instances != DDS::LENGTH_UNLIMITED) && |
| 1780 | ((::CORBA::Long) instances_size >= qos_.resource_limits.max_instances)) |
| 1781 | { |
| 1782 | DDS::DataReaderListener_var listener |
| 1783 | = listener_for (DDS::SAMPLE_REJECTED_STATUS); |
| 1784 | |
| 1785 | set_status_changed_flag (DDS::SAMPLE_REJECTED_STATUS, true); |
| 1786 | |
| 1787 | sample_rejected_status_.last_reason = DDS::REJECTED_BY_INSTANCES_LIMIT; |
| 1788 | ++sample_rejected_status_.total_count; |
| 1789 | ++sample_rejected_status_.total_count_change; |
| 1790 | sample_rejected_status_.last_instance_handle = handle; |
| 1791 | |
| 1792 | if (!CORBA::is_nil(listener.in())) |
| 1793 | { |
| 1794 | ACE_GUARD(typename DataReaderImpl::Reverse_Lock_t, unlock_guard, reverse_sample_lock_); |
| 1795 | |
| 1796 | listener->on_sample_rejected(this, sample_rejected_status_); |
no test coverage detected